fix(mcp): preserve thread command rejection reasons #15627
Mergedmaria-rcksmerged 3 commits into
main fromrefs/pull/15627/headmerged by maria-rcks View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
maria-rcks merged thisb38aa18
maria-rcks closed this
Sign in to join this conversation.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
20d9948a-ec5c-4a40-ac08-099e729c36fd📥 Commits
Reviewing files that changed from the base of the PR and between 17c0878941ab8ab19108fb639c5138d92a89e919 and fd7cc0da434dff8c26383b9304570ea9ed642e6e.
📒 Files selected for processing (4)
apps/server/src/mcp/OrchestratorMcpToolkit.integration.test.tsapps/server/src/mcp/threadAccess.tsapps/server/src/mcp/toolkits/core.test.tsapps/server/src/mcp/toolkits/thread/handlers.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
📝 Walkthrough
Walkthrough#
Thread command handlers now return eligible orchestrator rejection reasons in MCP failure messages. Tests cover cause filtering, message length, and failures when settling or editing and cancelling active work.
Changes#
MCP orchestration failure mapping
apps/server/src/mcp/threadAccess.ts,apps/server/src/mcp/toolkits/thread/handlers.ts,apps/server/src/mcp/toolkits/core.test.ts,apps/server/src/mcp/OrchestratorMcpToolkit.integration.test.tsdispatchFailureto expose non-empty string causes from dispatch and command-rejection errors, truncated to 1,000 Unicode code points. Other errors use the generic failure. Unit and integration tests cover failure messages and active-thread behavior.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
juliusmarmingeMerge Risk: ⚪ Minimal · up to
fd7ccThe thread tools preserve rejection reasons without a demonstrated private-detail disclosure. No actionable merge-blocking risk remains after normal checks.
Security Architecture Review#
Security architecture risk: 🟡 Moderate · up to
fd7ccRejection details improve usability, but the new filtering treats any nonempty string cause as safe to disclose. Existing access checks and redaction of object-based errors limit exposure; a concrete sensitive-string disclosure was not established by the inspected paths.
Retained concerns
Security review details
Security Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
#15586requires MCP thread command rejections to expose their user-facing reason while keeping unexpected internal errors generic.threadAccess.tsreturns nonempty string causes from `OrchestratorDi…#15586behavior. The inspected handler changes apply the mapping to thread command dispatch paths; the test changes verif…✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.