Skip to content

Add structured user feedback for terminal, hosted sessions, and MCP#21

Merged
carldebilly merged 16 commits intomainfrom
feat/repl-user-feedback
Apr 19, 2026
Merged

Add structured user feedback for terminal, hosted sessions, and MCP#21
carldebilly merged 16 commits intomainfrom
feat/repl-user-feedback

Conversation

@carldebilly
Copy link
Copy Markdown
Member

@carldebilly carldebilly commented Apr 18, 2026

Summary

This PR reframes the branch from logging-oriented infrastructure to user-facing execution feedback.

It adds structured progress states across the interaction stack, enables advanced terminal progress reporting, exposes MCP-specific feedback primitives, and updates the hosted/MCP samples to demonstrate the new behavior end to end.

What changed

  • added structured progress states for user feedback:
    • Normal
    • Warning
    • Error
    • Indeterminate
    • Clear
  • added AdvancedProgressMode with Auto, Always, and Never
  • kept existing progress APIs backward-compatible
  • added automatic progress clearing when commands complete, fail, or are cancelled
  • added advanced terminal progress emission in the built-in console presenter
  • added MCP feedback support through IMcpFeedback
  • excluded MCP-only injectable services from generated tool/schema surfaces

Samples

Hosted sessions (05-hosting-remote)

  • added feedback demo and feedback fail
  • surfaced ProgressReporting in status and debug
  • enabled advanced progress in sample configuration
  • added a browser-side feedback mirror panel that parses OSC 9;4
  • advertised ProgressReporting for ANSI-capable browser transports
  • kept plain mode on text fallback only

MCP sample (08-mcp-server)

  • enriched import {file} to show:
    • normal progress
    • indeterminate progress
    • warning feedback
    • error/problem feedback on cancellation/failure paths
  • added deterministic feedback demo and feedback fail tools for MCP Inspector demos
  • documented what to expect from progress and message notifications

Documentation

Updated:

  • docs/interaction.md
  • docs/mcp-reference.md
  • docs/mcp-agent-capabilities.md

The docs now clarify:

  • user-facing feedback vs logging
  • progress states and helpers
  • advanced terminal progress behavior
  • MCP feedback mapping
  • when to use IReplInteractionChannel vs IMcpFeedback

Validation

dotnet build src/Repl.slnx -v minimal
dotnet test --solution src/Repl.slnx --no-build -v minimal

Result:

  • build succeeded
  • 845 tests passed

Notes

This PR intentionally focuses on user feedback during execution rather than helping applications surface logs to end users.


Open in Devin Review

…cess

Add two injectable interfaces following the IMcpClientRoots pattern so
command handlers can use MCP sampling (LLM completions) and elicitation
(structured user input) directly as workflow steps.

IMcpElicitation exposes typed methods (ElicitTextAsync, ElicitBooleanAsync,
ElicitChoiceAsync, ElicitNumberAsync) instead of raw MCP SDK types to keep
the public API dependency-agnostic. ElicitChoiceAsync returns the zero-based
index for safety against unexpected client responses.

Includes E2E tests (9 scenarios), updated sample 08, and documentation.
github-code-quality[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Member Author

Follow-up pushed in af38b8c to address the current CI/review feedback.

Included fixes:

  • use tolerance-based float comparisons in Given_McpUserFeedback
  • restore null-percent non-rewrite behavior in ConsoleReplInteractionPresenter
  • preserve warning/error styling on the non-rewrite progress path
  • fix markdownlint spacing in src/Repl.Mcp/README.md
  • apply the small Select(...) cleanup in the MCP sample parser

Validation run locally:

  • dotnet build src/Repl.slnx -v minimal
  • dotnet test --solution src/Repl.slnx --no-build -v minimal
  • dotnet test --project src/Repl.McpTests/Repl.McpTests.csproj -c Release -v minimal

github-code-quality[bot]

This comment was marked as resolved.

github-code-quality[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Member Author

Follow-up pushed in 9d22d5b to address the new actionable review feedback and the remaining MCP test instability.

Included fixes:

  • make Given_McpUserFeedback wait for the expected progress payloads instead of a raw event count
  • improve assertion diagnostics for unexpected progress payloads
  • replace the generic cleanup catch in TryClearProgressAsync with targeted exception handling
  • align McpElicitationService.ElicitChoiceAsync with the case-insensitive choice matching already used by McpInteractionChannel

Validation run locally:

  • dotnet build src/Repl.slnx -c Release --no-restore
  • dotnet test --project src/Repl.McpTests/Repl.McpTests.csproj -c Release --no-restore --filter "FullyQualifiedName~Given_McpUserFeedback.When_ToolEmitsStructuredProgress_Then_McpReceivesProgressAndMessages" --output Detailed
  • dotnet test --solution src/Repl.slnx -c Release --no-build --no-restore

Result:

  • build succeeded
  • 845 tests passed

Copy link
Copy Markdown
Member Author

Additional follow-up pushed in 578328c for the remaining macOS failure.

The MCP feedback test now captures raw notifications/progress messages directly instead of relying on the SDK convenience callback path. This keeps the test focused on protocol behavior while still requesting progress support through CallToolAsync(..., progress: ...).

Validation run locally:

  • dotnet build src/Repl.McpTests/Repl.McpTests.csproj -c Release --no-restore
  • dotnet test --project src/Repl.McpTests/Repl.McpTests.csproj -c Release --no-restore --filter "FullyQualifiedName~Given_McpUserFeedback.When_ToolEmitsStructuredProgress_Then_McpReceivesProgressAndMessages" --output Detailed
  • dotnet test --solution src/Repl.slnx -c Release --no-build --no-restore

Result:

  • targeted MCP test passed
  • 845 tests passed locally

devin-ai-integration[bot]

This comment was marked as resolved.

…ew allowlist

The Auto case in ConsoleReplInteractionPresenter now uses a conservative
allowlist (WT_SESSION, ConEmuANSI, WezTerm) and explicitly stays silent
under tmux/screen. Update the doc table to match, and add a note that
Always is safe on modern terminals because unknown OSC sequences are
typically ignored silently.
The sample grew to ~1300 lines across CSS and JS. Add visual section
banners to both and targeted "why" comments at non-obvious points:

- OSC 9;4 sequence format and state-code mapping (0..4)
- profilePresets (basic/styled/rich) with "custom" as fallback label
- vtinput/progress require ANSI (feature coupling)
- partial-chunk tail buffering in consumeTerminalChunk
- body.connected-session layout-compaction trick

No behavior change, pure editorial cleanup for comprehension.
@carldebilly carldebilly merged commit 318738e into main Apr 19, 2026
12 checks passed
@carldebilly carldebilly deleted the feat/repl-user-feedback branch April 19, 2026 03:31
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