Skip to content

Tb e2e - #1939

Open
jialeiwang wants to merge 17 commits into
mainfrom
tb-service-network-fix
Open

Tb e2e#1939
jialeiwang wants to merge 17 commits into
mainfrom
tb-service-network-fix

Conversation

@jialeiwang

Copy link
Copy Markdown
Contributor

No description provided.

sdevare-nv and others added 17 commits May 11, 2026 14:14
Signed-off-by: Sugam Devare <sdevare@nvidia.com>
Signed-off-by: Sugam Devare <sdevare@nvidia.com>
Signed-off-by: Sugam Devare <sdevare@nvidia.com>
Signed-off-by: Sugam Devare <sdevare@nvidia.com>
Signed-off-by: Junkeun Yi <jkyi@nvidia.com>
This reverts commit c34d56c.
Signed-off-by: Sugam Devare <sdevare@nvidia.com>
Signed-off-by: Sugam Devare <sdevare@nvidia.com>
Signed-off-by: Sugam Devare <sdevare@nvidia.com>
Signed-off-by: Sugam Devare <sdevare@nvidia.com>
Port the validated oracle-run config into the gym eval/agent path (swe_agents/app.py),
all gated on dataset_name=='terminal-bench':
- NETWORK (new): allow_internet=false tasks run with '--net --network=none' (private
  loopback netns) so services bind privileged ports (nginx :80) + parallel workers don't
  collide; allow_internet=true keeps shared host netns. Default True => unchanged for
  existing rollouts. (CNI/slirp blocked on these nodes; only --network=none permitted.)
- /etc/hosts: add $(hostname) so sudo/tools resolve the host under --network=none.
- service boot: for offline service tasks, run the image runscript (Docker CMD) in the
  background before the agent so boot services (postgres/nginx/...) are up (real-TB parity).
- (already present from Path-2 work: persistent overlay, single-exec for daemon
  persistence, TEST_DIR/T_BENCH_TEST_DIR, apt _apt-sandbox=root, systemctl->service shim,
  /var/run/postgresql EOVERFLOW pre-create.)
vllm_model/app.py: normalize multi-part tool-result content so opencode rollouts don't 500.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…twork fix

Full arm64 SIF inventory (tb_sifs_arm64 + ots sifs_arm64 + image-conversion-HSG),
tb_single_exec=true (daemon persistence). Use with build_rollout.py output (rows carry
allow_internet from oracle_index -> gym branches --net --network=none per task).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…del conn)

The 946-task re-run gave 0% solved: --network=none isolates the netns so the opencode
agent cannot reach the policy model at host localhost:8000 (connection refused). The
service-mode network fix is valid ONLY for the standalone oracle check (no model), not the
agent rollout. Disabled both for the gym (clear comments + a path: socat-bridge the model
into a private netns to re-enable). Kept the harmless /etc/hosts $(hostname) + the
pre-existing Path-2 fixes. The old shared-netns rollout data stands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rint)

The --network=none service-mode fix does not apply to the agent rollout (agent needs the
host model; isolated netns breaks it). Revert ALL of my edits to the pre-change state:
/etc/hosts $(hostname) (only needed under --network=none), the net_flag/--network=none
branch, and the service-boot. Remove terminalbench_netfix.yaml. nemo-gym is back to its
prior working state; the finding is recorded in the logbook + memory, not the gym code.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…path setup

Adversarially audited (13-agent hunk audit + 3-refuter re-verify) and
remediated so every terminal-bench change is dataset- or config-gated and
non-TB (SWE) runs behave identically to fork point f067661:

- setup_scripts/opencode.sh: dual path. The hardened supply-chain path
  (pinned commit archive + sha256, ghostty pin, run_infer BENCH_CLI bundle
  patch, frozen-only installs, setup receipt) runs ONLY when (repo, commit)
  equals the preauthorized pin 0c088fd1; any other config takes the original
  git-clone path unchanged and is never hard-failed. Smoke-verified both
  paths: stock sdd/dev -> clone path, cli.ts launcher untouched, no receipt;
  pinned commit -> tarball path, receipt written, runtime-matched, authorized.
