Skip to content

feat(spatialclaw): support interchangeable session harnesses - #5894

Open
ehosseiniasl wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
ehosseiniasl:feat/spatialclaw-multiharness
Open

ehosseiniasl wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
ehosseiniasl:feat/spatialclaw-multiharness

Conversation

@ehosseiniasl

@ehosseiniasl ehosseiniasl commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What changes

SpatialClaw can run through its reference harness or stock OpenCode 1.17.11. Both pairings use typed tasksets and share task preparation, media, Python state, answer submission, and scoring in one Resources Server. The OpenCode preset uses its own agent and Environment Server names so it can share a Gym deployment with other harnesses.

Review changes

  • Rebase the SpatialClaw commit on public main and regenerate both managed component locks. Dataset preparation uses Gym's locked component setup.
  • Enable OpenCode image input, use the stock installer, and restrict dispatch to the two supported harnesses.
  • Mask retryable kernel VLM transport failures, preserve unscored rows at step limits, and reject untyped seeds before allocating a runtime.
  • Convert the five examples to typed tasks, move the benchmark tests into the core suite, and register SpatialClaw for session-based config migration.

Validation

  • 129 focused tests passed with 8 skips. A separate run passed all six native tests with a pinned SpatialClaw checkout.
  • The session-agent registry, SpatialClaw migration, dependency policy, public API imports, and OpenCode image modality checks passed. Both locked environments installed and pre-commit passed. The broader migration suite exceeded the local time limit.
  • Prepared matching prompts, media, and answers for all 400 ERQA rows for both typed presets and the legacy relay in feat(spatialclaw): port original GitLab evaluation harness #3996. All three inputs carry the same temperature, top_p, and max_output_tokens.
  • Stock OpenCode 1.17.11 passed the version check. The pairing smoke stopped during Jupyter startup because the host denied ZeroMQ socket initialization. The requested real vision-model comparison across the three paths remains open.

The review calls for #3996 to land first and for a maintainer to authorize CI for the current head. Supply a licensed SpatialClaw checkout and its exact Git revision, and re-prepare existing flat datasets for the typed presets. The Local profile is for trusted evaluation. RL requires isolated Python execution without access to the label files or prepared answer rows, plus compatible per-call media replay.

@ehosseiniasl
ehosseiniasl requested a review from a team as a code owner November 9, 2026 22:46
@ehosseiniasl ehosseiniasl added feature New capabilities, enhancements, or enablement work area:agent Agent harnesses and Responses API agent behavior needs-review PR is ready for code review and waiting on a reviewer labels Nov 9, 2026
@copy-pr-bot

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

@yfw yfw 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.

HOLD. Gym cannot set up either SpatialClaw component (pyproject.toml L4), and after the rebase the OpenCode preset sends no images to the model (opencode.yaml L23).

The design follows the Harness-Ready Environments runbook well. One Resources-owned task runtime serves both harnesses. The native workflow stays as a baseline harness, and OpenCode runs through the stock opencode_agent. The PR uses the session hooks and LentSandboxes, and a test makes sure that all 20 benchmark pairs resolve the same Resources contract.

Process:

  1. Please rebase on main first. The branch conflicts with main in 26 files, mostly old copies of #5719 and #5833, which merged at later heads. While it conflicts, GitHub has no test merge commit, so CI cannot run unit or server tests. After the rebase, please regenerate both component locks (uv lock --project <component>), because both fail the lock test on main with this PR. Main moved that file's two agent lists to test_agent_environment_session_templates.py and test_agent_environment_default_configs.py. So after the rebase, the spatialclaw_agent entries go into those two lists, not into test_add_legacy_agent_environment_servers.py.
  2. #3996 must land first, or the two can land together as a stack.
  3. A maintainer needs to post the /ok to test command with the full SHA of the rebased head. DCO is fine.

Rollout evidence: the only run is one row with a scripted model. Please run one benchmark through both presets with a real vision model. Please use rows that carry NeMo RL's temperature, top_p and max_output_tokens. Please also post the native rows on #3996's relay path for comparison. For example, #3996 reported 1,811 of 2,700 on Video-MME.

CI never collects benchmarks/spatialclaw/tests, so the benchmark tests, including the 20-pair contract test, run only by hand.

Context, fine to lose: #6071 adds Video-MME, Video-MME-v2 and LVBench with the official protocol. The two PRs give Video-MME numbers that cannot be compared. Here the model gets sampled frames and gives a single-letter answer. In #6071 it gets native video and gives a boxed answer. So neither README can compare its score with the other, and neither PR names the other.

