Skip to content

feat(droid): add the Factory Droid harness adapter - #5537

Merged
yaoyu-33 merged 25 commits into
mainfrom
claude/gymint-564-droid-sessions-dc4ff0
Nov 12, 2026
Merged

yaoyu-33 merged 25 commits into
mainfrom
claude/gymint-564-droid-sessions-dc4ff0

Conversation

@yaoyu-33

@yaoyu-33 yaoyu-33 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Adds a Factory Droid 1.1.0 agent-session adapter. Droid runs droid exec inside a task sandbox and uses Gym's Model Server through its BYOK settings, without a Factory account or API key. No separate issue is needed for this focused adapter integration.

  • Seed borrows a direct sandbox or creates an owned one, probes Linux/glibc/architecture support, and uploads the verified native runtime prepared on the Agent Server. Sandbox installation needs neither Node nor registry access. Owned sandboxes receive lifecycle labels and a default TTL.
  • One supervised activation per session supports identical retries, rollout identity checks, deadlines and rollout stops. Every model attempt carries the rollout URL and x-session-id. Close returns observations and releases the correct sandbox owner.
  • Private Factory state and airgap settings reduce harness side effects; task shells retain the task's HOME. The stream becomes conversation, tool-call, timing, sandbox and usage evidence.
  • Model-error classification is restricted to the pinned release's terminal type: error event grammar. HTTP-status, connection and context-limit messages are recognized there; untested versions and unmatched messages remain unknown. Tool output, assistant text and stderr never become model-failure evidence. The additional provenance regressions exercise completed and nonzero-exit runs without changing production classification.

Compatibility and limits

New session-only adapter: no host path or legacy /run. Existing configs remain unchanged. Sampling belongs on the Model Server; configured Droid model limits remain per-call/model settings. Required external tool grants are refused.

Capability is Evaluation; per-call response IDs, training capture and context-compaction observations are unavailable. The proprietary binary is downloaded, not vendored. Foreground shell commands can receive unexplained SIGKILL in some container images; this remains a benchmark-result limitation. No benchmark allowed_agents declaration is added; development pairings require --allow-unsupported-pairing.

Earlier validation

  • Earlier review source: db7607f08; all 2 changed-file hashes match the workstation sources, and the commit has DCO sign-off.
  • Linux component suite: python -m pytest responses_api_agents/droid_agent/tests -q -o addopts= — 144 passed.
  • pre-commit run --files <changed paths> — passed on the Linux workstation; no full-repository pre-commit claim.
  • Real-model rollout/evidence applicability: N/A for this follow-up: only tests and README changed; production is byte-identical to the prior validated revision 185c41cb5. Its one-row Reasoning Gym smoke completed with reward 0.0 and no leftover task processes or containers. The added classifier coverage uses recorded pinned-release grammar and tests the response/observation/outcome-policy path.

CI repair — November 10

At 03dd2fe380cb9761f6de81dd714efe4e449fedc3, isolate the synthetic HTTP resume test from source-fingerprint changes caused by concurrent CI workers. An explicit runtime-change assertion still verifies that resume rejects a changed runtime without modifying saved results or making new model/verifier calls. This is the same repair validated on Copilot with a controlled regression that fails before the fix and passes after it.

Validation on the Linux workstation using this exact tree: 13 HTTP resume/recovery and runtime-fingerprint tests passed; full pre-commit run --all-files passed using Python 3.13 hook environments. Model rollout: N/A, test-only change. No separate issue is needed for this CI repair.

Main integration repair — November 11

Source: e4e3c686ed294730a7bccdffc2055bfdc4a11c4a, integrating main 802493ac3a4921a68aacbee5b64de5813aa2a21b. Preserve both Droid and Goose in the two adapter documentation tables and agent-session registry. Refresh the branch-only Droid lockfile to main's OpenAI SDK 2.45.0 requirement; only its constraint, package version, archive and wheel metadata change. Droid runtime and tests are unchanged from the previous PR head. No separate issue is needed for this focused integration repair.

Validation ran on the Linux workstation against the exact committed tree:

  • python -m pytest responses_api_agents/droid_agent/tests -q -o addopts= — 144 passed.
  • python -m pytest tests/unit_tests/config/test_global_config.py::TestComposeUnboundAgent::test_agent_session_agent_types_match_the_agent_apps -q -o addopts= — 1 passed.
  • python -m pytest tests/unit_tests/tooling/test_agent_environment_default_configs.py tests/unit_tests/tooling/test_agent_environment_session_templates.py -k 'droid or goose' -q -o addopts= — 4 passed.
  • python tests/unit_tests/test_fern_docs_links.py — 29 passed.
  • pre-commit run --all-files — passed.
  • cd fern && npm run check — zero errors; authenticated missing-redirect check skipped because no Fern credential was available. No redirects changed.

Independent source review found no blockers. New model rollout: N/A for preserving registry/documentation entries and aligning the dependency lock with main; the historical smoke evidence above remains pinned to its original revision. Fresh GitHub CI was requested for the exact source commit; see current checks.

Completed CI at e4e3c686ed294730a7bccdffc2055bfdc4a11c4a: CICD NeMo Gym and release rehearsal passed. Lint and DCO passed.

