Repository navigation
feat(spatialclaw): support interchangeable session harnesses - #5894
ehosseiniasl wants to merge 1 commit into
Conversation
yfw
left a comment
There was a problem hiding this comment.
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:
- 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 totest_agent_environment_session_templates.pyandtest_agent_environment_default_configs.py. So after the rebase, thespatialclaw_agententries go into those two lists, not intotest_add_legacy_agent_environment_servers.py. - #3996 must land first, or the two can land together as a stack.
- A maintainer needs to post the
/ok to testcommand 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
| model: ${policy_model_name} | ||
| resources_server: null | ||
| num_workers: 1 | ||
| opencode_version: 1.18.34 |
There was a problem hiding this comment.
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 secretThe 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.
There was a problem hiding this comment.
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
fc71bda to
4a37c4e
Compare
1f56012 to
d73e78b
Compare
Signed-off-by: Ehsan Hosseini Asl <[email protected]>
d73e78b to
d58c4cb
Compare
|
The SpatialClaw review fixes are rebased on public
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
left a comment
There was a problem hiding this comment.
HOLD. This head, d58c4cb, fixes all 12 comments from the last review. Two things remain before merge.
- The CI server test for
resources_servers/spatialclawfails, because this push deleted the example metrics and rollouts. The inline comment has the fix. - 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"}}}} | |||
There was a problem hiding this comment.
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.
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
mainand regenerate both managed component locks. Dataset preparation uses Gym's locked component setup.Validation
temperature,top_p, andmax_output_tokens.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.