Generated by Claude Code

Comment thread resources_servers/spatialclaw/app.py Resolved
Comment thread resources_servers/spatialclaw/app.py Resolved
model: ${policy_model_name}
resources_server: null
num_workers: 1
opencode_version: 1.18.34

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.

benchmarks/spatialclaw/harnesses/opencode.yaml#L22

This preset needs the internal hand-built OpenCode 1.18.34 binary, but it uses no setting that stock OpenCode 1.17.11 lacks.

sandbox_executable_path reads SPATIALCLAW_OPENCODE_BIN with no default (L29-L30). Without that variable, the preset does not resolve: InterpolationResolutionError ... 'SPATIALCLAW_OPENCODE_BIN' not found.

Main already qualifies everything that this preset uses on stock 1.17.11. These features are remote MCP grants with headers and a timeout, compaction.auto, agent.build.steps, the permission map, request sampling, the step-limit note and MCP image content. 1.17.11 is the adapter's tested version (_TESTED_OUTCOME_VERSION). On main, every seed with 1.18.34 logs "OpenCode 1.18.34 is untested: error classification is validated on 1.17.11" (app.py L985-L990). That classification decides between a retry and a score on the training path.

The 1.18.34 pin also makes this PR add 1.18.34 to two shared tables. They are _OPENCODE_AGENTS in the OpenCode adapter (app.py L260-L265) and checked_versions for the step-limit note (harness_notes/opencode.py L39-L43).

Suggested fix: please pin stock 1.17.11 and drop the binary path, the SHA-256 and the fork note. This is a plain block, because the fix changes three places. The version line alone also fails, because the installer then refuses the fork binary, whose version is 1.18.34.

-# Runtime built from ehosseiniasl/opencode spatialclaw-integration at
-# a2acc05f2aab51e574c46fecbe09c4b7e97a6c8d. External source remains separately licensed.
@@
-      opencode_version: 1.18.34
+      opencode_version: 1.17.11
@@
-      sandbox_executable_path: ${oc.env:SPATIALCLAW_OPENCODE_BIN}
-      sandbox_executable_sha256: 9ca0b9953d49997601655e54f846a3efa464f237e47c6f1b04716d0f2e64c4c2  # pragma: allowlist secret

The benchmark README text about the fork binary changes with it (README L176, L191-L203, L256-L258). Then the two shared 1.18.34 entries, their tests and the sentence in the OpenCode adapter README (L158) can leave this PR. The opt-in pairing test pins the same version and hash (test_opencode_pairing.py L35-L36), so it moves to 1.17.11 too. The real-binary smoke ran on 1.18.34, so it needs one rerun. This holds unless the fork has a change that this preset needs.

NeMo RL-shaped rows on each OpenCode version

Rows carry temperature 1.0 and top_p 1.0, as NeMo RL sends them. The results are the same at this head and on main with this PR.

OpenCode version Row max_output_tokens Result
1.18.34 (this preset) none, 16384 or 65536 200
1.18.34 8192 422, as the README says (README L253-L255)
1.17.11 (stock) 16384 200, same agent configuration
1.17.11 (stock) 8192 422, same as 1.18.34
1.19.4 (stock) 16384 422 "applies request temperature and top_p only with OpenCode 1.17.11, 1.18.34"

Stock 1.17.11 installs through Gym's installer (install_opencode_runtime.sh L145). It is main's default (runtime.py L14), and 13 other configurations on main with this PR pin it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The preset now pins stock OpenCode 1.17.11 and uses Gym's installer. The fork binary path and digest are gone. The stock binary reports 1.17.11, and the adapter and preset checks passed.

The live pairing retry stopped during Jupyter startup because ZeroMQ socket setup was denied. Both TCP and a separate IPC kernel startup check hit the runtime restriction. The pairing still needs a successful run on a worker with a working Jupyter kernel. Pushed revision

Comment thread resources_servers/spatialclaw/app.py Resolved
Comment thread resources_servers/spatialclaw/app.py Resolved
Comment thread benchmarks/spatialclaw/example.yaml Resolved
@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Nov 16, 2026
chtruong814
chtruong814 previously approved these changes Nov 16, 2026
@ehosseiniasl
ehosseiniasl force-pushed the feat/spatialclaw-multiharness branch from d73e78b to d58c4cb Compare November 25, 2026 04:06
@ehosseiniasl

