Repository navigation
Conversation
OpenCode 1 now declares supports_task_skills. At seed, in a task sandbox the Environment Server lent, it copies the task's skills_dir into <XDG_CONFIG_HOME>/opencode/skills, a skills folder OpenCode scans, and that session's runs allow the skill tool with a last `skill: allow` rule. The default permission profile keeps denying the tool for every other task. OpenCode 2 discovers skills elsewhere and declares nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
Hermes now declares supports_task_skills. At seed, in a task sandbox the Environment Server lent, it copies the task's skills_dir into <HERMES_HOME>/skills, and that session's activation turns on Hermes' skills toolset (a Harbor run keeps only `terminal`), so Hermes lists the skills in its system prompt and the model loads one with skill_view. Every other task keeps the configured toolsets. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
Pi now declares supports_task_skills when its tools are on. At seed, in a task sandbox the Environment Server lent, it copies the task's skills_dir into <PI_CODING_AGENT_DIR>/skills and passes that folder with --skill; discovery stays off (--no-skills), so Pi lists only the task's skills in its system prompt and the model reads one with its read tool. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
…k skills Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
…mcp_grants row The Harbor pairing page's `task_mcp_grants` row still said a skills_dir task needs `supports_task_tool_context` or `supports_task_skills` "as Claude Code and Codex do". OpenCode 1, Hermes and Pi now declare `supports_task_skills` too, so the row names all five, as the Harbor server README already does. The comments that state the same admission rule (the per-step task.json rewrite in the Harbor server, two Harbor test docstrings) now speak of a harness that declares `supports_task_skills` instead of naming two harnesses, and the task_skills module docstring lists each harness's configuration folder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolves hermes_agent/app.py: keeps this branch's _SKILLS_TOOLSET and main's _OUTPUT_LIMIT_ERRORS (#6204), which are independent. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
/ok to test ce15858 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
RISK: Include Claude Code and Codex task-skills smoke evidence
The supplied real-model rollouts cover OpenCode, Hermes and Pi, but not Claude Code or Codex. This changeset also adds their task-skills admission paths: Claude Code stages skills and disables --bare, and Codex stages skills into its private home. Their new adapter tests use mocked sandbox copying and CLI execution, so they do not show either runtime advertising and loading the staged skill. This is a validation gap, not a confirmed runtime defect. The review rubric and repository quality bar require representative real-model rollouts for behavior-changing agent work.
Could you link matching evidence from the stacked task-skills PR, or supply one representative skills rollout for each harness? A minimal acceptance setup is a Harbor task declaring skills_dir = "/skills", a demo/SKILL.md containing a distinctive answer, and a verifier that checks that answer. Record the runtime version and revision, inspect captured model calls for native skill discovery and loading, and report the verifier result. Both runs should load demo and receive reward 1.0; successful copying alone does not validate this contract.
Keep the neighboring cases intact: without skills_dir, neither adapter should stage task skills, and Claude Code with bare: true should keep --bare. A declared empty skills folder must still count as declared, so Claude Code should drop --bare for that case. Retain those assertions in the Claude Code tests, the Codex no-skills and owned-sandbox tests, and the shared empty-folder test. These are proposed acceptance checks; I did not execute them. No implementation change is indicated unless the rollouts expose a failure.
I completed the broad static review of all changed files and their directly affected paths. I found no confirmed code defects. I could not run tests or independently verify the reported rollout results in this read-only environment.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
|
Thanks. The Claude Code and Codex task-skills code in this diff is #6293's (this PR is stacked on it and does not change it), and #6293 has the real-model evidence you asked for: on the same demo task, Claude Code 2.1.292 called |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
I completed the broad static review of all 40 changed files and their directly affected paths. No qualifying issues found.
I checked skills admission separately from MCP grants, traced staging into each harness's runtime configuration, and checked failed-seed cleanup. The per-step context rewrite runs after setup and before the next fresh session seeds. The changes keep the no-skills controls and declared-empty-folder behavior.
The updated description supplies the previously requested Claude Code and Codex smoke evidence from #6293, including native skill loading, rewards, no-skills controls and the two-step case. That addresses the prior validation request.
I did not execute tests or independently verify rollout artifacts. The reported validation was not rerun at the latest commit.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
…ode, Hermes and Pi task-skills branch The base branch now includes origin/main (51630ce), so this brings main in: its Hermes v0.23.2 update, OpenCode checkpoint pauses and crash resume, and Pi's activation refactor. Conflicts and how they were resolved: - hermes_agent/app.py: main moved payload building into _worker_payload(), which has no session state, so it takes a task_skills keyword that the sandbox episode passes from state.task_skills; this branch's skills-toolset block runs there. The _SKILLS_TOOLSET constant sits before main's reworded comment. - hermes_agent/sandbox.py: main's runtime imports plus this branch's HERMES_HOME_FOLDER import. - hermes_agent/tests: main's runtime asserts and glibc tests, and this branch's seed cwd list (["/", "/"]) and task-skills tests. - opencode_agent/app.py: main moved runtime and plugin setup into _install_session_files(); this branch's stale copy of the old inline code is dropped and its task-skills staging follows that call. - opencode_agent README and tests: both sides kept, main's first. - pi_agent/app.py: main's _sandbox_payload() now builds the argv; the --skill folder goes in right after --no-skills there. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
… host interpreter Main's Hermes v0.23.2 update runs Hermes from its own host environment (runtime.host_python()), not the Agent Server's venv, so the task-skills test can no longer import Hermes with sys.executable. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ake a task's skills_dir The Harbor task-folder paragraph of integrate-existing-agents.mdx still named only Claude Code and Codex. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
… restore export_agent_sessions did not save task_skills and restore_agent_sessions did not set it, so a session restored from a checkpoint had no task skills: its next launch left the skill tool to the profile's rule, which denies it, and the task's skills could not be used for the rest of the episode. The checkpoint now carries task_skills (an older checkpoint without it restores none, as before). When the re-bind finds the fork without the session's files and installs them again, it copies the task's skills into OpenCode's skills folder again as well. Hermes and Pi join checkpoints as restart-only, so their episodes seed again after a crash and stage the skills then; they have no restore path. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eckpointed folder When a re-bind finds the fork without the session's files, it copied the task's skills again by reading /tmp/.nemo-gym/task.json. That file is under /tmp like the session's files, so a fork that lost them has usually lost it too: stage_task_skills then returned None, the re-bind stored None in task_skills, and the next launch denied the skill tool again. stage_task_skills takes a keyword skills_dir that names the folder to copy and skips the task.json read. The re-bind passes the folder the checkpoint saved and no longer overwrites task_skills. The re-bind test now runs with task.json kept and lost, and asserts the copy runs from the checkpointed folder without reading task.json; two root tests cover the keyword. Reach: only the harbor Environment Server writes task.json today, and it runs restart_only (the default checkpoint_mode), so a Harbor episode is seeded again after a restore and never takes this re-bind path. This fix and the restore fix before it close the gap for an Environment Server that checkpoints in exported mode; neither was hit in a real Harbor run. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…penCode, Hermes and Pi task-skills branch The Claude Code and Codex task-skills branch now includes origin/main (15adc22), so this brings that main as well. No conflicts. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Updated with
Conflicts in
Test fix ( Bug fix ( Reach: the Tests that fail without the fix: before The merge resolutions are the ones the combined end-to-end branch used (all nine SkillEvaluator-related PRs on Tests on the new head (
|
|
/ok to test e0755fc |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
I found one RISK: staging preserves relative symlinks while moving the skills tree, so a readable skill can become unreadable even though seeding succeeds. See the inline finding.
I reviewed all 41 changed files and their affected consumers, including Harbor admission, failed-seed cleanup, runtime configuration and OpenCode checkpoint restoration. I compared against the reachable previous-review commit. That review had no outstanding findings; the description still supplies the requested real-model smoke evidence, which I did not independently reproduce.
CI: On e0755fc23ea5ebe63c38a49352433945d8543abf, I relied on the successful Unit tests / Test, Unit tests / Server suite and Lint check checks. The overall workflow is red because non-blocking conformance and compliance diagnostics failed. The conformance summary has matching failures on the admitted base; the compliance findings concern unchanged run() methods. Skipped jobs were not counted as passes.
Probes: I used Python 3.13.14 in 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:main-offline, with imports bound to the admitted checkout:
staging_edges.pypassed executable-helper, quoted-path, dotfile, missing-context, explicit-restore-path and failed-destination checks.delegated-hermes-pi.py,opencode-skills-roundtrip.pyandclaude-codex-skills-seed.pypassed their focused checks of session isolation, tool settings, checkpoint round-tripping, skill bytes and cleanup. Provider connections and runtime installation were mocked.staging_symlink_admitted.pyreproduced the inline defect: task loading accepted the input, the sourceSKILL.mdwas readable, staging succeeded, and the destinationSKILL.mdwas unreadable. A dereferenced copy preserved its contents.
I did not rerun repository suites already covered by CI or execute the external agent CLIs locally.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| source, target = shlex.quote(declared), shlex.quote(destination) | ||
| copied = await sandbox.exec( | ||
| f"[ -d {source} ] || {{ echo 'not a folder in the sandbox' >&2; exit 2; }}; " | ||
| f"mkdir -p -- {target} && cp -R -- {source}/. {target}/", |
There was a problem hiding this comment.
RISK — Preserve readable skill targets when relocating symlinks
cp -R preserves relative symlink text, but this helper moves the tree. For example, an image can provide /app/skills/demo/SKILL.md -> ../../shared.md with readable /app/shared.md. Harbor explicitly keeps image-provided skills (upload contract). After this copy, the link resolves relative to the session's configuration directory instead of /app, so the staged skill is unreadable while stage_task_skills returns success. This affects all five adapters using the helper, including OpenCode restaging after restore.
I reproduced this with PYTHONDONTWRITEBYTECODE=1 python /workspace/review-probes/staging_symlink_admitted.py: source readable True, staging success, destination readable False.
Could you materialize readable symlink targets during relocation, for example with cp -RL, rather than copying links whose meaning changes? Preserve quoting, executable modes, dotfiles and declared-empty-folder behavior. Add regression checks for a linked SKILL.md and a linked helper whose targets sit outside skills_dir: their staged contents should match the readable source, and dangling or unreadable targets should fail seeding rather than silently leave broken skills.
There was a problem hiding this comment.
Fixed in 9a33cec1f9 on the Claude Code/Codex task-skills PR (#6293), merged here in 3d3c4162ef. The copy uses cp -RL, so a link is staged as its target's contents, and a dangling or unreadable link fails the copy and refuses the seed. Tests: test_symlinks_to_files_outside_the_folder_are_staged_as_their_readable_contents, test_a_symlink_whose_target_is_missing_is_refused_instead_of_staged_broken and test_a_symlink_whose_target_cannot_be_read_is_refused in tests/unit_tests/agents/test_task_skills.py.
…encode-hermes-pi Brings in 9a33cec (fix(agents): follow symlinks when staging a task's skills) from the Claude Code/Codex task-skills branch. task_skills.py keeps this branch's refactor (skills_dir keyword, _declared_skills_dir) with the copy switched to cp -RL; the OpenCode, Hermes and Pi tests match the new command. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
Addressed the RISK in New tests in |
…0698) into adasif/gym-1268-task-skills-opencode-hermes-pi Conflicts with main, each resolved keeping both sides: - opencode_agent/app.py: this branch's stage_task_skills import next to main's stop_and_confirm_cleanup import. The rest merged on its own: the checkpoint keeps this branch's task_skills and task_skills_pending next to main's keeps_processes, relay_gen and adoption fields, and a re-bind that installs the session files again still stages the skills again before main's restored-launch check. - opencode_agent/tests/test_checkpoint.py: both new re-bind tests, this branch's skills re-staging test and main's test of a restored-launch check that did not finish. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
Updated with Conflicts, both from
The trial merge of Tests on the head (
|
|
/ok to test 4f6f23a |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM. No concerns found. I reviewed all 29 changed files, affected callers and consumers, tests, documentation and prior feedback, with separate OpenCode, Hermes and Pi reviews.
The earlier symlink and OpenCode retry issues stay fixed. Focused probes confirmed that linked skill files remain readable after copying, failed restoration stays pending across retries and JSON checkpoint round-trips, and successful restoration avoids unnecessary copying. Permission and toolset changes stay scoped to the task session.
CI: I relied on successful head-associated Lint check, Unit tests / Test, Unit tests / Server suite, combined core coverage, all four core shards, all eight server shards, sandbox tests and LongMT scoring tests. Inspected job logs checked out merge commit 5d9abf82429a6bc1a9012f9a14410a10a7b2bbb5, which includes this head, rather than the standalone head. Changed-server and session-routing checks were skipped, not passed. Non-blocking conformance is red; its reported failures match the comparison run tested at 1dbc5847ca44b55897060fc6529b850651fd01ff. Compliance flags pre-existing Hermes and Pi run() methods.
Local execution: Using Python 3.13.14 in 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:main-offline, with imports verified against the admitted checkout, all focused probes passed: shared staging, quoting and symlink handling; OpenCode fresh-seed and checkpoint/retry recovery; Hermes staging, cleanup, toolset isolation and runner forwarding; Pi capability, argument consistency, isolation and failed-seed cleanup. Initial dependency-import failures were resolved using packages already in the image.
Provider connections and runtime installation were mocked. Filesystem-copy probes executed real shell commands. I did not rerun CI-covered suites, execute external agent CLIs, reproduce model rollouts or restore a real remote checkpoint. The PR supplies representative model-rollout evidence from earlier revisions and states its validation limits.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
…ls branch Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
Merged the capabilities-reply fix from the Claude Code/Codex task-skills PR (#6293) below it: |
|
/ok to test 7a50d6d |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM. No concerns found. I reviewed all 29 changed files, affected callers, tests and documentation, with separate OpenCode, Hermes and Pi reviews.
The earlier symlink and OpenCode retry fixes stay intact. Probes confirmed readable symlink targets after copying, pending restoration across failed retries and JSON checkpoint round-trips, and no unnecessary copying after successful recovery. Skill permissions, toolsets and private directories stay scoped to each session. Invalid declarations refuse seeding, while provider timeouts stay retryable.
CI: I relied on successful head-associated Lint check, Unit tests / Test, Unit tests / Server suite, all four core shards, all eight server shards, combined coverage, sandbox tests and LongMT scoring. Inspected job logs tested merge commit a35b1cab30faafa0293e4033ee1167d7bfdadb61, which includes this head, rather than the standalone head. Changed-server and session-routing checks were skipped, not passed. Non-blocking compliance and conformance are red: compliance flags pre-existing Hermes/Pi run() methods; OpenCode/Pi conformance diagnostics also occur on main, and the other reported failures or unavailable harnesses also appear in the previous review's run.
Local execution: Focused staging, capability-serialization, checkpoint-retry, payload, isolation and cleanup probes passed in Python 3.13.14 using 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:e27be8e644b414501fe6eb9b905386a07685a2f6, a successful default-branch CI image. Imports were verified against the admitted checkout. Copy and cleanup probes executed real shell commands; provider connections and runtime setup were mocked. I did not rerun CI-covered suites.
I did not execute external agent CLIs, model rollouts or a real remote checkpoint restore. The image lacked the external runtimes, so runtime discovery was not independently validated locally. The PR supplies representative rollout evidence from earlier revisions and states its validation limits.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
…kills branch Brings in 0f55ba1: stage_task_skills makes its copy readable and writable by its owner after the copy, and after a copy that failed part way, so a session whose task ships its skills read-only to a non-root agent user can still be closed. task_skills.py keeps this branch's skills_dir keyword and _declared_skills_dir, with the same copy command as the merged branch. The OpenCode, Hermes and Pi tests that matched the end of the copy command now match its destination before the permission fix-up that follows. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
A re-bound OpenCode session copies its task's skills again over what the fork kept, which can be the copy its seed made. Before the copy was made owner-writable, a second copy of skills shipped read-only failed with "Permission denied", so the re-bind kept failing. The test stages the same read-only folder twice through skills_dir, then closes the session. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
A run as root reads and writes files whatever their modes, so the copy succeeding does not show the second copy left its session owner access. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
I merged the read-only skills fix from the Claude Code/Codex task-skills PR (#6293, Conflict in Copy-command matchers. These tests checked that the copy command ends with the destination:
They now check for the destination followed by OpenCode's re-stage after a restore calls the same The limit from the other PR applies here as well. Suppose a copy times out and the provider kills it before the chmod Tests (no
|
|
/ok to test f8d4274 |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
One RISK: an interrupted read-only skills copy can turn OpenCode checkpoint recovery into a terminal seed refusal. No BLOCKERs found.
I reviewed all 29 changed files, affected callers, tests and documentation, with separate OpenCode, Hermes and Pi reviews. I also compared against the previous review at 7a50d6d50ca7507a9b1c976c6321a84ed0ba717d, which reported no findings.
CI: I relied on successful Lint check, Unit tests / Test, Unit tests / Server suite, all four core shards, all eight server shards, combined coverage, sandbox tests and LongMT scoring in run 46087474150. Inspected logs tested merge commit 364f399cdb29067689b4c64f5bce4cf2d6034228, which includes the admitted head, rather than the standalone head. Changed-server and session-routing checks were skipped, not passed. Non-blocking compliance and conformance checks are red: compliance flags existing run() methods, and the conformance diagnostics also appear on main at ba3eeeb0a60df9a7cd3bb9d2c1f36cabb0a493b5.
Local execution: Probes ran with Python 3.13.14 in 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:e27be8e644b414501fe6eb9b905386a07685a2f6, a verified successful default-branch CI image; no head CI container was found. Shared staging, symlink, shell-quoting, capability, session-isolation, payload and cleanup probes passed. Ordinary checkpoint retries passed, but the non-root interrupted-copy probe reproduced the RISK below. I independently reproduced it and verified that a scratch-only pre-copy permission repair lets the first retry succeed. Imports resolved to the admitted checkout.
Provider connections and external agent runtimes were mocked where needed; copying, chmod, local provider timeout and cleanup used real shell execution. I did not rerun CI-covered suites, execute external agent CLIs, run model rollouts or perform a remote checkpoint restore. The PR supplies representative rollout evidence from earlier revisions and records its limits.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| # Copied again from the folder the checkpoint names. task.json is under /tmp too, so the fork has | ||
| # usually lost it, and reading it would leave the session without its skills. A copy that timed out | ||
| # may have copied only some of them, so only one that succeeds settles what is owed. | ||
| await stage_task_skills(sandbox, f"{root}/config/opencode/skills", skills_dir=state.task_skills) |
There was a problem hiding this comment.
RISK: Repair leftover permissions before retrying the skills copy
This retry can reject a valid restored session with HTTP 422. If a timeout or cancellation kills an earlier copy after it creates a read-only skill but before the helper's trailing chmod, task_skills_pending stays true and this call copies into the same destination. Under a non-root user, cp cannot overwrite those leftovers. The helper then raises terminal AgentSeedRejectedError rather than recovering from the transient failure.
I reproduced this using the real local provider at UID 65532: a forced timeout before chmod left the copied directory/file at 0550/0440; the first retry returned cp: cannot create regular file .../demo/SKILL.md: Permission denied and HTTP 422. The integrated seed probe failed at this line too. This affects non-root OpenCode 1 exported-session recovery; the PR notes that current Harbor episodes restart on restore.
Could you make an existing session-owned destination owner-accessible before recopying, while keeping the post-copy repair in stage_task_skills? A scratch-only pre-copy repair made the first retry succeed. Keep the source unchanged, preserve executable scripts, and clear pending only after a successful copy.
Acceptance: as a non-root user, interrupt staging of 0555 directories and 0444 files before chmod, then retry the same restored seed, including after a JSON checkpoint round-trip. The first retry should succeed without 422, leave readable skills and removable session files, and preserve source modes. The existing read-only repeat test starts from a successful copy whose chmod already ran, so it misses this case.
There was a problem hiding this comment.
Confirmed and fixed. The repair is in the shared helper on the Claude Code/Codex task-skills PR (#6293): c76735324d, with a test follow-up in 45c7a5d2ba. This branch takes both through the merges b07dad6534 and 0aee3074aa, the new head.
Change (nemo_gym/agents/utils/task_skills.py). The copy now makes an existing destination owner-accessible before cp runs, and still repairs the copy after it:
mkdir -p -- DEST && { chmod -R u+rwX -- DEST 2>/dev/null; cp -RL -- SRC/. DEST/; }; copy_status=$?; chmod -R u+rwX -- DEST 2>/dev/null; exit $copy_statuscopy_statusis stillcp's status, ormkdir's if that fails. The chmods' own errors are dropped, so a refusal still reports the copy's message.- Both chmods change only the destination. The source keeps its modes, and
Xkeeps scripts executable without making other files executable. - OpenCode's re-stage already clears
task_skills_pendingonly afterstage_task_skillsreturns, so a failed or interrupted copy keeps it set, through a checkpoint as well.
Tests
test_a_retry_copies_over_read_only_skills_an_interrupted_copy_left(core, real local shell): it puts the task's read-only skills (0555 folders, 0444SKILL.md, 0555 script) in the destination with their modes, as a copy stopped before its chmod leaves them, withSKILL.mdcut short. It then stages again. The copy succeeds,SKILL.mdmatches the task's again, every entry is owner-accessible, the script stays executable,SKILL.mddoes not become executable, the source modes do not change, and the close removes the session. Without the pre-copy chmod, it fails with the error from your report:cp: cannot create regular file .../demo/SKILL.md: Permission deniedand a 422. It is meaningful when run as non-root, as here; a root run writes over read-only files anyway.- OpenCode's
test_a_seed_retried_after_its_re_bind_failed_to_copy_the_task_skills_copies_them_againrestores from a JSON checkpoint, fails the re-stage twice with a timeout, and then succeeds. It keepstask_skills_pendinguntil then, and now also checks that every copy repairs the destination beforecp. - The copy-command matchers in the Claude Code, Codex, OpenCode, Hermes and Pi tests now check the
mkdirand thecpseparately.
Results (-n 2, non-root):
tests/unit_tests/agents/test_task_skills.py: 29 passed.- OpenCode
-k skill(test_checkpoint.py,test_sandbox_sessions.py): 16 passed. - Hermes
-k skill: 11 passed. Pi-k skill: 6 passed. - On the Claude Code/Codex branch: Claude Code
test_sandbox.py72 passed, Codextest_sandbox_sessions.py368 passed. pre-commit runpasses on the changed files.
…lls branch The skills copy now makes an existing destination owner-writable before copying, so OpenCode's re-stage after a copy that timed out can copy over read-only skills that copy left. Resolves task_skills.py by keeping this branch's skills_dir keyword and taking the new copy command. The OpenCode, Hermes and Pi copy-command matchers now check the mkdir and the cp separately, and OpenCode's retried re-stage checks that each copy repairs the destination first. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
…k-skills branch Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
/ok to test 0aee307 |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
One RISK: interrupted read-only skills staging can leave a borrowed Hermes session unable to finish cleanup. No BLOCKERs found.
I reviewed all 29 changed files, affected callers, tests and documentation, with separate OpenCode, Hermes and Pi/Harbor reviews. The previous OpenCode retry finding is fixed: a real non-root copy timeout reproduced the old 422 at f8d4274, while this head accepted the first retry. Integrated probes also passed across JSON checkpoints. The cleanup finding below concerns a different path, which closes without recopying.
CI: I relied on successful Lint check, Unit tests / Test, Unit tests / Server suite, all four core shards, all eight server shards, combined coverage, sandbox tests and LongMT scoring in run 46091743459. Inspected logs tested merge commit ceb518c99d5265c099fcc38c2148fbafca34f4de, which includes the admitted head. Changed-server and session-routing checks were skipped, not passed. Non-blocking compliance and conformance checks are red; compliance flags existing run() methods, and the failing mini-SWE conformance job reported no usable scenario results. I have not attributed every non-blocking failure.
Local execution: Probes used Python 3.13.14 in 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:main-offline, derived from default-branch commit e27be8e; no successful head container build was found. Imports were verified against the admitted trees. Shared staging, symlink handling, shell quoting, OpenCode recovery, session isolation, Hermes toolsets, Pi arguments and Harbor admission probes passed. An actual local-provider timeout and a separate Hermes seed/close probe reproduced the cleanup RISK below.
Provider connections and external runtimes were mocked where needed; filesystem copying, permission changes and removal used real shell commands. I did not rerun CI-covered suites, execute external agent CLIs, reproduce model rollouts or perform a remote checkpoint restore. The PR supplies historical rollout evidence and records its limits.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| await state.install_runtime(install_timeout=self.config.sandbox_install_timeout_seconds) | ||
| if not owns_sandbox: | ||
| # A task sandbox seeded by an Environment Server names the task's skills in task.json. | ||
| state.task_skills = await stage_task_skills(sandbox, f"{state.hermes_home}/skills") |
There was a problem hiding this comment.
RISK: Make interrupted skills staging cleanable without recopying
The new borrowed-sandbox staging can leave failed Hermes setup unable to release its session. If a timeout or cancellation stops the copy after creating read-only skill directories but before its trailing chmod, the exception path calls state.close(). Common removal renames the session to .closed, then plain rm -rf fails inside those directories as a non-root user. That raises before disconnect, and subsequent closes encounter the same leftovers. The pre-copy permission repair fixes recopy retries, but this path never recopies.
I reproduced this through actual Hermes seed/close with real shell copying: two closes returned Could not remove Hermes session files, with DISCONNECTS 0 and a leftover directory at 0550. Independently, python /workspace/review-probes/leader-head/interrupted_close.py reproduced the failure using a real LocalProvider timeout at UID 65532. Repairing only the scratch copy made the next close succeed. This retains private files and a failed session/client; it does not demonstrate that Harbor's independent sandbox teardown fails.
Could cleanup make its session-owned staged files removable independently of the interrupted copy shell, including the retired .closed path on retries? Keep the task source unchanged, preserve the original staging error and atomic retirement fence, and disconnect rather than stop the borrowed sandbox.
Acceptance: as non-root, interrupt staging of 0555 directories containing 0444 files before the final permission repair. Exercise seed-failure cleanup and repeated close. Verify private files are removed, disconnect succeeds, source modes stay unchanged and no closing failed-seed record is left behind.
There was a problem hiding this comment.
Confirmed and fixed. The fix is in the shared close on the Claude Code/Codex task-skills PR (#6293): 62b22fc43a, with a symlink guard in 8d55720755. This branch takes both through the merges 39012d8588 and 7675a7d1b0, the new head.
Change (remove_session_directory in nemo_gym/agents/utils/supervisor_client.py). The close still retires the session folder with mv before removing it, so the fence is unchanged. If rm -rf on the retired folder fails, the close now makes that folder owner-writable and removes it once more:
if [ -d DIR ]; then mv DIR DIR.closed || exit 1; fi; rm -rf -- DIR.closed 2>/dev/null || { [ -L DIR.closed ] || chmod -R u+rwX -- DIR.closed 2>/dev/null; rm -rf -- DIR.closed; }- This runs on every close, so it also clears a
.closedfolder that an earlier close failed to remove. Hermes' seed failure path callsstate.close(), which calls this throughSandboxSession.close(). That removes the session's files and then disconnects from the borrowed sandbox without stopping it. - The chmod runs only when the first removal fails, so a normal close does no extra work. It changes only the retired folder, never the task's skills folder. If the retired path is a symlink that could not be unlinked, the chmod is skipped, because GNU
chmod -Rfollows a symlink named on its command line. If the second removal fails too, the command still exits non-zero, so the close raises and keeps the retired folder for a retry, as before. - The seed's own error is unchanged: when the close succeeds, the original staging error is raised.
Tests (real local shell, run as non-root):
test_removal_makes_folders_its_owner_cannot_write_removable[seed](tests/unit_tests/agents/test_sandbox_supervisor_client.py): a session folder holding a 0555 skill folder with a 0444SKILL.mdand a 0555 subfolder is removed.test_removal_makes_folders_its_owner_cannot_write_removable[earlier close]: the same files already under.closed, as a failed close leaves them, are removed by the next close.test_a_session_whose_skills_copy_was_stopped_before_its_repair_still_closes(tests/unit_tests/agents/test_task_skills.py): the task's read-only skills sit in the session with their modes, as a copy stopped before its chmod leaves them. A borrowed, seeded session closes with no copy in between. The session folder and.closedare gone,disconnectis awaited once,stopis not awaited, and the source modes do not change.- Without the change, all three fail with
RuntimeError: Could not remove test session files. test_removal_does_not_make_writable_what_a_retired_symlink_points_to: a.closedsymlink to a read-only folder outside the session, in a folder where the link cannot be unlinked. The close raises, and the target's modes stay 0555/0444. Without the guard, the target becomes 0755.
Results (-n 2):
test_task_skills.py,test_sandbox_supervisor_client.pyandtest_sandbox_session.py: 173 passed at the head.- Hermes
test_sandbox.py: 244 passed. Pitest_sandbox.py: 304 passed, 10 skipped. - OpenCode
test_sandbox_sessions.pyandtest_checkpoint.py: 376 passed. - On the Claude Code/Codex branch:
tests/unit_tests/agents941 passed, with the same 5 environment-only failures as before (3 needcloudpickle, 2 depend on the host's gid mapping). Claude Codetest_sandbox.py72 passed, Codextest_sandbox_sessions.py368 passed. pre-commit runpasses on the changed files.
…e/Codex task-skills branch Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
…s branch Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
/ok to test 7675a7d |
|
/review reset=true |
…/Codex task-skills branch Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
/ok to test ff47b2b |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM. No BLOCKER, RISK or NOTE found.
I reviewed all 29 changed files, affected callers, tests and documentation, with separate OpenCode, Hermes and Pi reviews. This was a full RESET review.
Previous finding: The interrupted-copy cleanup RISK from review 6094914273 is fixed. A non-root probe reproduced failed cleanup at 0aee3074aa364c03968a1e5771fb1a4c0c9f674e. At this head, the same timed-out copy followed by repeated close removed both fresh and already-retired session directories, disconnected without stopping the borrowed sandbox, and kept source permissions unchanged. The retired-symlink guard also kept outside permissions unchanged. A public Hermes seed-failure probe confirmed that the original timeout survives cleanup without leaving failed session state.
CI: I relied on successful Lint check, Nemo_CICD_Test, Unit tests / Test, Unit tests / Server suite, all four core shards, all eight server shards, combined coverage, sandbox tests and LongMT scoring. The test results are in run 46096699230; inspected logs tested merge commit c75caf1c5ffc854416786bcb03a516d6c341cae8, which includes the admitted head. Changed-server and session-routing checks were skipped, not passed.
Non-blocking compliance and conformance checks are red. Compliance flags pre-existing run() methods. OpenCode and Pi compaction diagnostics also appear on the default branch. The mini-SWE conformance step timed out after its tests and produced no usable scenario results. I have not attributed every non-blocking failure; these checks do not feed Nemo_CICD_Test.
Local execution: Probes ran with Python 3.13.14 in 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:ba3eeeb0a60df9a7cd3bb9d2c1f36cabb0a493b5, the successful default-branch CI image because this head's container build was skipped. Imports were verified against the admitted source. Final probes passed for shared staging and error classification, real filesystem copying and cleanup, Harbor admission, OpenCode checkpoint retries and continuation, Hermes toolset isolation, and Pi worker arguments and replay. I did not rerun passing CI suites.
External agent runtimes, model calls and remote provider operations were mocked where needed. I did not reproduce external CLI discovery, model rollouts or a remote checkpoint restore. The PR supplies historical rollout evidence and states its limits.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
What does this PR do?
OpenCode, Hermes and Pi now run Harbor tasks that declare
[environment] skills_dir, and the model finds the skillsthrough the runtime's own skill mechanism. Before, the
harborEnvironment Server refused these tasks for all three.It reuses the
supports_task_skillsseed capability from the task-skills PR (#6293) and itsstage_task_skills, whichcopies the folder that
/tmp/.nemo-gym/task.jsonnames.Refs #5639 (Harbor tasks that declare
skills_dirare refused for Claude Code, Codex and OpenCode; Linear GYM-1268).Together with the task-skills PR (#6293) it covers every harness the issue names.
<XDG_CONFIG_HOME>/opencode/skills. The default profile denies theskilltool. By design, only a session whose task declares
skills_dirgetsskill: allow, added last because OpenCodeapplies the last matching rule; every other task keeps the deny. OpenCode 2 discovers skills another way, so it
declares nothing and still refuses these tasks.
<HERMES_HOME>/skillsand turns on itsskillstoolset for that session only (aHarbor run otherwise keeps just
terminal), so Hermes lists the skills in its system prompt.<PI_CODING_AGENT_DIR>/skillsand passes the folder with--skill; discovery stays off(
--no-skills). Pi lists skills only when itsreadtool is on, so it declares nothing withenable_tools: false.task.jsonor a missing folderrefuses the seed (422) and releases the sandbox.
main) carries itstask_skills, so arestored session keeps
skill: allow. A re-bind that finds the fork without the session's files copies the skillsagain from the folder the checkpoint names (a new
skills_dirkeyword ofstage_task_skills), not fromtask.json,which is under
/tmptoo and usually gone from such a fork. Hermes and Pi join checkpoints as restart-only, so theyseed, and stage the skills, again after a crash. The
harborEnvironment Server, the only one that writestask.jsontoday, is itself restart-only, so a Harbor episode starts over after a restore and does not reach thispath yet; it matters for an Environment Server that checkpoints in exported mode.
(
task_mcp_grantsrow), the task-folder and SkillsBench pages and the three harness READMEs. The Harbor admissioncomment and two Harbor test docstrings now name any harness that declares
supports_task_skills.Validation
At the head
e0755fc23(mainat15adc2254merged in through the Claude Code/Codex task-skills PR (#6293)), withgym env test(serial) and root tests at-n 2:opencode_agent: 1164 passed, 25 skippedhermes_agent: 416 passed, in a venv built fresh for the merged treepi_agent: 419 passed, 32 skippedclaude_code_agent: 304 passedcodex_agent: 635 passed, 9 skipped, 1 failed:test_close_confirms_cleanup_before_provider_cancellationread the child'schildren.jsonbefore the child had written it (an empty file,JSONDecodeError), a timing race in a test this PR does not touch; it passed 3 of 3 reruns on this head and 3 of 3 onmain15adc22542environment_servers/harbor: 732 passedtests/unit_tests/agents: 856 passed, 5 failed; all 5 also fail onmain15adc22542in a dev venv built from the same lock: 3 outcome-policy upload-evidence tests needcloudpickleand 2sandbox_pythonarchive-owner tests depend on the host's gid mappingbe5feec58. Conflicts frommain's Hermes v0.23.2 update, OpenCode checkpoint pauses and crash resume,and Pi's activation refactor. Hermes:
mainmoved payload building into_worker_payload(), which now takes atask_skillskeyword from the sandbox episode; this PR's skills-toolset block runs there. OpenCode: this PR'stask-skills staging follows
main's new_install_session_files()call. Pi:--skill <folder>follows--no-skillsinmain's_sandbox_payload().4249940deruns the Hermes staged-skill test with Hermes' own hostinterpreter, as
main's Hermes update requires.e0755fc23(mainat15adc2254) merged with no conflicts.77cca30e9ande07a2acd5. The two tests77cca30e9added toopencode_agent/tests/test_checkpoint.pyfail without it (OpenCode suite: 2 failed, 1161 passed, 25 skipped). On
77cca30e9, the re-bind test, now run withtask.jsonkept and lost, fails in both cases, and the two newskills_dirtests intests/unit_tests/agents/test_task_skills.pyfail (3 failed, 19 passed); all pass withe07a2acd5.The counts below were measured before that update; none at the head
ce1585877.dd4067a36merged cleanly. Ince1585877,responses_api_agents/hermes_agent/app.pyconflicted;both independent constant blocks are kept (this branch's
_SKILLS_TOOLSET, main's_OUTPUT_LIMIT_ERRORS). Ascratch merge of
0bb22e5d6,09c0ff566andorigin/main3d4fb51f4(same Hermes resolution; same harness,Harbor and
nemo_gym/agentscode asce1585877) passed with-n 8: Hermes suite 414; OpenCode sandbox-sessionand continuation tests 323; Pi skill tests 6; Harbor 401; root task-skills and agent-session tests 58.
0bb22e5d6(docs, comments, test docstrings),-n 8on a loaded node: Hermes 409 passed; OpenCode 981passed, 4 failed; Pi 363 passed, 25 failed; Harbor
test_app.pyandtest_multi_turn.py400 passed, 1 failed(
test_a_deadline_during_the_next_steps_preparation_reports_the_agent_stage_without_the_previous_response, whichthis PR does not change; it passes in the scratch merge and passed in a full Harbor-suite run at
05be6c5bb, wherea different slow-seed timing test failed instead); root (task-skills, agent-session, public-API and
session-contract tests) 1059 passed. Each OpenCode and Pi failure was a timeout or wall-clock assertion that passed
serially or alone.
pre-commit run --fileson the commit's five files, andruff check,ruff format --checkandgit diff --checkon all touched files: clean.05be6c5bb:pre-commit run --files <touched files>passed. Root venv,pytest tests/unit_tests/{agents,tooling,data/tasks/harbor} tests/unit_tests/test_session_contract_repo.py tests/unit_tests/test_public_api_facades.py -n 8: 3816 passed, 8 skipped, 11 failed; ten also fail at the basecommit (
cloudpickle,jinja2missing from the venv; a host uid/gid), one passes serially.OpenCode's seed reply gains
supports_task_skills, and the OpenCode and Hermes seeds run one moreexec. One testruns Hermes's own prompt builder and
skill_viewon a skill staged in the runner'sHERMES_HOME.Rollouts
A hosted GPT model behind an OpenAI-compatible endpoint (
openai_model), on OpenSandbox; OpenCode 1.17.11, Hermesat its pin, Pi 0.80.2. All six runs were at
05be6c5bbwith model-call capture on, not rerun after the docs-only0bb22e5d6or the merges. Thedemoskill says "The magic word is pineapple.";test.shscores the answer.skillamong the tools;<available_skills>listsdemoandcustomize-opencode; oneskill {"name": "demo"}skilltool (denied); answered "Abracadabra"skills_list,skill_view,skill_manage; prompt listsdemo; oneskill_view {"name": "demo"}process,terminal; no skills in the prompt<available_skills>gives the stagedSKILL.md; onereadof itSkills runs:
gym eval run <dir>/skillsreal --agent <opencode_agent|hermes_agent|pi_agent> --sandbox opensandbox --model-type openai_model --model <model> --model-url <url> ++observability_enabled=true ++model_call_capture_dir=<dir>. Controls: the same command on<dir>/skillsctrl, the same task withoutskills_dirandenvironment/skills/. No harness overrides.Claude Code and Codex. Their task-skills code in this diff comes from #6293 (task skills for Claude Code and
Codex), which this PR stacks on; it is not changed here. The Claude Code/Codex task-skills PR (#6293) ran the same
demo task with the same hosted model on
OpenSandbox (Claude Code 2.1.292 through Gym's model server, Codex 0.144.4):
Skill {"skill": "demo"}; answeredpineappleAbracadabra<CODEX_HOME>/skills/demo/SKILL.mdfrom its skill listing; answeredpineapplesetup.shmoves/tmp/.nemo-gymawaytask.jsonand uses the skillCompatibility and benchmark impact
skills_dirruns as before, apart from one more seedexec.OpenCode's built-in
customize-opencodeskill and any.claude/skillsor.agents/skillsfolders between theworking directory and the repository root (OpenCode README), and Hermes's
skill_manage. The SkillsBench READMEnames
customize-opencodeandskill_manage.~/$path now fails these harnesses' seed. No new configuration.The rollouts above ran before the
mainupdate. After it, a combined branch of this PR with the otherSkillEvaluator-related PRs on
main51630ce4fran SkillEvaluator's calculator, task-list and magic-mcp tasks: thestaged skill path appeared in 7 of 7 with-skill rows on each of OpenCode, Hermes and Pi (OpenCode called
skill,Hermes
skill_view, Pi readSKILL.md), and the baseline rows' skills folders were empty.Not tested: OpenCode 2 (left out, documented), multi-step tasks on these harnesses, skills with MCP servers on this
PR alone (covered only on the combined branch with the MCP PRs), a restore from a real checkpoint (unit tests only;
a Harbor episode starts over after a restore), a non-root
[agent].user, the full core unit suite.Checklist
git commit -s).🤖 Generated with Claude Code