Skip to content

fix(opencode): preserve session migration compatibility - #5401

Draft
yaoyu-33 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
yaoyu-33:codex/opencode-session-compat-20261030
Draft

yaoyu-33 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
yaoyu-33:codex/opencode-session-compat-20261030

Conversation

@yaoyu-33

@yaoyu-33 yaoyu-33 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

OpenCode agent sessions now retain the harness trajectory after a single activation and return it when the session closes. This preserves decision boundaries and reasoning/tool output for downstream trajectory consumers.

The adapter also accepts existing mounted-installer settings: an installer script with its cached binary, plus an optional musl binary. Setup forwards the installer's existing argument contract, checks the resulting OpenCode version, and publishes the executable atomically. Invalid combinations fail before sandbox connection. An optional positive opencode_model_call_timeout configures the provider request timeout in milliseconds; its default remains disabled.

This is a focused compatibility follow-up to #4747; a separate issue is unnecessary. The no-activation close receipt and omission of cleanup_confirmed for single-shot sessions remain compatible with that PR.

Validation

Reviewed final commit ca78f1536f0f7bd774a1cbd703cfc475a8f16545. Python 3.13.14, Linux. The test launcher selected this checkout and asserted core/OpenCode import paths before calling pytest.main with these exact arguments:

pytest.main([
    "responses_api_agents/opencode_agent/tests",
    "-q", "-o", "addopts=", "-o", "log_cli=false",
])
# 548 passed, 14 skipped

pytest.main([
    "tests/unit_tests/test_agent_sessions.py",
    "tests/unit_tests/test_agent_session_retries.py",
    "tests/unit_tests/test_agent_activations.py",
    "tests/unit_tests/test_sandbox_session.py",
    "tests/unit_tests/test_trajectory_builder.py",
    "-q", "-o", "addopts=", "-o", "log_cli=false",
])
# 160 passed

pre-commit run --all-files and git diff --check passed. Both new default-timeout single-shot trajectory cases fail on pristine base 0d0f6c0534fea26e4f73bd5fef9209c220727368 because the close response omits trajectory.

This is a server-only diff. Full core/sandbox coverage and the isolated changed-server CI command are still CI gates; the targeted runs above do not claim those results.

Rollouts

Rollout evidence is not included in this public PR. Keep this PR in draft pending full CI and maintainer review.

Compatibility and benchmark impact

Settings are optional, with existing defaults preserved. No scoring or verifier code changes. Trajectory-derived statistics can change because single-shot decisions now retain the harness's boundaries. Benchmark score parity is not established by the unit tests.

Checklist

  • Contributing guidelines read.
  • Focused change; final source diff reviewed.
  • Tests updated and local runs pass.
  • Documentation assessed: config comments describe timeout units and the mounted installer contract; no standalone guide changed.
  • pre-commit run --all-files passes.
  • SPDX headers retained; no new source files.
  • DCO sign-off present.

@copy-pr-bot

copy-pr-bot Bot commented Oct 31, 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 bug Something isn't working area:agent Agent harnesses and Responses API agent behavior labels Nov 1, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants