[PR #3460] [MERGED] fix(mcp): keep analyze_function progress strictly increasing #5751

Closed
opened 2026-10-31 01:09:10 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3460
Author: @peter-research
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @morluto

Base: main ← Head: fix/mcp-analyze-function-progress


📝 Commits (1)

  • add47cd fix(mcp): keep analyze_function progress strictly increasing

📊 Changes

2 files changed (+49 additions, -4 deletions)

View changed files

📝 src/server/registerEnhancedTools.ts (+6 -2)
📝 tests/boundary/mcp/progressMcp.test.ts (+43 -2)

📄 Description

Summary

An analyze_function request with a progress token emitted progress: 1 for both its start and its completion notification.

Fixes #3335

Problem and expected behavior

executeEnhancedTool creates one MCP progress reporter and reports started, then hands analyze_function to executeFunctionTool, which created a second reporter. Each reporter numbers notifications from 1, so the terminal notification repeated the initial number. docs/mcp-contracts.md promises strictly increasing numbers for ordinary tool requests.

Change and scope

executeFunctionTool now receives the request's existing reporter instead of creating its own, so started, any provider updates and the terminal update share one sequence. No other tool path changes.

Contribution scope: not applicable (ordinary fix within existing boundaries).

Contract and boundary impact

  • Semantic owner and earliest changed stage: MCP progress; reporter creation in registerEnhancedTools
  • Contribution scope fit and linked maintainer decision: not applicable
  • CLI and MCP/tool-catalog contract: no schema or catalog change
  • Provider, bridge, target-format, or platform compatibility: unknown beyond the cases covered by the tests below
  • Evidence, artifact, provenance, or reconstruction contract: none
  • Generated metadata, package, or installation impact: none

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

Source-derived by the AI assistant from reading the code. The human owner reports reviewing the code and verifying the proof-of-concept reproductions, with no failures.

  • Tests added or updated: tests/boundary/mcp/progressMcp.test.ts adds an analyze_function case asserting strictly increasing progress (owner reports no failures).
  • Base reproduction or other evidence: the reproduction in #3335 (not re-run for this PR)
  • User-visible CLI/MCP output (if applicable): not captured
  • Remaining proof gaps: Exact test commands and outputs are not recorded; the new test's provider fixture follows the reproduction in the issue.

Validation performed

The human owner reports having reviewed the code and PRs and verified the proof-of-concept reproductions, with no failures. The exact commands and outputs were not recorded here.

Compatibility, safety, and release

  • Breaking changes or migration steps: none expected
  • Real Hopper/Ghidra, browser, or OS coverage: none
  • Package or release metadata impact: none
  • Security, privacy, process, or containment review: not applicable

Prepared with AI assistance (Claude). The author readiness declarations below were dictated by the human owner.

Author readiness

Human owner: @peter-research

  • 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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/3460 **Author:** [@peter-research](https://github.com/peter-research) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/mcp-analyze-function-progress` --- ### 📝 Commits (1) - [`add47cd`](https://github.com/morluto/rea/commit/add47cdf06edee15ff566b522abc8941593920e1) fix(mcp): keep analyze_function progress strictly increasing ### 📊 Changes **2 files changed** (+49 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/server/registerEnhancedTools.ts` (+6 -2) 📝 `tests/boundary/mcp/progressMcp.test.ts` (+43 -2) </details> ### 📄 Description ## Summary An `analyze_function` request with a progress token emitted `progress: 1` for both its start and its completion notification. Fixes #3335 ## Problem and expected behavior `executeEnhancedTool` creates one MCP progress reporter and reports `started`, then hands `analyze_function` to `executeFunctionTool`, which created a second reporter. Each reporter numbers notifications from 1, so the terminal notification repeated the initial number. `docs/mcp-contracts.md` promises strictly increasing numbers for ordinary tool requests. ## Change and scope `executeFunctionTool` now receives the request's existing reporter instead of creating its own, so `started`, any provider updates and the terminal update share one sequence. No other tool path changes. Contribution scope: not applicable (ordinary fix within existing boundaries). ## Contract and boundary impact - Semantic owner and earliest changed stage: MCP progress; reporter creation in `registerEnhancedTools` - Contribution scope fit and linked maintainer decision: not applicable - CLI and MCP/tool-catalog contract: no schema or catalog change - Provider, bridge, target-format, or platform compatibility: unknown beyond the cases covered by the tests below - Evidence, artifact, provenance, or reconstruction contract: none - Generated metadata, package, or installation impact: none Expected effects: - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage Source-derived by the AI assistant from reading the code. The human owner reports reviewing the code and verifying the proof-of-concept reproductions, with no failures. - Tests added or updated: `tests/boundary/mcp/progressMcp.test.ts` adds an `analyze_function` case asserting strictly increasing progress (owner reports no failures). - Base reproduction or other evidence: the reproduction in #3335 (not re-run for this PR) - User-visible CLI/MCP output (if applicable): not captured - Remaining proof gaps: Exact test commands and outputs are not recorded; the new test's provider fixture follows the reproduction in the issue. ## Validation performed The human owner reports having reviewed the code and PRs and verified the proof-of-concept reproductions, with no failures. The exact commands and outputs were not recorded here. ## Compatibility, safety, and release - Breaking changes or migration steps: none expected - Real Hopper/Ghidra, browser, or OS coverage: none - Package or release metadata impact: none - Security, privacy, process, or containment review: not applicable Prepared with AI assistance (Claude). The author readiness declarations below were dictated by the human owner. ## Author readiness Human owner: @peter-research - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:09:10 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5751
No description provided.