Skip to content

fix(channels): forward elicit() and send_context_estimate() on AppChannel#6400

Merged
bug-ops merged 1 commit into
mainfrom
fix/6388-mcp-elicitation-auto-decline
Jul 17, 2026
Merged

fix(channels): forward elicit() and send_context_estimate() on AppChannel#6400
bug-ops merged 1 commit into
mainfrom
fix/6388-mcp-elicitation-auto-decline

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • impl Channel for AppChannel (src/channel.rs) forwarded most Channel trait methods via dispatch_app_channel! but never overrode elicit() or send_context_estimate(), so both calls silently fell through to the trait's default methods instead of reaching CliChannel/TuiChannel's real, already-unit-tested implementations.
  • elicit()'s default unconditionally returns Declined, so every MCP server-driven elicitation request was auto-declined in both CLI and TUI modes regardless of [mcp] elicitation_enabled. send_context_estimate()'s default silently no-ops, so the TUI's real-time context-usage estimate never reached the input block title.
  • Added both missing overrides, following the existing dispatch_app_channel! pattern used by the other forwarded methods.
  • Live-verified against a real stdio MCP fixture server: the [MCP server '...' is requesting input] banner and the real per-field prompt now fire, where previously the request was auto-declined in under 1ms with no visible indication.

Note: this fix makes elicitation prompts reachable again, but a separate, pre-existing bug (#6398, filed during this fix's live verification) means the CLI accept path can race against the background chat-input reader for stdin and time out client-side — that is a distinct root cause, not caused by this change, and is tracked separately.

Closes #6388

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 14007 passed, 0 failed, 35 skipped
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --locked
  • cargo test --doc --workspace --features "desktop,ide,server,chat,pdf,scheduler"
  • gitleaks protect --staged --no-banner --redact — no leaks
  • New regression tests added for both overrides (app_channel_forwards_elicit_to_real_implementation, app_channel_forwards_send_context_estimate_to_real_implementation), each independently revert-verified to fail (not pass vacuously) when its override is removed
  • Live e2e verification via tmux against a real stdio MCP fixture server confirms the CLI elicitation prompt now fires

@github-actions github-actions Bot added documentation Improvements or additions to documentation bug Something isn't working size/M Medium PR (51-200 lines) labels Jul 17, 2026
…nnel

impl Channel for AppChannel forwarded 18 Channel trait methods via
dispatch_app_channel! but never overrode elicit() or
send_context_estimate(), so both calls fell through to the trait's
default methods instead of reaching CliChannel/TuiChannel's real,
unit-tested implementations. elicit()'s default unconditionally
returns Declined, so every MCP server-driven elicitation request was
silently auto-declined in both CLI and TUI modes regardless of
[mcp] elicitation_enabled. send_context_estimate()'s default silently
no-ops, so the TUI's real-time context-usage estimate never reached
the input block title.

Add both missing overrides, following the existing
dispatch_app_channel! pattern used by the other forwarded methods.

Closes #6388
@bug-ops
bug-ops enabled auto-merge (squash) July 17, 2026 15:52
@bug-ops
bug-ops force-pushed the fix/6388-mcp-elicitation-auto-decline branch from be2abfd to 8628d4c Compare July 17, 2026 15:52
@bug-ops
bug-ops merged commit cd1613c into main Jul 17, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/6388-mcp-elicitation-auto-decline branch July 17, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP server-driven elicitation always auto-declines — AppChannel never forwards elicit()

1 participant