Repository navigation
feat(mcp): streaming execution progress and recent failures resource - #523
Merged
Merged
Conversation
Execution tools now stream output line-by-line as MCP progress notifications when the client sends a progress token. Clients that support progress notifications see real-time output during long-running builds and tests; clients without a token get the existing batch behavior. A new flow://failures/recent static resource returns the last few failed runs with tailed error output as JSON, so a new session can bootstrap from where a previous one left off. Changes: - Add ExecuteStreaming to CommandExecutor for piped line-by-line output - Add executeWithStreaming helper that falls back to ExecuteContext when no progress token is present - Wire streaming into execute, run_command, and run_executable handlers - Register flow://failures/recent resource backed by flow logs CLI - Update server instructions and docs site
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
execute,run_command,run_executable) now stream output line-by-line as MCP progress notifications when the client sends a progress token — real-time feedback during long builds and tests, with transparent fallback to batch output when no token is present.flow://failures/recentstatic resource returns the last few failed runs with tailed error output as JSON, so a new session can pick up where a previous one left off without manual log hunting.What changed
Streaming progress —
ExecuteStreamingadded toCommandExecutorinterface. Usesio.Pipe()to merge stdout/stderr into a single stream,bufio.Scannerfor line-by-line reading, and anatomic.Int64line counter for progress values. TheexecuteWithStreaminghelper checks for a progress token and falls back toExecuteContextwhen none is present — zero behavior change for clients that don't send one.Failures resource —
flow://failures/recentshells out toflow logs --status failed --content --tail 30 --max-bytes 10000 --output json, takes the last 5 entries, and returns them as JSON. Useful for session bootstrapping.Docs — server instructions and docs site updated. Resources table gains the failures entry; Observability section documents streaming and session bootstrapping.
Test plan
internal/mcp/...flow://failures/recent— verify it returns the last 5 with tailed output