Send back helpful message instead of raising when action is plain Message - #344
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts environment stepping behavior so non-tool-call Message inputs no longer trigger server-side 500s, instead returning a consistent, non-fatal “no tool calls” observation.
Changes:
- Add a shared default “no tool calls received” step response on
Environment. - Update multiple
Environment.step()implementations to return the default response whenactionis not aToolRequestMessage. - Update server-level tests to expect HTTP 200 and validate the default observation for plain
Message/ToolResponseMessageactions.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_envs.py | Updates TaskDatasetServer step tests to assert 200 + default “No tool calls” observation; adds direct DummyEnv tests for default behavior. |
| src/aviary/functional.py | FunctionalEnvironment now short-circuits to the default response when action isn’t a ToolRequestMessage. |
| src/aviary/env.py | Introduces DEFAULT_NO_TOOL_CALLS_RESPONSE on Environment and updates DummyEnv.step() to use it for non-tool-request actions. |
| packages/notebook/src/aviary/envs/notebook/env.py | Notebook environment step now returns the default response for non-tool-request actions. |
| packages/lfrqa/src/aviary/envs/lfrqa/env.py | LFRQA environment step now returns the default response for non-tool-request actions. |
| packages/labbench/src/aviary/envs/labbench/env.py | Labbench environment step now returns the default response for non-tool-request actions. |
| packages/hotpotqa/src/aviary/envs/hotpotqa/env.py | HotpotQA environment step now returns the default response for non-tool-request actions. |
| packages/gsm8k/src/aviary/envs/gsm8k/env.py | GSM8K environment step now returns the default response for non-tool-request actions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jamesbraza
approved these changes
Mar 17, 2026
| DEFAULT_NO_TOOL_CALLS_RESPONSE: ClassVar[tuple[Messages, float, bool, bool]] = ( | ||
| [ | ||
| Message( | ||
| content="No tool calls received. Please call one or more tools to proceed." |
Collaborator
There was a problem hiding this comment.
Technically a tool request message with 0 tool calls is valid, but also it makes Environment.step a no-op then so just wastes tokens
Collaborator
Author
There was a problem hiding this comment.
can chat in person, I don't think this one's a concern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#342 was way too harsh - better to send back a non-fatal Message.