Skip to content

feat(harness_agent): add require_tool_call and keep the pre-gate reward - #5033

Merged
cmunley1 merged 2 commits into
mainfrom
cmunley1/harness-agent-require-tool-call
Oct 24, 2026
Merged

cmunley1 merged 2 commits into
mainfrom
cmunley1/harness-agent-require-tool-call

Conversation

@cmunley1

Copy link
Copy Markdown
Contributor

What broke

On tasks a model can sometimes answer from memory, a harness run can return a direct answer without ever calling a tool, and harness_agent scores it like any other run. In RL this rewards skipping the harness, which is the behavior these environments exist to train.

Fix

A new require_tool_call option on HarnessAgentConfig, off by default. When it is on, a run whose response has no function_call or custom_tool_call item gets reward 0 after /verify. custom_tool_call counts because free-form tools (for example Codex's apply_patch) emit that item type.

The verifier's own score is kept in harness_pre_gate_reward, so a gated zero can still be told apart from an unsolved task when profiling or filtering data.

osworld_agent has a related require_tool_call agent option, which retries a model call until the reply contains a tool call. This change is the reward-side counterpart for harness_agent, applied to the whole run after verification.

Test

responses_api_agents/harness_agent/tests/test_app.py::test_require_tool_call_zeroes_runs_without_tool_calls covers four runs: no output and a text-only answer get reward 0, a function_call or a custom_tool_call keeps the verifier's 1.0, and harness_pre_gate_reward is 1.0 in all four. test_config_defaults checks the option is off by default. All 35 harness_agent tests pass.

With require_tool_call, a run whose response has no function_call or
custom_tool_call item gets reward 0, so answering directly without using
the harness earns nothing. The verifier's own score stays in
harness_pre_gate_reward, so a gated zero can still be told apart from an
unsolved task. Off by default.

Signed-off-by: Christian Munley <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Oct 24, 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.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:agent Agent harnesses and Responses API agent behavior feature New capabilities, enhancements, or enablement work labels Oct 24, 2026
@cmunley1
cmunley1 marked this pull request as ready for review October 24, 2026 01:11
@cmunley1

Copy link
Copy Markdown
Contributor Author

/ok to test 0012576

@cmunley1

Copy link
Copy Markdown
Contributor Author

/review

@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 24, 2026 01:12
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the needs-review PR is ready for code review and waiting on a reviewer label Oct 24, 2026
@cmunley1

Copy link
Copy Markdown
Contributor Author

/ok to test 7cf15df

@cmunley1

Copy link
Copy Markdown
Contributor Author

/review

@svcnvidia-nemo-ci svcnvidia-nemo-ci 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.

SHIP

LGTM — no reliability concerns. Reviewed the opt-in reward gate in HarnessAgent.run, its response/verifier contracts, and the regression coverage. The default behavior remains unchanged, and enabling the gate preserves the verifier score separately.

Static review only; tests and model smoke rollouts were not executed.

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.

@cmunley1
cmunley1 merged commit 8130a2c into main Oct 24, 2026
47 of 50 checks passed
@cmunley1
cmunley1 deleted the cmunley1/harness-agent-require-tool-call branch October 24, 2026 17:05
cmunley1 added a commit that referenced this pull request Oct 24, 2026
Resolves the conflict with #5033 (require_tool_call) in harness_agent run(): both config fields are kept, the tool-call gate runs on the verify result and a scored failure closes its sandbox after it.

Signed-off-by: Christian Munley <[email protected]>

This branch was previously deployed

1 inactive deployment
public — 7cf15df4 Deployed Oct 24, 2026 by copy-pr-bot[bot] via release / finalize / notify #6991
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants