Conversation
…d PASTE skill activation Wire two speculation dispatch paths: SSE decoding path (#3641): extend Claude SSE parser with ToolBlockStart/InputJsonDelta/ ToolCallComplete events so SpeculativeStreamDrainer can populate tool metadata before delta events arrive. Add chat_with_tools_stream() to LlmProvider + AnyProvider with streaming fallback. When partial tool call confidence exceeds threshold, call try_dispatch(Trusted) with a 2 s timeout. ToolRequestBody gains stream:bool to send a proper SSE request to the Claude API. PASTE pattern path (#3642): run_paste_skill_activation() calls PatternStore::predict() per active skill at context assembly time and dispatches candidates above threshold with per-skill trust level (500 ms timeout). observe_paste_transition() records tool transitions for pattern learning (200 ms, fire-and-forget). PatternStore is initialized only when mode=Pattern or mode=Both. Shared: is_tool_speculatable now delegated through CompositeExecutor, PolicyGateExecutor, and TrustGateExecutor so the gate reaches concrete executors in production. PartialJsonParser rejects inputs exceeding 512 KB (returns Malformed). confidence_threshold() accessor added to SpeculationEngine. Closes #3641, #3642
…n stream_drainer tests; fix broken rustdoc intra-doc links for ToolSseStream
471e9a5 to
d692ff1
Compare
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
ToolBlockStart/InputJsonDelta/ToolCallCompleteevents; newSpeculativeStreamDrainerfirestry_dispatch(Trusted)with 2 s timeout when partial tool call confidence exceeds threshold;ToolRequestBodygainsstream: bool;AnyProvider::chat_with_tools_streamwith streaming fallbackrun_paste_skill_activation()callsPatternStore::predict()per active skill at context assembly time;observe_paste_transition()records transitions for pattern learning;PatternStoreinitialized only whenmode=Pattern|Bothis_tool_speculatabledelegated throughCompositeExecutor,PolicyGateExecutor,TrustGateExecutor;PartialJsonParserrejects inputs > 512 KB;confidence_threshold()accessor added toSpeculationEngineTest plan
cargo +nightly fmt --check— PASScargo clippy --workspace --lib --bins -- -D warnings— PASS (0 warnings)cargo nextest run --config-file .github/nextest.toml --workspace --lib --bins— 8928/8928 PASStool_block_start_enables_incremental_dispatchverifies BUG-2 fix (tool metadata timing)SpeculativeStreamDrainerhas 6 unit tests covering core dispatch path, timeout, and thinking block accumulationclaude/mod.rsandtypes.rsCloses #3641, #3642