[PR #761] [MERGED] fix(mcp): preserve exact guided prompt context #2220

Closed
opened 2026-10-16 21:15:53 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/761
Author: @rudycelekli
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @morluto

Base: main ← Head: fix/mcp-prompt-exact-context-20261006


📝 Commits (1)

  • 7b5ee67 fix(mcp): preserve exact guided prompt context

📊 Changes

2 files changed (+52 additions, -2 deletions)

View changed files

📝 src/server/registerPrompts.ts (+5 -1)
📝 tests/boundary/mcp/promptMcp.test.ts (+47 -1)

📄 Description

Problem

MCP guided prompt validation trims every argument before rendering requested context. A valid caller-selected filename ending in a space is changed to a different, nonexistent path. Captured crash signals also lose their original whitespace.

Change

Validate nonblank strings without transforming them. Required and optional arguments retain their exact input, while blank strings remain invalid. Tool inventory, prompt argument names, and completion behavior are unchanged.

Evidence and verification

  • Before: an actual SDK Client.getPrompt exchange changed an owned, existing trailing-space filename to a nonexistent trimmed path; the regression failed while seven existing controls passed.
  • After: eight MCP prompt tests pass, covering required and optional paths, verbatim crash signals, and whitespace-only rejection.
  • Required npm run check and focused tests pass again after rebasing onto current upstream 8238232.
  • The fixture session supports protocol testing; this does not claim Hopper, Ghidra, or IDA execution.

AI-assisted implementation, independently reviewed; signed commit with DCO.


🔄 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/761 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/mcp-prompt-exact-context-20261006` --- ### 📝 Commits (1) - [`7b5ee67`](https://github.com/morluto/rea/commit/7b5ee6760001315b8ae9f3fc2d0c786007b5a372) fix(mcp): preserve exact guided prompt context ### 📊 Changes **2 files changed** (+52 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/server/registerPrompts.ts` (+5 -1) 📝 `tests/boundary/mcp/promptMcp.test.ts` (+47 -1) </details> ### 📄 Description ## Problem MCP guided prompt validation trims every argument before rendering requested context. A valid caller-selected filename ending in a space is changed to a different, nonexistent path. Captured crash signals also lose their original whitespace. ## Change Validate nonblank strings without transforming them. Required and optional arguments retain their exact input, while blank strings remain invalid. Tool inventory, prompt argument names, and completion behavior are unchanged. ## Evidence and verification - Before: an actual SDK Client.getPrompt exchange changed an owned, existing trailing-space filename to a nonexistent trimmed path; the regression failed while seven existing controls passed. - After: eight MCP prompt tests pass, covering required and optional paths, verbatim crash signals, and whitespace-only rejection. - Required npm run check and focused tests pass again after rebasing onto current upstream 8238232. - The fixture session supports protocol testing; this does not claim Hopper, Ghidra, or IDA execution. AI-assisted implementation, independently reviewed; signed commit with DCO. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:15:53 +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#2220
No description provided.