fix: bugfix sweep round 2 — 8 fixes across MCP, PTY, state, and type safety#17
Merged
Conversation
…safety Consolidate MCP handle_tool_call from 3 lock acquisitions to 1 (T-892). Replace fragile Option sentinel unwraps with Result<T,()> in message validation (T-893). Introduce PaneId newtype to eliminate index/ID confusion in injection API (T-862). Add turn_id: Option<u64> to TextDone events with conditional active_turn_seq clear to prevent wrong-turn overwrites (T-874). Wire up dirty_rx broadcast receiver properly with take_dirty_rx() and capacity 64 (T-864). Change openspec_refresh_ticks from u16 to u32 with saturating_add to prevent overflow panic (T-891). Fix AppState::default() dead channels by storing receivers (T-894). Add kill signal to PTY stderr reader task via watch channel (T-868). Reviewed and verified by Reviewer and RUSure. 829 tests pass, cargo check clean, cargo fmt clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove 7 needless_borrow references in mcp/tools.rs where &st was passed but st is already a reference (auto-deref handles it). Fix 3 broken intra-doc links in pty/real.rs by qualifying with Self:: prefix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
handle_tool_callfrom 3 lock acquisitions to 1; handlers now take&mut InterSessionStateOptionsentinelunwrap()pattern withResult<T, ()>in structured message validationPaneId(u64)newtype to eliminate pane index/ID confusion in injection APIturn_id: Option<u64>toTextDoneevents with conditionalactive_turn_seqclear (prevents wrong-turn overwrites)take_dirty_rx()with capacity 64 (no notification gap)openspec_refresh_ticksfromu16tou32withsaturating_add(prevents overflow panic in debug builds)AppState::default()dead channels — receivers now stored instead of droppedAdditionally, 9 tickets were verified as already fixed from prior work (T-858, T-863, T-869, T-875, T-880, T-881, T-884, T-886, T-890).
Full OpenSpec change:
openspec/changes/bugfix-sweep/Test plan
cargo check— cleancargo test— 829 passed, 0 failed, 2 ignoredcargo fmt --check— cleanactive_turn_seqclear bug🤖 Generated with Claude Code