Conversation
Closes cloudflare#15. Tool/action attack classes assumed the dispatcher only acts on a finalized model turn; add the class for handlers that dispatch on incrementally streamed arguments or content a later stop/cancel/edit event retracts.
anvithsg2004
approved these changes
Sep 17, 2026
anvithsg2004
left a comment
There was a problem hiding this comment.
PR Review: Add streaming/partial-turn early dispatch pattern
Verdict: LGTM / Approve (with one optional wording suggestion below)
Highlights:
- Addresses Issue #15 cleanly: Adds coverage for agent frameworks that execute tool calls or interpreter code incrementally during token streaming.
- Accurate Threat Model: Highlights critical edge cases in real-world agent implementations:
- Speculative/partial JSON parsing executing unvalidated or truncated arguments.
- Asynchronous races between client/user cancellation and side-effect dispatch.
- Retractions caused by provider-side stop tokens, moderation filters, or stream disconnects after tokens have already triggered downstream calls.
- Adheres to Skill House Style:
- Clean placement in
## Tool and action attack classes. - Conforms to canonical reference requirements (
AI-AND-LLM.md#Streaming and partial-turn early dispatch). - Explicitly bounds non-findings: "Read-only prefetch that cannot mutate state or disclose data beyond the requester is not a finding."
- Complements the universal move on line 74: "The strongest gate must apply after arguments are final and before every side effect."
- Clean placement in
Optional Phrasing Suggestion:
In sentence 3:
Confirm a fired side effect is held pending finalization, reversible, or bound to the same object the log records; a race between a cancellation and an already-dispatched action is a defect independent of prompt content.
Because being "held pending finalization" is the defensive mitigation rather than the defect condition, phrasing this as a verification of safeguards avoids any potential inversion when an automated hunter/critic evaluates it:
Verify whether side effects are staged pending turn finalization, are cleanly reversible, or are bound to the exact object recorded in the final audit log. Absent such safeguards, an unfinalized side effect or a race between a cancellation and an already-dispatched action is a defect independent of prompt content.
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.
Summary
Closes #15.
Test plan