- OpenCodeHarnessProcessor.setup(): receipt verification is opt-in via new
  opencode_setup_receipt_enforce (default False = fork-point existence-checked
  setup, no receipt code reachable). Enforced setups build into
  swe_opencode_setup_preauthorized so receipt-invalidation rmtree can never
  poison the shared SWE cache. Dropped the NEMO_GYM_OPENCODE_SETUP_DIR env
  override (config-via-YAML convention).
- Receipt authorization pins build INPUTS (source tree, bun binary,
  repo/commit) plus build-tree shape, not bundle bytes: bun build output is
  not byte-reproducible across environments (confirmed empirically: identical
  inputs produced an opencode.js differing by ~850 bytes). Receipt-to-disk
  consistency is still enforced by runtime matching.
- _inner_responses: trajectory repair (_append_terminal_tool_outputs +
  synthetic_terminal_tool_outputs metric) is now terminal-bench-gated, and the
  new TB-gated _tb_flatten_multipart_content flattens opencode's list-form
  tool-result notices (image/PDF placeholders for text-only models) so the
  Responses conversion cannot 500 whole collection shards. NOTE: the flatten
  is correct for text-only policies; reconsider the implementation path
  (end-to-end multipart image support) before serving vision policies.
- vllm_model/app.py: reverted to fork point (the earlier shared-converter
  normalizer is superseded by the TB-gated guard).
- configs: terminalbench{,_netbridge,_all}.yaml pin agent_framework_commit
  0c088fd1 and set opencode_setup_receipt_enforce: true; superseded
  terminalbench_{multiset,opencode,tb21}.yaml removed; the preauthorized
  receipt reference opencode_setup_receipt_expected.json is committed.
- tests: terminal-bench isolation suite covering hidden-test isolation,
  receipt authorization semantics, dual-path setup contract, dataset gating,
  and flatten semantics; tomlkit importorskip keeps clean-env core-suite
  collection green. Full unit suite: 222 passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Test User <test@example.com>
…fixes all-zero rollouts)

HSG smoke job 4127557 failed 24/24 rollouts in ~29s each with
'Module not found /opencode_setup/opencode/index.ts': the hardened
run_infer.sh patch launched the BUNDLED bench-cli.js, inside which
detectOpencodeBin()'s import.meta.url root walk (4 levels up from
packages/opencode/src/bench) overshoots from .bench-build/ to /, misses
the opencode.js bundle, and falls back to a nonexistent <root>/index.ts.
The 46k-rollout campaigns launched bench/cli.ts from source, where the
walk lands correctly — the bundle-launch path had never been validated
in-container (flagged as audit finding M2).

Fix: drop the run_infer.sh BENCH_CLI patch entirely; the launcher runs
bench/cli.ts from the receipt-pinned source tree on every path
(campaign-proven, and removes the SWE-vs-TB launcher divergence).
bench-cli.js is still bundled (receipt build-tree shape) but unused at
runtime. Regenerated opencode_setup_receipt_expected.json +
H8_OPENCODE_SETUP_RECEIPT_SHA256 from a fresh hardened build (source
tree now carries the unpatched run_infer.sh); isolation test asserts
the patch is absent. Existing preauthorized caches fail authorization
against the new reference and rebuild automatically. 222 tests pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Test User <test@example.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 6, 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.

@jialeiwang jialeiwang changed the title Tb service network fix Tb e2e Jul 6, 2026
Base automatically changed from sdd/opencode-trainer to main July 9, 2026 18:24
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Jul 17, 2026
@cmunley1

Copy link
Copy Markdown
Contributor

there is multi harness tb support in anyterminal_agent if youd like to try

@svcnvidia-nemo-ci svcnvidia-nemo-ci added 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 labels Oct 20, 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 feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer sla:triage-overdue Review assignment is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants