- 
  Notifications
 
You must be signed in to change notification settings  - Fork 1
 
Fix handling of empty steering responses in tool call middleware #637
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
Conversation
 
WalkthroughUpdated middleware to treat empty replacement responses as valid by switching from a truthiness check to an explicit None check. Added a unit test to validate that an empty string replacement produces empty content while marking the tool call as swallowed. Changes
 Sequence Diagram(s)sequenceDiagram
 autonumber
 participant C as Client
 participant M as ToolCallReactorMiddleware
 participant T as Tool Call Handler
 C->>M: process(request)
 M->>T: evaluate tool call
 T-->>M: swallow_result (replacement_response may be "", None, or text)
 alt replacement_response is not None
 note right of M: Use replacement even if ""
 M-->>C: ProcessedResponse(content = replacement_response, metadata.tool_call_swallowed = true)
 else replacement_response is None
 M-->>C: ProcessedResponse(content = original, metadata.tool_call_swallowed = false)
 end
 Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
 Pre-merge checks and finishing touches✅ Passed checks (3 passed)
 ✨ Finishing touches
 🧪 Generate unit tests (beta)
 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
 🧰 Additional context used📓 Path-based instructions (2)**/*.py📄 CodeRabbit inference engine (AGENTS.md) 
 Files: 
 src/**/*.py📄 CodeRabbit inference engine (AGENTS.md) 
 Files: 
 🧬 Code graph analysis (1)tests/unit/core/services/test_tool_call_reactor_middleware.py (4)
 ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
 🔇 Additional comments (2)
 Comment   | 
 
Uh oh!
There was an error while loading. Please reload this page.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68ec25355ce08333b87d0889ca85b9a5
Summary by CodeRabbit
Bug Fixes
Tests