yaoyu-33 and others added 5 commits November 3, 2026 10:46
Run Factory Droid 1.1.0 (droid exec) inside the task sandbox of a
single_agent_turn agent session. Droid's BYOK custom model points at the
rollout-prefixed Gym Model Server, so it needs no Factory account, and
FACTORY_HOME_OVERRIDE keeps its state out of the task repo and home.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
Droid's completion usage counts cache reads apart from input_tokens, so
the response under-reported input against the captured model calls
(141 versus 7821 prompt tokens in the EOS smoke). Add cache reads and
writes back, report reasoning tokens as unavailable, and put the sandbox
id on the sandbox and tool observations.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
Droid 1.1.0 reports a failed tool call with an error object and no
value, so the response recorded the tool output as "null" instead of
the message the model saw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@copy-pr-bot

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

@yaoyu-33 yaoyu-33 added feature New capabilities, enhancements, or enablement work area:agent Agent harnesses and Responses API agent behavior labels Nov 3, 2026
@yaoyu-33

yaoyu-33 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 16a68c7

The secrets detector reads the sha512 package checksums in runtime.py as
high-entropy secrets. They are public npm integrity values, so mark each
line with the repository's inline allowlist pragma.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

yaoyu-33 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 82d371c

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

…id-sessions-dc4ff0

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

yaoyu-33 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 3c9f5ac

… and uv.lock

Main now requires every component to declare its dependencies in a
pyproject.toml with a committed uv.lock, checked by the component lock
CI job. Droid had a requirements.txt with the same single nemo-gym
dependency as Codex, so it gets Codex's pyproject.toml under its own
name and an equivalent lock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

yaoyu-33 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7295917

…fecycle

Review follow-ups for the Droid agent:

- Refuse a sandbox Droid cannot run in as final (HTTP 422) instead of a
  retryable 500: a non-Linux platform, musl or an unknown architecture
  from the platform probe, and an image without bash that apt-get cannot
  fix (the bootstrap exits 78; the apk branch is gone because Alpine is
  refused anyway). Unreadable probe output stays retryable. Provider
  config errors are refused at seed too.
- Give agent-owned sandboxes a default ttl_s (install timeout + run
  timeout + 600 s; an explicit value, null included, wins) and merge the
  provider's default metadata, sandbox_config metadata and per-session
  labels.
- A rollout stop before launch, or after launch but before the runner
  opened events.jsonl, returns an incomplete response with an empty
  transcript instead of failing artifact collection.
- Log Droid's stderr when a run fails without an error event, and record
  an agent_startup_failed gap when it wrote no events.
- Release an upload slot for every staged piece, including pieces the
  task group cancels before they start, and keep the caller's error when
  the staging directory cannot be removed.
- Fetch registry metadata once per version and target.
- Tests: platform refusals, owned-sandbox ttl and labels, rollout stops,
  stderr diagnostics, upload slot release, metadata reuse, and coverage
  for closing, timeouts, usage validation, non-text input, sessionless
  requests, a detached stdout holder and a corrupt cache. The installer
  tests write gzip with a fixed mtime and check for their tools on the
  PATH they run with.
- README: validated pairings, the owned-sandbox lifetime, /tmp space,
  and where sampling settings go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
Main split the legacy-agent migration tests across several files, so the
two Droid migration tests move into test_agent_environment_default_configs.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 6b7fa71

@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 03dd2fe

adil-a
adil-a previously approved these changes Nov 10, 2026
Copilot's harness landed on main and joined the same lists as Droid: the
agent-session agent types, the agents the legacy relay migration skips, and
the harness table in the integration docs. Keep both entries in each.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 261b05f

mini-SWE's row landed on main beside Droid's in both harness tables of the
agent-server docs. Keep both rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 48166f3

@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test c0d7d64

Retain both Droid and Goose entries in the agent-session registry and
documentation tables. Refresh Droid's lockfile to main's OpenAI 2.45.0 pin.
The adapter runtime and tests are unchanged.

Validated the exact merge tree on the Linux workstation: 144 Droid tests,
one registry contract, four migration cases, 29 documentation link tests,
and full pre-commit passed. Fern check reported zero errors and one warning:
the authenticated missing-redirect check was skipped. No redirects changed.

Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test e4e3c68

@adil-a adil-a 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.

Re-approving after the stale-review dismissal. The PR's own commits are unchanged since the earlier approval except the release-rehearsal changelog commit and a sync with main, and CI is green on this head. (Delta check done with Claude Code on Adil's behalf.)

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

Re-approving after checking the delta from my approved revision db7607f082 to e4e3c686ed.

The Droid implementation and tests are unchanged. The refresh preserves its session registrations and aligns the lockfile with main; the additional changes are test isolation and PR-rehearsal changelog scope. The previously reviewed failure-message and mixed-libc fixes remain intact.

Focused Droid/configuration validation produced 140 passes and 6 skips. The remaining 24 configuration tests were blocked by stale installed package metadata in my test environment (its OpenAI constraint differs from this checkout); I do not count those as verified. No new native Droid rollout or full repository suite was run. Existing conformance follow-ups remain non-blocking.

— @codex

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43259683579

This branch was previously deployed

1 inactive deployment
public — e4e3c686 Deployed Nov 11, 2026 by copy-pr-bot[bot] via release / finalize / notify #11859
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants