Skip to content

fix(agent): retain graded root response IDs on SAT - #6957

Draft
init-nikhil wants to merge 1 commit into
mainfrom
init-nikhil/sat-terminal-response-ids-20261130
Draft

init-nikhil wants to merge 1 commit into
mainfrom
init-nikhil/sat-terminal-response-ids-20261130

Conversation

@init-nikhil

Copy link
Copy Markdown
Member

What does this PR do?

SAT results from OpenCode, Pi, Hermes and Codex can contain a harness wrapper ID and rendered output that differ from the original served reply. Preserve the original response ID for the specific root message that supplies the graded answer, and forward it as result.terminal_response_id.

Pi keeps the ID on its final rendered assistant message. Hermes carries the SDK ID through its existing normalization/build bridge, retaining only the current root message and rejecting answer mutations. OpenCode follows the actual export renderer; Codex joins its provider message ID after checking that the native root transcript agrees with the rendered CLI history. Both resolve through the existing authenticated token-capture manifest. Three small identity fields survive capture commits and shared-ledger reads in both ordinary and Forest modes; diagnostic body logging is not required.

Missing or ambiguous evidence leaves the declaration absent. A verifier replacing the response ID or output cannot inherit the original declaration. No separate issue is needed for this focused attribution fix.

Validation

  • 1,600 passed, 22 skipped in the focused pytest run (Python 3.13.14, OpenAI 2.45.0; an isolated SDK/import-path bootstrap was used locally):
pytest responses_api_agents/pi_agent/tests/test_sandbox.py \
  responses_api_agents/hermes_agent/tests/test_sandbox_observer.py \
  responses_api_agents/hermes_agent/tests/test_model_kwargs.py \
  responses_api_agents/codex_agent/tests/test_observability.py \
  responses_api_agents/codex_agent/tests/test_sandbox_sessions.py \
  responses_api_agents/opencode_agent/tests/test_sandbox_sessions.py \
  environment_servers/single_agent_turn/tests/test_app.py \
  tests/unit_tests/agents/utils/test_terminal_response.py \
  tests/unit_tests/models/test_external_capture_handlers.py \
  tests/unit_tests/models/test_token_capture.py \
  -q --tb=short -o log_cli=false --durations=5
  • Tests cover actual capture finalization → reopened shared ledger → authenticated manifest, both parent-resolution modes without observability, HTTP adapter responses, normalization into a distinct Hermes object, later children/retries, missing/duplicate/foreign IDs, edited answers, stale/truncated CLI histories and verifier replacement.
  • pre-commit run --all-files: passed, including package layering.
  • git diff --cached --check: passed; commit includes DCO sign-off.

Rollouts

Native model and verifier qualification is pending independently. This PR remains a draft; the local tests exercise the production adapter and capture paths with controlled services.

Compatibility and benchmark impact

No configuration change is required for existing token-capture training. Existing wrapper IDs and verifier-facing output stay intact. The optional field is omitted when unknown. The additional manifest fields require serving and consuming processes to use the matching Gym schema; older records without these labels use the existing fallback. Attribution may now identify the graded root reply despite later helper calls or output rendering. Legacy /run behavior is unchanged.

Checklist

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Documentation added or updated, or N/A with justification: optional attribution metadata is described above and in the public models/helpers; no user setup changes.
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format checks pass).
  • New source files include the required Apache-2.0 SPDX header.
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

Signed-off-by: Nikhil Deshmudre <nikhil.deshmudre@gmail.com>
@init-nikhil init-nikhil added bug Something isn't working area:agent Agent harnesses and Responses API agent behavior labels Nov 30, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 30, 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.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the risk:high Autobot PR risk: high label Nov 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior bug Something isn't working risk:high Autobot PR risk: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants