Skip to content

fix(aviary_agent): add type discriminators to the mocked /verify response - #2461

Merged
ananthsub merged 1 commit into
NVIDIA-NeMo:mainfrom
ananthsub:ananthsub/fix-aviary-agent-test
Aug 10, 2026
Merged

ananthsub merged 1 commit into
NVIDIA-NeMo:mainfrom
ananthsub:ananthsub/fix-aviary-agent-test

Conversation

@ananthsub

@ananthsub ananthsub commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

NeMoGymResponseOutputItem gained a BeforeValidator in #2438 that rejects dicts without a type field. test_run_workflow mocks the /verify echo with an untagged item, {"role": "user", "content": "obs"}, so validating that payload into AviaryAgentVerifyResponse now raises.

Without the guard, an untagged output-call dict validates as the wrong union member: a web-search call with no type becomes NeMoGymResponseMcpListTools.

The Aviary integration is unaffected. AviaryAgent.run posts verify_request.model_dump(), and AviaryResourcesServer.verify echoes that back, so each item carries its type.

…onse

`NeMoGymResponseOutputItem` gained a `BeforeValidator` in NVIDIA-NeMo#2438 that rejects dicts
without a `type` field. `test_run_workflow` mocks the /verify echo with an untagged
item, `{"role": "user", "content": "obs"}`, so validating that payload into
`AviaryAgentVerifyResponse` now raises.

The validator is right to reject it. Without the guard, an untagged output-call dict
validates as the wrong union member: a web-search call with no `type` becomes
`NeMoGymResponseMcpListTools`.

Real transitions are unaffected. `AviaryAgent.run` posts `verify_request.model_dump()`,
and `AviaryResourcesServer.verify` echoes that back, so each item carries its `type`.

The mocked transition now matches what the agent builds in this scenario: the seeded
observation, the tool call, and the tool output. The test asserts the item types after
validation.

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
@ananthsub
ananthsub merged commit 2087acb into NVIDIA-NeMo:main Aug 10, 2026
24 checks passed
@ananthsub
ananthsub deleted the ananthsub/fix-aviary-agent-test branch August 10, 2026 21:44

This branch was previously deployed

1 inactive deployment
public — 661ec93f Deployed Aug 10, 2026 by copy-pr-bot[bot] via release / finalize / notify #1259
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants