Repository navigation
test: add streaming coverage for per-tool rails - #2443
Conversation
…alls and tool results
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe pull request adds streaming tests for per-tool regex rails. It also adds an SSE helper for multiple tool calls and moves tool-result conversation construction to a module-level helper. ChangesPer-tool regex streaming tests
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Suggested reviewers: Merge Risk: ⚪ Minimal · up to The added streaming tests cover the intended tool-call and tool-result behavior. No issue identified here prevents merging after normal checks. 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
tgasser-nv
left a comment
There was a problem hiding this comment.
Looks good just a couple of nits
Description
Adds streaming coverage for per-tool regex rails that the existing tests did not exercise:
TestStreamingPerToolCallRegexgains a test where only the second of two streamed calls matches the pattern (the stream is blocked with onetool_output_railsviolation and no tool call leaks), and one where two clean calls both stream through in order.TestStreamingPerToolResultRegex. A result matching the pattern blocks the stream with atool_input_railsviolation before the model is called, and a clean result streams through. Tool results were previously only covered non-streaming.The streaming path is the same for every per-tool rail:
stream_asyncbuffers the tool calls, then hands them to the sameare_tool_calls_safe/are_tool_results_safeused in generation, which dispatch any per-tool rail identically. So these tests use the regex rail as a deterministic stand-in for that path rather than repeating it per rail type.Related Issue(s)
Verification
make test: all passing.AI Assistance
Checklist
Summary by CodeRabbit