Repository navigation
Work alongside a harness's own tools - #18
Merged
Merged
Conversation
Modulo treated every {"name": ..., "arguments": ...} in the output as its own
call: a harness's tool calls got "Unknown tool" and vanished from prose, and
the harness's tool definitions never reached the chat template.
- step(messages, tools=[...]) passes the harness's tool schemas (or
functions) to the chat template. Calls to them come back in
StepResult.other_tool_calls, not run, and stay in prose with their
<tool_call> tags. Modulo's own calls are still run and stripped with their
tags, and tool_messages() holds only their results.
- SteeringAgent(pass_through_unknown_tools=True) treats every non-Modulo call
as the harness's, for harnesses that describe tools in their own system
prompt (needed on OLMo-2, whose template ignores tools=).
- Without either, unknown calls still get "Unknown tool", now listing the
harness's tool names too.
- "parameters" is read as "arguments", since Llama-3.1's template asks for
that format; objects with a "description" (echoed tool definitions) aren't
calls.
Checked against the real Qwen2.5, Llama-3.1, OLMo-2 and Mistral v0.3 chat
templates: all render with tools=, and all but OLMo list the tools.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Modulo treated every
{"name": ..., "arguments": ...}in the model's output as its own call. That made it hard to use inside an agent framework that has tools of its own:prose.Changes
step(messages, tools=[...])passes the framework's tool schemas (or functions, as forapply_chat_template) to the chat template.StepResult.other_tool_calls. Modulo doesn't run them, and they stay inprosewith their<tool_call>tags.tool_messages()holds only their results.SteeringAgent(pass_through_unknown_tools=True)treats every call that isn't Modulo's as the framework's. It's for frameworks that describe their tools in their own system prompt, and it's needed on OLMo-2, whose template ignorestools=."parameters"is read as"arguments", because Llama-3.1's template asks for that format. Objects with a"description"are echoed tool definitions, not calls.Testing
test_agent_logic,test_cli,test_chat).tools=, keep the system prompt, and show tool results.tools=is given.🤖 Generated with Claude Code