Skip to content

feat(single-agent-turn): forward Resources seed observations - #5142

Merged
RyaliNvidia merged 6 commits into
NVIDIA-NeMo:mainfrom
RyaliNvidia:codex/g4-seed-reset-observation
Nov 3, 2026
Merged

RyaliNvidia merged 6 commits into
NVIDIA-NeMo:mainfrom
RyaliNvidia:codex/g4-seed-reset-observation

Conversation

@RyaliNvidia

@RyaliNvidia RyaliNvidia commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Add an optional observation string to ResourcesSeedSessionResponse for tasks whose prompt becomes available during seed/reset. single_agent_turn appends a nonempty observation verbatim as one user message after a copy of authored input, normalizing string input only when necessary.

Preserve authored model controls/tools and send original authored input to verification. Missing, null and empty observations retain existing behavior. Store the observation in checkpointed session handles so restore before invocation supplies it without reseeding; older handles remain compatible. Validate the seed response and session identity before storing it. Preserve existing seed-response JSON when no observation is supplied; explicitly supplied null/text values remain supported.

Incorporates current main 3bf99705a905f9aefb18b03875a003189ff1edbf, using canonical package locations and preserving its stop, skip-verification and verifier-evidence behavior and tests. No separate issue is needed for this focused Resources/Environment Server contract extension.

Validation

  • Fixed the latest blocking core-CI failure by importing checkpoint types from the existing public nemo_gym.server_runtime exports. The original policy check failed before the correction; the complete public-API facade suite and both checkpoint-observation variants now pass (368 tests). Only one test import changed; no production code or assertions changed. Full repository hooks and whitespace checks passed; the private guardwords catalog remained unavailable. The earlier CI run passed 14,244 core tests and failed only this import-policy check; the full core suite was not rerun locally for this import-only correction.
  • Main then advanced with a server-runtime module split. Resolved its test-import conflict by retaining both main's canonical imports and the feature imports. On the final merged tree, 342 focused tests and all 3 unchanged Terminal Bench CI cases passed again; independent final review passed 47 targeted checks. Final hooks, Fern and whitespace checks passed. Full wrapper totals below were recorded on the CI-fix commit before this namespace-only integration.
  • Fixed the blocking CI failures in the unchanged Terminal Bench 2.1 and Terminal Bench 4 seed-response tests: when a server does not set observation, serialization omits that field while preserving all other defaults. Explicit null, empty, whitespace and text values still round-trip. The model's structured validation/serialization JSON Schema and FastAPI OpenAPI response schema remain intact.
  • Both original Terminal Bench 2.1 CI cases failed before the fix and pass afterward. Disabling omission reproduces Terminal Bench 4's exact failure. No Terminal Bench assertions or dependency files were changed.
  • Six focused observation/session/checkpoint suites: 342 passed. Actual isolated server wrappers: single_agent_turn 151 passed; Terminal Bench 2.1 89 passed, 13 skipped; Terminal Bench 4 302 passed, 1 skipped. Both Resources data validations passed.
  • Wrappers used separate environments prepared from uv.lock through Gym's setup helper and reused with skip_venv_if_present=true. Terminal Bench 4 also used its declared server-specific packages, including OpenSandbox 0.1.16, through its existing overrides. No source dependency pins were changed.
  • Independent verification: 47 focused checks passed, including schema/OpenAPI, forwarding and checkpoint regressions; a 160-case option matrix preserved the legacy wire contract. Restoring the overly broad serializer return annotation makes both new serialization-schema/OpenAPI regressions fail.
  • Current-main necessity check still holds: replacing invocation with main's method makes all 5 observation-forwarding regressions fail. Main lacks the new response field and forwarding.
  • pre-commit run --all-files, Ruff/format and PR-relative whitespace checks passed. Private guardwords catalog unavailable, so its private scan was skipped. Fern validation passed with zero errors; unauthenticated redirect-history checking was skipped.

Compatibility and limits

Only single_agent_turn consumes the field. Agents accepting one user message need empty authored user input when Resources supplies the prompt. No new checkpoint mechanism, task identity, digest or verification-input change.

