Skip to content

fix(commands,mcp): resolve HRTB blockers for /compact and /mcp registry migration#2944

Merged
bug-ops merged 2 commits intomainfrom
2942-hrtb-compact-mcp-registry
Apr 13, 2026
Merged

fix(commands,mcp): resolve HRTB blockers for /compact and /mcp registry migration#2944
bug-ops merged 2 commits intomainfrom
2942-hrtb-compact-mcp-registry

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Apr 13, 2026

Summary

Changes

/compact (#2942)

  • Decomposed compact_context so no &DbStore is held across .await points
  • Introduced compact_context_command as a Send-safe entry point for registry dispatch
  • Qdrant session-summary persistence dispatched via BackgroundSupervisor::spawn_summarization (no bare tokio::spawn)
  • CompactedWithPersistError now returns a user-visible message instead of silently reporting success

/mcp (#2943)

  • Blocker 1: RwLockWriteGuard in add_server/remove_server — fixed with plan/apply pattern (lock acquired, plan computed, lock released, I/O performed, lock re-acquired to apply)
  • Blocker 2: &[McpTool] in rebuild_semantic_index — cloned to Vec<McpTool> before .await
  • Blocker 3: McpToolRef<'_> in sync_mcp_registry — replaced with owned McpToolOwned
  • Introduced pending_semantic_rebuild flag for deferred index refresh (one-turn lag after add/remove, acceptable for MVP)

Test Results

  • 7919 tests pass (cargo nextest run --workspace --lib --bins)
  • cargo build --workspace clean
  • Clippy clean on all changed crates

Related

…ry migration

Register CompactCommand and McpCommand in the CommandHandler registry,
eliminating both commands from dispatch_slash_command.

/compact (#2942): decompose compact_context so no &DbStore is held across
.await points. Introduce compact_context_command as a Send-safe entry point.
Dispatch Qdrant session-summary persistence via
BackgroundSupervisor::spawn_summarization instead of bare tokio::spawn.
CompactedWithPersistError now surfaces a user-visible message rather than
silently reporting success.

/mcp (#2943): eliminate three !Send sources in McpManager —
RwLockWriteGuard in add_server/remove_server (plan/apply pattern),
&[McpTool] in rebuild_semantic_index (clone before await), McpToolRef<'_>
in sync_mcp_registry (replaced with owned McpToolOwned). Introduce
pending_semantic_rebuild flag for deferred index refresh.

Closes #2942, #2943
@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate bug Something isn't working size/XL Extra large PR (500+ lines) labels Apr 13, 2026
@bug-ops bug-ops enabled auto-merge (squash) April 13, 2026 13:15
@bug-ops bug-ops merged commit 7721a6d into main Apr 13, 2026
30 checks passed
@bug-ops bug-ops deleted the 2942-hrtb-compact-mcp-registry branch April 13, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(mcp): resolve HRTB blockers for /mcp CommandHandler migration fix(commands): resolve HRTB blocker for /compact CommandHandler migration

1 participant