DRAFT: MCP progress notifications for long pkg actions (needs upstream MCP.jl release)#16
Draft
samtalki wants to merge 1 commit into
Draft
DRAFT: MCP progress notifications for long pkg actions (needs upstream MCP.jl release)#16samtalki wants to merge 1 commit into
samtalki wants to merge 1 commit into
Conversation
aaa2722 to
bc232f3
Compare
c240f14 to
7e35d78
Compare
Long pkg actions (add, update, instantiate, test, ...) ran as a single blocking call with no feedback until they finished. This wires them to the progress support added on the ModelContextProtocol.jl fork. - _run_with_heartbeat runs the worker eval on a child task and, every couple of seconds while it runs, tees a status line through _tee_status! (server stderr + the session recent_output ring + the live log viewer) and calls a progress callback. The eval runs on the child task and the heartbeat on the calling task, so only one task ever writes the transport, and the heartbeat stops before the handler returns its response. - run_pkg_action_on_worker takes an optional progress_cb; without it the action runs blocking exactly as before. - The pkg tool handler now takes (params, ctx) and passes a callback that calls ModelContextProtocol.send_progress. It is a no-op when the client sent no progressToken, so behavior is unchanged for clients that do not ask for progress (Claude Code does not render progress notifications yet). DRAFT: depends on send_progress / RequestContext-passing handlers, which are not yet in a released ModelContextProtocol.jl. Project.toml [sources] pins the fork branch; drop the pin and bump [compat] once upstream releases. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7e35d78 to
8928da9
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.
Wires long
pkgactions to MCPnotifications/progress, using the progress support added on the ModelContextProtocol.jl fork (samtalki/ModelContextProtocol.jl#feat/progress-notifications).What changed
_run_with_heartbeat(worker.jl) runs the worker eval on a child task and, every couple of seconds while it runs, tees a status line through_tee_status!(server stderr + the sessionrecent_outputring + the live log viewer) and calls a progress callback. The eval runs on the child task and the heartbeat on the calling task, so only one task ever writes the transport, and the heartbeat stops before the handler returns.run_pkg_action_on_workertakes an optionalprogress_cb; without it the action runs as a single blocking call, exactly as before.pkgtool handler now takes(params, ctx)and passes a callback that callsModelContextProtocol.send_progress. It is a no-op when the client sent noprogressToken, so behavior is unchanged for clients that do not ask for progress.Status
recent_output/ log-viewer tee added there for the visible-today progress path).[sources]pins the fork branch. This is the spec-correct MCP path; Claude Code does not rendernotifications/progressyet, so the visible signal today is still the log viewer /session/logresource (Clean eval errors, MCP prompts, visible worker output #15).[sources]pin and bump[compat]once the fork's progress support lands in a released ModelContextProtocol.jl.Tests
test/test_competitive_features.jladds a heartbeat testset: it asserts the heartbeat fires and tees to the ring, and drives_run_with_heartbeatthrough a realRequestContextwith a buffer-backedStdioTransport, asserting a realnotifications/progresscarrying the progress token reaches the wire. Full suite green (346 tests).🤖 Generated with Claude Code