verifiers icon indicating copy to clipboard operation
verifiers copied to clipboard

`add_tool` upgrade for StatefulToolEnv + `disallow_non_tool_responses` for tool envs

Open stalkermustang opened this issue 3 months ago • 3 comments

Description

(I'm sorry I'm putting two changes into one PR, but I just noticed one while working on another...)

  1. build_schema_only_tool added to allow for tools in StatefulToolEnv that have non-Pydanticable args (+ tests). Previously, if one had to skip non-pydantic tool args they'd got an error, because we first convert then filter args.
  2. ToolEnv now has disallow_non_tool_responses argument (True by default to keep the behaviour the same), and assert on the type of response message is thus optional. Meaning, the model can respond with text and not only tool calls (which is a common case I met during work on PaperBench and DABStep envs).

Type of Change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [X] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Documentation update
  • [X] Test improvement

Testing

  • [X] All existing tests pass when running uv run pytest locally.
  • [X] New tests have been added to cover the changes

Checklist

  • [X] My code follows the style guidelines of this project as outlined in AGENTS.md
  • [X] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] My changes generate no new warnings
  • [ ] Any dependent changes have been merged and published

stalkermustang avatar Oct 09 '25 02:10 stalkermustang

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 09 '25 02:10 CLAassistant

ToolEnv now has disallow_non_tool_responses argument (True by default to keep the behaviour the same), and assert on the type of response message is thus optional. Meaning, the model can respond with text and not only tool calls (which is a common case I met during working on PaperBench and DABStep envs).

To elaborate a little, I came up with this when I was analyzing the PaperBench code. The OpenAI folks added "nudge messages" to the model if it didn't invoke any tool calls and just yaps. This isn't always bad -> we might want to allow the model to do so by setting a flag.

See: https://github.com/openai/frontier-evals/blob/main/project/paperbench/paperbench/agents/aisi-basic-agent/_basic_agent_plus.py#L61 and https://github.com/openai/frontier-evals/blob/main/project/paperbench/paperbench/agents/aisi-basic-agent/_basic_agent_plus.py#L323

stalkermustang avatar Oct 09 '25 02:10 stalkermustang

Ah nice! Think I understand, def a good feature -- will prob make a couple tweaks then can add

willccbb avatar Oct 11 '25 05:10 willccbb