Skip to content

fix(mcp): preserve workflow completion progress through delivery - #11703

Closed
g1at wants to merge 1 commit into
morluto:mainfrom
g1at:g1at/fix-mcp-capture-progress
Closed

g1at wants to merge 1 commit into
morluto:mainfrom
g1at:g1at/fix-mcp-capture-progress

Conversation

@g1at

@g1at g1at commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Refs #11693. Preserve the process-capture workflow's final timeout/cancellation and cleanup progress instead of appending a generic capture_process_scenario: completed message. The capture Evidence already keeps the correct exit reason; this fixes the final notification clients display.

Change and scope

  • Give each server operation one progress-completion owner. Only the complete process-capture binding declares workflow-owned completion; an ordinary provider's child terminal observation does not finish its parent request.
  • Preserve the workflow's final details on successful delivery. If delivery fails afterward, report failure while retaining those cleanup details. Dry runs and refusals without a producer terminal receive the normal fallback.
  • Finish ordinary provider operations after source recording, Evidence admission, projection, and delivery, so those later failures cannot leave a successful final notification.

The shared reporter still permits child completion followed by further parent progress. This is an existing-behavior repair: no public tool, schema, target execution, mutation authority, or package metadata is added. A separate maintainer scope decision is not applicable.

Evidence and regression coverage

The existing public MCP test fails on the base with:
expected 'capture_process_scenario: completed' to contain 'disposition=timeout'.

The repaired MCP tests retain final cleanup details for successful, timed-out, and cancelled controlled process captures. Additional coverage checks workflow-owned details followed by failure, fallback without a producer terminal, child completion followed by parent work, and response-budget failure after successful analysis through both provider and workflow handlers.

Validation performed

Linux/WSL, Node 24.22.1, npm 11.16.0, locked dependencies:

  • Required artifacts build — passed.
  • vitest run src/server/operationProgress.test.ts src/server/mcpProgress.test.ts tests/boundary/mcp/progressMcp.test.ts --maxWorkers=1 — 3 files, 13 tests passed.
  • vitest run --project process-boundary tests/boundary/process/processCaptureProgress.test.ts -t 'forwards live capture progress only when the MCP client supplies a token|reports timeout and cancellation cleanup through MCP progress' --maxWorkers=1 — 2 tests passed; 5 CLI cases excluded by this explicit selector.
  • npm run check:fast — typecheck, lint, module/numeric-limit checks, and architecture guards passed.
  • Changed-file formatting, git diff --check, and npm run verify:test-discovery — passed; all 3725 test/spec files discovered exactly once.

Validation limits

The full process-progress file was attempted: its 5 compiled-CLI cases fail because command stdout is empty. The same small capture scenario and missing-scenario CLI command reproduce empty stdout on the unchanged ab16163 production code in the separate cleanup-test worktree; version/help work in both trees. The cause of that independent CLI issue remains unconfirmed.

Verification uses real MCP transport with controlled Node children and recording providers. Real reverse-engineering engines, native Windows/macOS, and the full repository suite were not run. No performance improvement is claimed.

Author readiness

Human owner: @g1at

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; no blocking issue was found.

Summary

Preserves process-capture cleanup details instead of replacing them with a generic completion message.

  • Process-capture progress keeps its final cleanup details through delivery.
  • Provider operations finish progress after their response is ready.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Run admitted operation] --> B[Prepare response]
  B --> C{Workflow owns completion?}
  C -->|No| D[Report completed or failed]
  C -->|Yes| E{Final workflow update exists?}
  E -->|No| D
  E -->|Yes| F{Response failed?}
  F -->|No| G[Keep workflow cleanup details]
  F -->|Yes| H[Report failure with cleanup details]
  D --> I[Return response]
  G --> I
  H --> I
Loading

Reviews (2) · Last reviewed commit: "fix(mcp): preserve workflow completion p..." · Reviewed by Greptile

@g1at
g1at marked this pull request as ready for review November 16, 2026 07:17
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T07:17:50.196419Z
We couldn’t complete this review. Comment @codex review to try again.
50fb5ef Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@morluto

morluto commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Thank you! Closing as already landed on main via #11727 (552d1c7108, fix(mcp): preserve workflow completion progress through delivery).

@morluto morluto closed this Nov 17, 2026
@morluto morluto added area: mcp MCP server, transport, and tool registration bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants