Skip to content

fix(mcp): preserve tool failure status and patch ExcelJS UUID - #619

Draft
HomenShum wants to merge 2 commits into
mainfrom
fix/mcp-error-status-20260908
Draft

fix(mcp): preserve tool failure status and patch ExcelJS UUID#619
HomenShum wants to merge 2 commits into
mainfrom
fix/mcp-error-status-20260908

Conversation

@HomenShum

Copy link
Copy Markdown
Owner

Summary

A coding agent can currently receive isError: false when a screenshot or image tool returns an explicit failure. The failure is hidden inside a successful content array, so status tracking also records success. This change returns the existing error object from those failure paths and uses the dispatcher's classified result for the MCP reply and execution records. Successful text and image blocks retain their order and bytes, including literal text that contains the word error.

The security audit now records raw tool calls before the early return, distinguishes authorization from execution outcome, and bounds buffered writes to 256 entries. Database statement/transaction failures stay inside the audit error boundary. Failed tool results no longer receive a success-only quick reference.

A separate commit scopes UUID11.1.1 to the ExcelJS development dependency. ExcelJS's actual CommonJS caller uses zero-argument v4() for workbook conditional-format IDs. The patched dependency preserves that contract and removes the two local moderate audit entries. This is not evidence that the advisory's affected buffer APIs were reachable through ExcelJS.

Two commits, nine existing files. Package version and declared Node support remain unchanged. This draft is awaiting independent final review; it is not a package release.

Validation

  • MCP package build (npm run build in packages/mcp-local).
  • Current ordinary MCP package suite (npm test): 390 passed, one skipped, eight files on Windows/Node22.22.2; unchanged test deadlines and worker configuration.
  • Nineteen new scenarios cover missing optional dependencies, capture failures, invalid frames, controlled provider failures, successful content preservation, image recovery and repeated audit failures/recovery.
  • Actual compiled stdio proof: 78 calls, 39 saved/returned PNGs, 70 expected records in each of three native databases, concurrent requests, recovery and restart. Eight deliberately failed persistence calls retain truthful replies but have no durable rows; they are not counted as successful persistence.
  • Fresh exact local package installation and full audit: zero findings. This package has no committed lock; the Windows resolution and original installation are retained as local evidence.
  • Workbook proof before and after UUID change: 24 exports and 120 rows per lane, six concurrent exports followed by 18 sequential exports, conditional-format IDs, ExcelJS reopen and actual compiled MCP table readback. Office-rendered visual quality was not tested.
  • Independent final source/dependency review: unavailable due delegated-agent account usage limit.
  • Whole application typecheck, Convex typecheck, root build and required shared checks: await this PR's actual results. Package checks do not certify the application.

The first ordinary package run had 389 passes, one XLSX timeout at 20 seconds and one skip. A selected observer passed; the current ordinary run after the dependency installation also passes. The timeout's cause remains unassigned. No claim is made that UUID repaired that timeout, and the failed run is retained.

The accepted image/protocol proof predates the UUID-only commit. Its eight source owners, 582 compiled files and seven selected native/protocol dependency files were verified unchanged; that successful proof was not replayed to change the dependency audit.

Release Notes

  • Raw capture/image failures become explicit MCP failures; existing successful content is preserved.
  • Security audit storage is bounded and contains write failures. Audit data can still be lost while storage is unavailable; this change does not provide durable retry.
  • ExcelJS development installs use patched UUID11.1.1. No npm version bump, publication, consumer adoption or full UI/provider readiness is included.
  • Required checks expected: Typecheck, Runtime smoke, Build, Tier B vs preview URL, plus the existing MCP Delta gate and repository style checks. Missing or skipped checks are not treated as passes.
  • The remote fix/ review branch follows this repository's enforced branch policy; it points to the exact commits retained locally on codex/mcp-error-status-20260908.

Return explicit error objects from eight raw tools and preserve successful content. Use one outcome for MCP status, analytics and audit metadata; omit success guidance on failures. Bound audit batches and contain failed writes.

Local candidate:19 new scenarios pass; normal suite389 pass/1 XLSX timeout/1 skip. Selected20-case timing diagnostic passes without changing the20s deadline; full-suite cause remains open. Final build and78-call native protocol/storage outage/recovery/restart proof pass.

Independent final review and release/consumer adoption remain pending. No published package or production deployment.
Keep ExcelJS4.4 while overriding its UUID dependency to11.1.1, the patched CommonJS-compatible release. Existing MCP runtime and other dependency versions are unchanged.

Verified frozen Windows install and full audit0,390 package tests with one skip, and24 before/24 after conditional-format workbook exports with120 rows read back in each lane. The prior20s XLSX timeout remains historical with unassigned cause; no deadline change.

Local candidate only: independent final review, shared checks and versioned package release/consumer proof remain pending.
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nodebench-ai Ready Ready Preview Sep 8, 2026 8:35am UTC

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants