Skip to content

fix: name the failure kind of masked samples (conversational_tool_use_simulation, opencode_search) - #5688

Merged
oyilmaz-nvidia merged 9 commits into
mainfrom
fix/ctus-masked-failure-kind
Nov 6, 2026
Merged

oyilmaz-nvidia merged 9 commits into
mainfrom
fix/ctus-masked-failure-kind

Conversation

@oyilmaz-nvidia

@oyilmaz-nvidia oyilmaz-nvidia commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What

Masked results from three producers now carry a stable failure_kind and a bounded failure_reason (capped at 2000 characters). Diagnostics only: rewards, mask decisions, retries, result types and compatibility fields are unchanged.

Producer Condition failure_kind
conversational_tool_use_simulation (resources server) user or tool simulator call raised conversational_tool_use:simulator_call_failed
judge call failed judge_failed
judge verdict blamed the simulated user message conversational_tool_use:user_message_failed_verification
judge verdict blamed the simulated tool result conversational_tool_use:tool_result_failed_verification
conversational_tool_use_simulation (agent) transient failure in seed_session or verify environment_server_failed
transient failure in rollout agent_route_failed
opencode_search max_iteration agent_limit
context_window model_context_limit
agent_timed_out agent_timeout

Shared names come from nemo_gym/core/failure_kinds.py. The conversational_tool_use: names are environment-prefixed, as the issue suggests, because they describe conditions the shared vocabulary has no name for. The opencode_search mapping matches the one swe_agents uses (#5342).

Why

Part of #4882: these producers already returned mask_sample=True without naming the cause, so consumers could not tell a failed simulator or judge call from a judge verdict, or a budget-exhausted agent from a wrong answer. A missing kind means "unclassified". It does not mean the reward is valid.

Behavior preserved

  • Reward and mask_sample are untouched. The new _masked_failure() only reads existing state, after the mask is decided.
  • opencode_search still scores masked rows on purpose, to match the comparator's denominator.
  • Existing diagnostic fields (error_class, error_stage, _ng_failure_class, judge_generation_error, trajectory_invalid_reasons, and so on) are unchanged.
  • Causes the evidence cannot name are not guessed. The agent's transient failures use the generic environment_server_failed and agent_route_failed, because the error alone does not say which component behind the call broke.

Tests

Regressions sit at the final response boundary:

  • Each masked path asserts its kind and a non-empty reason (simulator failure for user and tool, judge failure, both verdict labels, all three agent stages, all three opencode_search endings).
  • Valid zero scores (agent failure, step limit, transfer-ground-truth mismatch, judged 0) and successful results assert failure_kind and failure_reason are None with the reward unchanged.
  • opencode_search also asserts a masked row keeps its scored reward.

Validation

  • pytest on the three touched test folders: 140 passed (resources_servers/conversational_tool_use_simulation/tests, responses_api_agents/conversational_tool_use_simulation/tests, resources_servers/opencode_search/tests).
  • pre-commit run --files <touched files>: passed. The guardwords hook skipped locally (private catalog unavailable), so CI is its first real run.
  • Not run: pre-commit run --all-files, gym env test (the gym CLI was unavailable locally, so I ran pytest directly).

Rollout evidence

N/A. Diagnostic-only: no reward, mask, agent or verifier logic changes, so no model rollout is needed.

Compatibility and migration

No user-facing change beyond two new optional response fields. Nothing is renamed or removed.

Not in this PR

anyswe_agent, anyterminal_agent and osworld_agent (blocked by open PRs touching the same files) and token capture (needs a separate decision, since an unusable token sequence does not show the reward is invalid) are tracked in #4882.

Refs #4882

…ked samples

Masked results now carry failure_kind and failure_reason, separating
simulator call failures, judge call failures and judge verdicts that
blamed the simulated user or tool result. Rewards and mask decisions
are unchanged.

Refs #4882

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Onur Yilmaz <[email protected]>
@copy-pr-bot

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

oyilmaz-nvidia and others added 2 commits November 5, 2026 15:02
…nsient agent failures

The agent's transient failure response masked the sample without a
failure_kind. Seed and verify failures are reported as
environment_server_failed and rollout failures as agent_route_failed,
with a bounded failure_reason. Reward and mask are unchanged.

Refs #4882

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Onur Yilmaz <[email protected]>
Rows masked for a budget-exhausted ending now report failure_kind and
failure_reason: max_iteration as agent_limit, context_window as
model_context_limit and agent_timed_out as agent_timeout. Reward, mask
and scoring (masked rows are still scored) are unchanged.

Refs #4882

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Onur Yilmaz <[email protected]>
@oyilmaz-nvidia oyilmaz-nvidia changed the title fix(conversational_tool_use_simulation): name the failure kind of mas… fix: name the failure kind of masked samples (conversational_tool_use_simulation, opencode_search) Nov 5, 2026
…rry no failure kind

Agent failure, step limit, transfer mismatch and judged-zero outcomes keep
their reward and are not labelled with a failure_kind or failure_reason.

Refs #4882

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Onur Yilmaz <[email protected]>
@oyilmaz-nvidia

Copy link
Copy Markdown
Contributor Author

/review

@oyilmaz-nvidia

Copy link
Copy Markdown
Contributor Author

/claude review

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

@oyilmaz-nvidia /claude review has been retired. Pull-request reviews now run through /review; comment this instead:

/review

Add model=claude to keep a Claude reviewer (the default is model=codex). mode=light|strict selects the review depth. Comment /review help for all options.

@oyilmaz-nvidia

Copy link
Copy Markdown
Contributor Author

/review model=claude

oyilmaz-nvidia and others added 2 commits November 5, 2026 18:12
…y actual cause

Address review on #5688: a local check failure (invalid user message, tool
schema failure) is no longer reported as a judge verdict, and a trajectory that
reached verification incomplete is no longer reported as a simulator call failure.

Refs #4882

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Onur Yilmaz <[email protected]>
@oyilmaz-nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 994eab6

@yuhezhang-ai yuhezhang-ai 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.

Verified both fixes: local-check failures and incomplete trajectories now report the correct causes. The affected test suites pass.

@oyilmaz-nvidia
oyilmaz-nvidia added this pull request to the merge queue Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

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

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 6, 2026
@oyilmaz-nvidia

Copy link
Copy Markdown
Contributor Author

/ok to merge 54cb9dc

@oyilmaz-nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 3740441

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

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

Merged via the queue into main with commit 450f7d4 Nov 6, 2026
62 checks passed
@oyilmaz-nvidia
oyilmaz-nvidia deleted the fix/ctus-masked-failure-kind branch November 6, 2026 18:34

This branch was previously deployed

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