Skip to content

Keep provider-run tools out of harness sessions - #59

Merged
dylanuys merged 1 commit into
stagingfrom
fix/harness-no-provider-run-tools
Nov 19, 2026
Merged

dylanuys merged 1 commit into
stagingfrom
fix/harness-no-provider-run-tools

Conversation

@dylanuys

Copy link
Copy Markdown
Contributor

What changed

A harnessed question runs in a sandbox with no network, but a coding harness can still hand the model a tool that the model's provider runs on its own side:

  • Codex CLI declares web search as a provider-run tool in every request.
  • Claude Code's own WebSearch tool makes a separate model request whose only tool is a provider-run web search.

With a provider that offers it, those requests searched the live web. Whether a session had web access then depended on the routed model's provider, not on the sandbox, and a search can find a task's published fix.

portable_request, the filter every harness request passes through, now drops tools the provider would run itself. A request that forced such a tool is answered without one. The harness's own tools are untouched: a harness tool that needs the network is still offered to the model and fails as it would on a machine without one.

Validation

  • New test: a request offering a sandbox tool and a provider-run web search keeps only the sandbox tool; a request that exists only to search is sent with no tool and tool_choice="none"; a request with no provider-run tool is left alone. It fails without the change.
  • pytest packages/yugos-evals/tests/test_harnessed.py packages/yugos/tests/test_inspect_router.py passes (52 tests); ruff check and ruff format --check pass on the changed files.
  • Not yet verified in a live harness session.

🤖 Generated with Claude Code

Codex CLI declares web search as a tool its provider runs, and Claude
Code's WebSearch tool requests one in a call of its own. A provider that
offers it searched the live web from a sandbox that has no network. The
harness request filter now drops tools the provider would run itself; the
harness's own tools are untouched.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T05:05:39.294075Z 26613e6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 26613e6f1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +50 to +51
if isinstance(tool_choice, ToolFunction) and tool_choice.name not in {t.name for t in local}:
tool_choice = "auto" if local else "none"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset required tool choice when all tools are filtered out

When a harness request requires a tool with tool_choice="any" and offers only provider-run tools, filtering removes every tool but leaves the required choice unchanged. ModelInput.valid_request in packages/yugos/src/yugos/inference/chat.py explicitly rejects this combination with required tool choice needs tool definitions, so the request fails instead of receiving the intended tool-free answer. Normalize "any" to "none" when no tools survive, alongside the existing named-tool handling.

Useful? React with 👍 / 👎.

@dylanuys
dylanuys merged commit e1bf69d into staging Nov 19, 2026
2 checks passed
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.

1 participant