-
Notifications
You must be signed in to change notification settings - Fork 29
fix: escalation tool missing runtime parameter #381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
andreitava-uip
previously requested changes
Dec 30, 2025
19495a5 to
7129020
Compare
7129020 to
4869ffe
Compare
smflorentino
approved these changes
Jan 3, 2026
Chibionos
approved these changes
Jan 3, 2026
Chibionos
reviewed
Jan 3, 2026
Chibionos
approved these changes
Jan 3, 2026
Chibionos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving with a design comment, @saksharthakkar can't the StructuredTool be improved ? rather than creating a new class ?
4869ffe to
55997f5
Compare
The escalation tool was failing with: TypeError: escalation_tool_fn() missing 1 required positional argument: 'runtime' Root cause: Tool expected `runtime: ToolRuntime` param but nothing provided it. Solution: Use wrapper pattern instead of injection - Tool returns graph-agnostic EscalationResult dataclass - Wrapper converts result to Command using call["id"] (tool_call_id) - Remove ToolRuntime injection code from tool_node.py This follows reviewer feedback: tools should be graph-agnostic, wrappers handle graph integration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
55997f5 to
e207324
Compare
Addressed feedback: refactored to wrapper pattern - tool now returns dict (graph-agnostic), wrapper handles Command.
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.
Summary
Fixes escalation tool that was broken due to missing
tool_call_idwhen returningCommand.Problem
runtime: ToolRuntimeparameter to gettool_call_idToolRuntimeinto the toolTypeError: escalation_tool_fn() missing 1 required positional argument: 'runtime'Solution
Use wrapper pattern consistent with other tools:
Tool returns dict (like
process_tool,context_tool, etc.)escalation_tool_fnreturns{"action": ..., "output": ..., "escalation_action": ...}Wrapper handles graph integration
escalation_wrapperreceives(tool, call, state)wherecall["id"]is thetool_call_idCommandwhen termination neededToolWrapperMixinto attach wrapper to toolSimplified tool_node.py
ToolRuntimeinjection logic that was never fully implementedWhy escalation is different from other tools
CommandChanges
escalation_tool.py: Returns dict, wrapper converts to Commandtool_node.py: Removed unused ToolRuntime injection codetool_factory.py: Fixed return typetest_tool_node.py: Cleaned up importspyproject.toml: Version bump to 0.2.5Test plan
pytest tests/agent/tools/test_tool_node.py- all passruff check .- no errorsmypy- no new errors