feat(mcp): elicitation during tool execution (phase 2)#2545
Merged
Conversation
7937e64 to
5282718
Compare
- Fix deadlock: drain elicitation_rx concurrently with tool tier futures via tokio::select! loop in execute_native_tool_calls - TUI: ElicitationDialogState widget with field navigation and render - TUI: TuiChannel::elicit() via AgentEvent::ElicitationRequest oneshot - Telegram: TelegramChannel::elicit() with sequential prompts, 120s timeout - Security: sanitize all MCP-provided strings (ANSI, control chars) - ELICITATION_TIMEOUT constant in zeph-channels
- Add 4 unit tests for TelegramChannel::elicit(): - happy path string field → Accepted with correct key/value - /cancel command → Cancelled - timeout logic (rx-level isolation, matching confirm pattern) - sanitize_field_key strips dashes, spaces, special chars - Fix sanitize_field_key test: function only strips non-alphanumeric/ underscore chars, not ANSI sequences — corrected test assertion - Update coverage-status.md: add row for MCP elicitation phase 2 (status: Untested) in the zeph-mcp section
5282718 to
b9b99ef
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
tokio::select!inexecute_native_tool_calls; previously MCP servers sending elicitation mid-tool-call would deadlockElicitationDialogState+widgets::elicitation) with keyboard navigation (Tab/Shift+Tab/Space/Up/Down/Enter/Esc); overrides vi-mode while active/cancelsupport, andsanitize_field_key()applied to all JSON response keysIssues
Fixes #2522
Tracked: #2542 (elicitation deadlock in run_inline_tool_loop — phase 3)
Test plan
cargo nextest run --workspace --features full --lib --bins— 7665/7665 PASScargo clippy --features full --workspace -- -D warnings— PASScargo +nightly fmt --check— PASS