Copy link
Copy Markdown
Contributor Author

The SpatialClaw review fixes are rebased on public main and pushed as d58c4cb198d6d6bffc5a9cb1b45a680f346b96c6.

  • Both component locks use Gym's managed setup, and benchmark preparation uses the same locked Resources environment.
  • The OpenCode preset uses stock 1.17.11 with image input enabled. It shares the Resources Server with the native harness. The Resources Server permits both supported agents.
  • Typed seeds are validated before runtime allocation. The five example rows have stable task IDs, and the seed reply avoids adding an extra user message.
  • Retryable kernel VLM transport failures mask the row. Aggregate-only rows stay unscored at the step limit.
  • The benchmark tests now run under the core suite. The component tests use the public API imports, and both migration test lists and the session-agent registry include SpatialClaw.

The rebased head passed 129 focused tests and six pinned native tests. The migration, public API, changed-core checks, and pre-commit also passed.

I prepared the same 400 ERQA tasks for the native preset, OpenCode preset, and #3996 relay, with matching prompts, media, answers, and sampling settings. The live pairing stopped during Jupyter startup because the runtime denied ZeroMQ socket setup. The real vision-model scores are still pending. OpenCode smoke follow-up

The review's merge order remains #3996 followed by this PR. The current SHA is ready for the maintainer CI gate. Review

@yfw yfw 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.

HOLD. This head, d58c4cb, fixes all 12 comments from the last review. Two things remain before merge.

  1. The CI server test for resources_servers/spatialclaw fails, because this push deleted the example metrics and rollouts. The inline comment has the fix.
  2. The real run is still missing. Please run one benchmark through both presets with a vision model, as the last review asked. That run can also supply the five example rollouts.

This head adds all of #3996's files itself. #3996 is unchanged since November 15 and still has the problems that its review found. Please say which PR lands first. If #3996 lands first, it needs the same fixes.

Only the lint, lock, copyright, secrets and DCO jobs ran on this head. The unit and server tests start after a maintainer posts /ok to test with the full SHA.

Generated by Claude Code

@@ -0,0 +1,5 @@
{"task_id": {"taskset": "spatialclaw:videomme_spatialclaw", "task_id": "001-1"}, "task_input": {"responses_create_params": {"input": [{"role": "user", "content": [{"type": "input_text", "text": "When demonstrating the Germany modern Christmas tree is initially decorated with apples, candles and berries, which kind of the decoration has the largest number?\n\nAnswer with a single letter (A, B, C, or D) corresponding to the correct choice.\nA. Apples.\nB. Candles.\nC. Berries.\nD. The three kinds are of the same number."}]}]}, "task_data": {"sample_id": "001-1", "answer": "C", "question_type": "Counting Problem", "benchmark_name": "videomme", "dataset_config": "videomme_spatialclaw", "media": {"video_path": "Video-MME/data/fFjv93ACGo8.mp4"}}}}

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.

resources_servers/spatialclaw/data/example.jsonl#L1

The CI server test for this resources server fails, because this push deleted data/example_metrics.json and data/example_rollouts.jsonl.

The five rows in this file now have the task_id and task_input shape, as the earlier comment asked. After the unit tests, gym env test runs a data step for each resources server. That step needs data/example_metrics.json with 5 examples (env.py L306-L333). It also needs data/example_rollouts.jsonl with 5 rows (L340-L362). CI runs this step for every changed server (unit-tests.yml L287).

On this head, gym env test +entrypoint=resources_servers/spatialclaw +should_validate_data=true passed 44 tests and then exited 1. It printed "Data validation failed for resources_servers/spatialclaw". The previous head had both files (example_metrics.json, example_rollouts.jsonl).

Suggested fix: please add both files again for these rows. This is a plain block, because the fix adds two new files.

The metrics file needs no model. On this head, this command wrote data/example_metrics.json with 5 examples. It reads the example dataset in example.yaml L8-L12. It needs SPATIALCLAW_DATA_ROOT set, but this step reads no media.

gym dataset collate "+config_paths=[benchmarks/spatialclaw/example.yaml]" \
    +output_dirpath=data/spatialclaw +mode=example_validation +policy_model_name=<model>

The rollouts file needs the rollouts of these five rows from a real run with a vision model. The real run that the review body asks for can supply them.

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 feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer risk:high Autobot PR risk: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants