fix(evaluator): require nemo-relay 0.7.3 so Relay teardown cannot fail a good trial - #1689
fix(evaluator): require nemo-relay 0.7.3 so Relay teardown cannot fail a good trial#1689SandyChapman wants to merge 4 commits into
Conversation
…l a good trial
NVBug 6562846: a Fabric DeepAgents invocation completed its turn — model calls,
tool calls, a final assistant response — and was then reported as failed, because
Relay's telemetry teardown raised
RuntimeError: invalid argument: scope handle is not at the top of the stack
Relay's LangChain callback handler closed chain scopes in callback order rather
than stack order. LangGraph schedules sibling chain runs concurrently, so a run
could end while scopes opened after it were still open; the out-of-LIFO pop was
rejected and swallowed, the child scope was stranded live on the stack, and the
enclosing scope's teardown then raised. Fabric's DeepAgents adapter attributed
that telemetry fault to the agent, flipping a successful trial to failed.
Both halves are fixed upstream — nemo-relay 0.7.3 defers a completed scope until
it reaches the top of the stack, and nemo-fabric 0.2.0 separates the telemetry
fault from the invocation failure domain — and this repo already locks both. The
declared floor still admitted the broken 0.7.2, so an install that does not use
uv.lock could still resolve it; this raises the floor everywhere it is declared
and adds a test that drives the real handler through the overlapping-close
sequence, so a downgrade or an upstream revert turns CI red instead of turning
good trials into failures.
Signed-off-by: Sandy Chapman <schapman@nvidia.com>
|
…n the code The dependency-floor comment opened by naming the version it replaced, which the diff and the commit already carry, and then retold the whole defect. What a reader of that line actually needs is the one thing they could get wrong: that the floor is load-bearing and must not be lowered. Same test applied to the regression test's own comments and docstring: keep the invariant, drop the retelling. Signed-off-by: Sandy Chapman <schapman@nvidia.com>
…uard Signed-off-by: Sandy Chapman <schapman@nvidia.com>
It exercises nemo-relay's own LangChain callback handler, not any code in this repo. The version floor is what keeps the defect out; a test in our suite for a dependency's internals is maintenance we do not owe. The fix was validated manually against 0.7.2 and 0.7.3, and end to end through a live DeepAgents run. Signed-off-by: Sandy Chapman <schapman@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (4)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe pull request raises the minimum ChangesDependency alignment
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The PR raises the required Relay version to prevent the known teardown failure and updates the corresponding lock and wheel constraints; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (4 skipped: 4 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
svvarom
left a comment
There was a problem hiding this comment.
The wheel build checks pass. LGTM.
Summary
NVBug 6562846: a Fabric DeepAgents invocation completed its turn — model calls, tool calls, a final assistant response — and was reported as failed, because NeMo Relay's telemetry teardown raised
RuntimeError: invalid argument: scope handle is not at the top of the stack. QA saw 31 such trials in the 2026-08-05 Evaluator regression. Both halves of the root cause are now fixed upstream (nemo-relay0.7.3,nemo-fabric0.2.0) and this repo already locks both. What it still declared wasnemo-relay>=0.7.2, which admits the last broken release on any install that does not useuv.lock. This raises the declared floor to 0.7.3.Related Issue
AALGO-495. NVBug 6562846.
Changes
nemo-relayfloor>=0.7.2→>=0.7.3at all four declaration sites:packages/nemo_evaluator_sdk,packages/nemo_platform,packages/nemo_platform_plugin, and the vendoredsdk/python/nemo-platformmirror (regenerated bymake vendor, not hand-edited into divergence)..github/wheel-constraints/nemo-platform-services.txtmoved off itsnemo-relay==0.7.2pin, which would otherwise have made the wheel install-smoke-test unsatisfiable against the new floor — and had it validating the broken version.uv.lockrelocked with the platform uv (0.9.14). The resolved version was already 0.7.3, so the lock diff is four specifier lines.No code changes: nine lines in, nine out.
Root cause, for the record
Relay's LangChain callback handler popped chain scopes in callback order rather than stack order. LangGraph schedules sibling chain runs concurrently, so a run can end while scopes opened after it are still open; the out-of-LIFO pop was rejected and swallowed, the child scope was stranded live on the stack, and the enclosing scope's teardown then raised. Fabric's DeepAgents adapter caught that teardown exception in the same
trythat guarded the agent invocation, so an observability fault was reported as the agent's failure.nemo-relay0.7.3 defers a completed scope until it reaches the top of the stack;nemo-fabric0.2.0 separatestelemetry_errorfrom the invocation failure domain.Why no regression test
A test in this suite would have to drive
nemo-relay's own callback handler — no code in this repo is involved — so it could only ever fail on a dependency change, which the floor already prevents. The floor is the control; the validation below is the confirmation.Type of Change
Quality Gates
nemo-relay, so the only meaningful verification is running the defect against both versions, recorded below.Verification
Signed-off-by:traileruv run pre-commit run -apasses, or any blocked checks are identified belowTargeted validation:
The fix is in 0.7.3, not 0.7.2 — confirmed at source.
nemo_relay/integrations/langchain/callbacks.pygoes from 112 lines in 0.7.2 to 244 in 0.7.3._CompletedScopeand_close_completed_scopesare absent in 0.7.2 and present in 0.7.3; 0.7.2's_pop_scopecallsnemo_relay.scope.popdirectly, while 0.7.3 records the completion and drains only when that scope reaches the top. The two are consecutive releases, so there is no earlier version carrying the fix.And confirmed by behaviour. Running the bug's minimal repro — two overlapping LangChain chain lifecycles inside one Relay scope, through the real
NemoRelayCallbackHandler:nemo-relay0.7.2 — the childscope.popis rejected and logged, the stack top is left on the strandedchain-A, and leaving the outerdeepagents-requestscope raisesRuntimeError: invalid argument: scope handle is not at the top of the stack.nemo-relay0.7.3 (this floor) — the stack top is back todeepagents-requestand the scope exits normally.Live end-to-end. A real DeepAgents agent driven through
FabricAgentRuntime→ Fabric 0.2.0 → Relay 0.7.3 with telemetry enabled (openai/gpt-oss-120bviaintegrate.api.nvidia.com, two rounds of tool calls): trialCOMPLETED,agent_ok=True, Fabricstatus=succeeded, adaptertelemetry_error=None, and the full evidence set attached (result,workspace,relay_config,relay_atif,relay_atof,trace; ATIF 133 KB). That is the scenario that produced the failed QA trials.uv run --frozen pytest packages/nemo_evaluator_sdk/tests/agent_eval/ -q— 776 passed, 10 skipped.uv run ruff check packages/nemo_evaluator_sdk/— clean.tools/lint/lint-python-types.sh(the exact CI type-check entrypoint) — all checks passed.uv run pre-commit run -awith the platform uv (0.9.14) onPATH— all 15 hooks pass, includinguv-lock,uv.lockdrift, ty, copyright headers, Helm Docs, and UI lint-staged.uv lock --checkwith uv 0.9.14 — clean.tools/lint/lint-sdk-vendored.shcannot execute on this host (mapfile: command not found; macOS ships bash 3.2). Its two invariants were verified directly instead:make vendorandmake generate-cli-reference-docsboth leave the tree clean, sosdk/python/anddocs/cliare in sync.Known-stale, deliberately not touched
agents/nemo-studio-assistant/uv.lockstill carriesnemo-relay>=0.7.2,<0.8in its copy of the evaluator SDK's metadata. That lock was already out of date before this change (uv lock --check --project agents/nemo-studio-assistantfails on unmodifiedmain), nothing in CI or the Makefile gates it, andDockerfile.fabric-localinstalls fromconstraints.fabric-local.txtrather than the lock. Relocking it re-resolves the whole project and drags in ~190 lines of unrelated upgrades (langchain-core, langgraph, langsmith), which does not belong in this PR. It resolvesnemo-relay0.7.3 today, so it is not exposed to the defect.