Live model/sandbox rollout: N/A for this protocol forwarding change. Deterministic fixtures establish transport behavior, not task quality. Full core/all-server and remote sandbox qualification were not run. No dependency, image or authentication change. Fixtures are synthetic; commits include DCO sign-off. No review replies or CI trust-approval comments were posted.

Proposed maintainer labels: feature, area:env-infra, needs-review.

@copy-pr-bot

copy-pr-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@nemo-automation-bot nemo-automation-bot Bot added the community-request Issue reported or requested by someone from the community label Oct 27, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:env-infra Shared environment framework, lifecycle, registry, scaffolding, and validation feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer labels Oct 27, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 28, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Oct 29, 2026
yaoyu-33
yaoyu-33 previously approved these changes Oct 30, 2026

@yaoyu-33 yaoyu-33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Observation forwarding preserves verification inputs and checkpoint behavior; 140 focused tests passed. Please resolve the conflict and run CI before merging.

@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 30, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added waiting-on-maintainers Waiting on maintainers to respond and removed waiting-on-maintainers Waiting on maintainers to respond labels Oct 30, 2026
@RyaliNvidia

Copy link
Copy Markdown
Contributor Author

/ok to test e33aa29

@nemo-automation-bot nemo-automation-bot Bot removed the community-request Issue reported or requested by someone from the community label Nov 2, 2026
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 2, 2026 18:05
Signed-off-by: RyaliNvidia <[email protected]>
@RyaliNvidia
RyaliNvidia enabled auto-merge November 2, 2026 18:10
@RyaliNvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 8c92a74

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

yaoyu-33
yaoyu-33 previously approved these changes Nov 2, 2026

@yaoyu-33 yaoyu-33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reapproved after checking the seed-response compatibility fix and main integration. 171 focused Resources/session/environment tests and four HTTP serialization probes passed; observation forwarding, verification inputs, and checkpoint behavior remain intact. No new blocking issue found. Latest-head required CI is still outstanding.

@yaoyu-33 yaoyu-33 added ready-to-merge PR is approved, current, and waiting for final CI or merge and removed needs-review PR is ready for code review and waiting on a reviewer labels Nov 2, 2026
@RyaliNvidia

Copy link
Copy Markdown
Contributor Author

/ok to test a24f8cb

@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-maintainers Waiting on maintainers to respond label Nov 2, 2026
@RyaliNvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 5713ae5

@RyaliNvidia
RyaliNvidia added this pull request to the merge queue Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41574956403

Merged via the queue into NVIDIA-NeMo:main with commit 101a442 Nov 3, 2026
83 of 90 checks passed
@RyaliNvidia
RyaliNvidia deleted the codex/g4-seed-reset-observation branch November 3, 2026 04:33
AdamRajfer added a commit that referenced this pull request Nov 3, 2026
Main's #5142 forwards a Resources seed observation to the agent. It met
this branch only in the single-turn environment's import blocks.

- app.py: both import sets kept. The seed observation lands on the
  session handles and reaches the agent request, as on main; this
  branch's failure-reply verification is unchanged.
- tests/test_app.py: this branch's imports plus the four names #5142
  adds, and SingleAgentTurnRequest for its new test. The test that an
  unvalidated seed observation stays out of the session handles expects
  NgFailureEvent with stage "seed", since this branch replaced
  HandledEpisodeError with NgFailureEvent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
AdamRajfer added a commit that referenced this pull request Nov 3, 2026
AdamRajfer added a commit that referenced this pull request Nov 3, 2026
…er/run-records-on-store

Brings in #5072 at 4df4ac2, which merged main 101a442 (#5142 single-agent-turn
seed observations, #5336 extracted_code), and the recovery stack on top of it.

Signed-off-by: Adam Rajfer <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
public — 5713ae56 Deployed Nov 2, 2026 by copy-pr-bot[bot] via release / finalize / notify #9287
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:env-infra Shared environment framework, lifecycle, registry, scaffolding, and validation feature New capabilities, enhancements, or enablement work ready-to-merge PR is approved, current, and waiting for final CI or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants