Skip to content

feat(tui): show MCP tool calls as they run, with /lcs opt-out#12

Merged
Zorlin merged 1 commit into
mainfrom
riff/lcs-substrate-visibility
Jul 4, 2026
Merged

feat(tui): show MCP tool calls as they run, with /lcs opt-out#12
Zorlin merged 1 commit into
mainfrom
riff/lcs-substrate-visibility

Conversation

@Zorlin

@Zorlin Zorlin commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

MCP tool calls were batched into the interrupt queue during a streaming turn and only surfaced when it flushed (often at turn end) — the LCS substrate ran as invisible background work.

A — render immediately

on_mcp_tool_call_started/completed now flush the interrupt queue (preserving order) and handle the event at once, instead of deferring via defer_or_handle while stream_controller is active. The MCP handlers already flush the answer stream first, so inserting the cell mid-turn is coherent.

B — opt-out toggle

New show_lcs_substrate flag on ChatWidget (default true) gates McpToolCallCell creation in the started/completed handlers:

  • /lcs toggles
  • /lcs hidden → false
  • /lcs visible → true (mirrors /raw)

Proven

/lcs toggles and accepts hidden|visible; invalid arg reports usage. 178 slash + 13 bottom_pane tests green, codex-tui builds clean. Worth an interactive eyeball before merge — it's a visibility-behavior change.

🤖 Generated with Claude Code

MCP tool calls were batched into the interrupt queue during a streaming
turn and only surfaced when it flushed (often at turn end), so the LCS
substrate ran as invisible background work. Two changes:

A. Render immediately. on_mcp_tool_call_started/completed now flush the
   interrupt queue (preserving order) and handle the event at once instead
   of deferring it via defer_or_handle while stream_controller is active.
   The MCP handlers already flush the answer stream first, so inserting the
   cell mid-turn is coherent.

B. Opt-out toggle. New show_lcs_substrate flag on ChatWidget (default true)
   gates McpToolCallCell creation in the started/completed handlers. /lcs
   toggles, /lcs hidden sets false, /lcs visible sets true (mirrors /raw).

Tests: /lcs toggles and accepts hidden|visible; invalid arg reports usage.
178 slash + 13 bottom_pane tests green.

Co-Authored-By: Claude <noreply@anthropic.com>
@Zorlin Zorlin merged commit 1fede57 into main Jul 4, 2026
6 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant