Repository navigation
feat(agent): carry trace context on the three remaining hand-off model URLs - #4927
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
1ca42ae to
bff1819
Compare
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP — LGTM — no reliability concerns.
Reviewed all seven changed files and traced the affected URL construction through the shared helpers, sandbox runners, relay, and receiving middleware. Rollout/token-capture prefixes remain before the trace segment, and tracing-disabled behavior is preserved.
Validation was limited to source and test inspection; tests were not executed in this read-only review.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
…l URLs Follow-up to #4836. harness_agent, harness_exa_search and cvdp_agent built the model URL they give to a process outside Gym without the shared helpers, so their harnesses' model calls still arrived with no parent. harness_agent appends the current span's segment after the prefix it keeps in its run context; harness_exa_search builds the relay's upstream URL per run through a small method that adds it; cvdp_agent goes through base_url_for_run, which also gives it the rollout prefix it never had. A repo-wide test asserts that every agent exposing sandbox_model_base_url builds its URL with the helpers, so the list cannot grow silently again. Signed-off-by: Ingo Guehring <[email protected]>
bff1819 to
f827385
Compare
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40412287857 |
What changed and why
Follow-up to #4836 (merged), now on
main. Three agents built the model URL they hand to a process outside Gym withoutbase_url_for_run/resolve_model_base_url/apply_rollout_prefix, so after #4836 their harnesses' model calls still arrive at the model server with notraceparentand no URL-carried parent, and start their own traces.url_path_for_run("")kept in its run context). It now appendstrace_context_path_segment()after that prefix, so the URL names the run's span while traces export._upstream_model_url, which adds the segment after the rollout prefix. The explicitsandbox_model_base_urloverride keeps working.NV_MODEL_URL, with no rollout prefix either. It now goes throughbase_url_for_run, so it gets the rollout prefix (with capture on) and the trace segment (with traces on). Without either, the URL is unchanged.tests/unit_tests/telemetry/test_trace_context_path.pyscans everyresponses_api_agents/*/app.pythat exposessandbox_model_base_urland requires one of the helpers (or opencode's inherited builder, which vibench uses). It fails for a new agent that hands a model URL to a sandbox by hand.Agents checked and needing nothing: vibench (inherits opencode's builder, rewrites only the host), anyswe and anyterminal (direct helper calls, covered in #4836), simple_agent (Gym's own client), vcqa (external judge). harbor builds its own URL but for a Gym model server over Gym's client path and is out of scope here.
Compatibility
URLs change only while the process exports traces (segment) or capture is on (cvdp's new rollout prefix). No config change. No effect on benchmark results.
Validation
responses_api_agents/harness_agent/tests: segment after the run-context prefix, after the explicit override, and on the bare URL (59 passed with the guard and the feat(telemetry): carry trace context in the model URL for clients that send no traceparent #4836 module).responses_api_agents/harness_exa_search/tests:_upstream_model_urlwith and without a prefixed request and with the override (module passes on its own;test_model_relay_round_tripis port-sensitive when run in one process with other agents' modules, as CI never does).responses_api_agents/cvdp_agent/tests:NV_MODEL_URLcarries the segment, and the rollout prefix with capture on (14 pass in the module).tests/unit_tests/telemetry/test_trace_context_path.py: the new guard plus the feat(telemetry): carry trace context in the model URL for clients that send no traceparent #4836 suite. Running the cvdp module in the same pytest call as the others errored at collection locally; each module passes on its own.pre-commit runon the changed files: clean.Local before/after for harness_exa_search, no GPU
Real
harness_exa_searchagent with Gym'slocalsandbox provider, a harness in the sandboxed process that calls the model URL it was given with plain aiohttp (notraceparent), the realvllm_modelserver in front of a scripted stub, spans in memory, one/v1/responsescall under a parent span (thegym-local-trace-checkdriver,--harness exa).mainwith #4836 (f36e1265, before this PR)bff18194gym.agent.responsesharness_agent and cvdp_agent have no comparable local run: harness_agent installs Gym from a tarball inside the sandbox and runs a third-party CLI there, cvdp needs its hardware-design image under Apptainer. Their change is the same one-line URL construction, covered by unit tests.
Rollout evidence
N/A beyond the local exa run above: the mechanism (URL segment, server-side strip and parent) is the one verified in #4836 on tb4 (HSG job 8118123) and locally with pi and opencode.