Repository navigation
fix(dashboards): surface missing required launch input instead of "Unexpected server error" - #4385
Conversation
…expected server error"
A dashboard tile whose saved launch input omits an argument the MCP tool
requires (for example the Atlassian remote MCP's cloudId) failed on every
launch with the generic "Unexpected server error" and a "Refresh failed"
badge, identically across org-account and individual-account connections.
Three hops hid the cause:
- apps/server: callMcpAppTool let the SDK McpError escape untyped, so the
route handler answered 500 internal_error. Rejections are now rethrown as
McpAppHostError("tool_call_failed", message) and mapped to 422 with the
provider's message.
- den-api: MCP_INVALID_PARAMS / MCP_PROVIDER_INVALID_PARAMS produced the
phase-generic "requested provider operation failed" text. They now relay
the already-captured, sanitized provider message using the existing
"Provider-declared message (untrusted)" convention.
- den-api + den-web: GET /v1/mcp-connections/:id/mcp-apps exposed only a
requiresInput boolean, so the add-app dialog could not tell authors which
keys a tool needs. It now returns requiredInputKeys; the dialog shows
them, pre-fills the placeholder, and refuses Add when a key is missing.
The pasted JSON (including escaped quotes in a JQL string) was already
forwarded byte-identically; that was ruled out and is asserted.
Specs (local lane; both embed a loopback witness MCP shaped like the
Atlassian remote MCP and skip loudly on Daytona / attached Den):
- evals/specs/dashboard-atlassian-launch-input.test.ts (PR lane) drives the
real Den connection proxy with the real Desktop App-host code.
- evals/specs/dashboard-atlassian-tile-error.e2e.test.ts asserts the real
Electron tile names the missing argument and never shows the generic 500.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
Test evidence — a-dashboard-tile-launched-with-the-reported-atlassian-json-names-the-missing-req — ✅ passed✅ passed · 2 expectations passed · 0 failed · 0 pending [world] den(local) · [seed] api GET /v1/me/orgs · orgConnection("Atlassian (One org account)") · [seed] api GET /v1/mcp-connections/emc_01m1nf8ejqe2zsj880ab123rby/mcp-apps · [seed] api POST /v1/dashboards · [seed] api POST /v1/dashboards/dsb_01m1nf8ennekaby67xgy5y6j45/access · [seed] api POST /v1/mcp/token · desktop(as admin) · workspace(/tmp/openwork-dashboard-launch-input-1788500804998) ℹ️ ASSERTION — 1. The dashboard tile names the missing required argument instead of a generic server errorAfter Run, both tiles show the "Refresh failed" badge with the provider's rejection naming cloudId and never "Unexpected server error" (confluence={"text":"Confluence page openwork-app-host-connect-be29a4049b7c Refresh failed MCP error -32603: The provider rejected the tool arguments. Provider-declared message (untrusted): "Invalid arguments for tool getConfluencePage: [{"code":"invalid_type","expected":"string","received":"undefined","path":["cloudId"],"message":"Required"}]".","badgeFailed":true,"opaque":false,"namesCloudId":true}, jql={"text":"Jira queue openwork-app-host-connect-be29a4049b7c Refresh failed MCP error -32603: The provider rejected the tool arguments. Provider-declared message (untrusted): "Invalid arguments for tool searchJiraIssuesUsingJql: [{"code":"invalid_type","expected":"string","received":"undefined","path":["cloudId"],"message":"Required"}]".","badgeFailed":true,"opaque":false,"namesCloudId":true}).
ℹ️ ASSERTION — 2. The pasted launch JSON reached the provider intactThe witness received getConfluencePage {"pageId":"1122334455"} and searchJiraIssuesUsingJql with the exact single-escaped JQL string; the provider rejected both for the missing required cloudId with JSON-RPC -32602.
Test run created 2026-09-04T05:45:57.360Z · Source: |
Test evidence — dashboard-tiles-forward-pasted-atlassian-launch-json-intact-and-surface-the-prov — ✅ passed✅ passed · 5 expectations passed · 0 failed · 0 pending
verdict passed · 0 user observations · 0 probes · steps 0/0 ℹ️ ASSERTION — 1. The dashboard add-app catalog names the required launch-input keysGET /v1/mcp-connections/:id/mcp-apps lists getConfluencePage with requiredInputKeys=["cloudId","pageId"] and searchJiraIssuesUsingJql with requiredInputKeys=["cloudId","jql"], so the add-app dialog can show them and refuse a pasted payload that omits cloudId.
ℹ️ ASSERTION — 2. Pasted launch JSON round-trips through Den storage byte-identicallyThe JQL string with escaped quotes stored on the dashboard element and returned by /v1/me/dashboards strictly equals the pasted value ("project = HELPDESK AND status NOT IN ("Closed", "Resolved", "Duplicate", "Declined", "Spam") AND assignee = c…) — escaping is not the failure.
ℹ️ ASSERTION — 3. An unconnected individual-accounts connection is the needs_signin surfaceGET /v1/mcp-connections/:id/mcp-apps answered 409 "Connect your account before using this MCP's tools." and the Desktop app-host server index omits connection emc_01m1nf7fqxeb79rccx93egj7sx while listing emc_01m1nf7fp0e07sa3d06w93fbxe; a tile granted over it can only fail with "The originating Connect MCP server is not available to this workspace."
ℹ️ ASSERTION — 4. A launch missing a required argument surfaces the provider's rejection naming that argumentcallMcpAppTool threw McpAppHostError(tool_call_failed) for both tools with messages ["MCP error -32603: The provider rejected the tool arguments. Provider-declared message (untrusted): "Invalid arguments for tool getConfluencePage: [{"code":"invalid_type","expected":"string","received":"undefined","path":["cloudId"],"message":"Required"}]".","MCP error -32603: The provider rejected the tool arguments. Provider-declared message (untrusted): "Invalid arguments for tool searchJiraIssuesUsingJql: [{"code":"invalid_type","expected":"string","received":"undefined","path":["cloudId"],"message":"Required"}]"."]; /workspace/:id/mcp-apps/call maps this to 422 tool_call_failed so the dashboard tile shows the provider's own text naming cloudId, never the generic "Unexpected server error". The witness received the pasted arguments byte-identically (jql intact, no cloudId), so the only failure is the missing required argument.
ℹ️ ASSERTION — 5. The same launch succeeds once cloudId is suppliedcallMcpAppTool with { cloudId, jql } returned a non-error result through the same Den proxy and Desktop App-host pipeline, isolating the root cause to the missing required argument that the add-app dialog neither surfaced nor validated.
Test run created 2026-09-04T05:45:29.174Z · Source: |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (64aa2aed3bdac317b23655857290b52feceeecf3). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
…orld layer The eval-runner unit gate rejected the new E2E spec on two rules that landed on dev alongside this branch: specs-use-testkit-only (no direct @openwork/behaviors imports from *.e2e.test.ts) and the channel ratchet (zero raw probe.eval escapes in new-layer specs). - evals/worlds/dashboard-launch-input.ts: the Atlassian-shaped witness, Den seeding (connection, dashboard, grant, MCP tokens), signed-in Desktop with Connect reconciled, and typed DOM accessors (openDashboard, tilesReady, tiles) now live in a world. - dashboard-atlassian-tile-error.e2e.test.ts drives only user/probe/evidence channels through spec.world(atlassianDashboardTiles). - dashboard-atlassian-launch-input.test.ts reuses the shared witness and payload constants instead of duplicating them. Behavior under test is unchanged; both specs re-ran green locally along with `pnpm --dir evals run test` (layering lint + channel ratchet).
…age via user.see
Addresses the two Warden findings on this branch:
- diff-security-review (blocking): the tool_call_failed message copied the
provider's error text verbatim to viewer-scoped callers of
/workspace/:id/mcp-apps/call. Providers already return arbitrary tool
results to the same callers, so this is not a new disclosure class, but
the text is untrusted: strip control characters and cap it at 512 chars
(the same bound Den applies to provider-declared excerpts). The host test
now models a hostile provider (control char + 2 KB tail) and asserts the
relayed message keeps the argument path while dropping both.
- spec-provenance-review (advisory): the E2E claim is now witnessed on the
visible surface with user.see("rejected the tool arguments" / "cloudId" /
"Refresh failed") and user.notSee("Unexpected server error"); the
world.tiles() facts remain to prove both tiles carry the message.
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (174208abcbdee9c343909f42a413aff4c1ee6c6f). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
…lder dev now renders the required input keys in the picker placeholder (#4385).
Problem
A Dashboard tile whose saved launch input omits an argument the MCP tool requires (e.g. the Atlassian remote MCP's
cloudIdforgetConfluencePage/searchJiraIssuesUsingJql) fails on every launch with the generic "Unexpected server error" and a "Refresh failed" badge — identically for org-account and individual-account connections, because the rejection happens before credential mode matters.Three hops hid the real cause:
apps/server/src/mcp-app-host.ts):callMcpAppToollet the SDKMcpErrorescape untyped, sorethrowMcpAppHostErrordidn't map it and the route answered HTTP 500internal_error.ee/apps/den-api/.../external-mcp-diagnostics.ts):MCP_INVALID_PARAMS/MCP_PROVIDER_INVALID_PARAMSproduced the phase-generic "requested provider operation failed" text even though the provider's rejection naming the argument was already captured asproviderErrorMessage.ee/apps/den-api/.../mcp-connections.ts,ee/apps/den-web/.../org-dashboard-detail-screen.tsx):GET /v1/mcp-connections/:id/mcp-appsexposed only arequiresInputboolean, so the add-app dialog could neither show which keys a tool needs nor validate the pasted JSON.Ruled out (and now asserted): JSON double-escaping. A JQL string with escaped quotes round-trips Den storage and reaches the provider byte-identically.
Fix (smallest diff per layer)
client.callToolrejections asMcpAppHostError("tool_call_failed", message)→ 422 with the provider's message on the tile. The message is bounded (providerErrorExcerpt: control chars stripped, 512-char cap — the same bound Den applies to provider excerpts) because it is provider-controlled text reaching viewer-scoped callers.The provider rejected the tool arguments. Provider-declared message (untrusted): "…"— reusing the existing sanitizedproviderErrorMessage(control chars stripped, 512-char cap) and the existing "(untrusted)" convention already used forMCP_PROVIDER_DECLARED_ERROR. No new provider data is captured.mcpToolRequiredInputKeys();/mcp-appsreturnsrequiredInputKeys: string[](OpenAPI schema updated). The add-app dialog shows the required keys, pre-fills the placeholder, and refuses Add withLaunch input is missing required key: cloudId.Older Den →[], so behavior degrades to today's.Not done deliberately: server-side
launchArgumentsvalidation inPOST/PATCH /v1/dashboards(would require Den to fetch the provider schema on every save; the dialog is where the JSON is pasted).After the fix, the tile reads (asserted on the real Electron tile):
MCP error -32603: The provider rejected the tool arguments. Provider-declared message (untrusted): "Invalid arguments for tool getConfluencePage: [{…"path":["cloudId"],"message":"Required"}]".Verification
Lane: local (cold-boot
server(), MySQL 3306 + Redis 6379). Daytona credentials are available, but both specs embed an inline loopback witness MCP (shaped like the Atlassian remote MCP: same tool names,cloudIdrequired, MCP-Appui://bindings) that a remote Den cannot reach — the same local-placement constraintremote-mcp-apps.e2e.test.tsdeclares. Both specs skip loudly underOPENWORK_EVAL_DAYTONA=1/OPENWORK_EVAL_DEN_API_URL.evals/specs/dashboard-atlassian-launch-input.test.ts— real Den connection proxy + real Desktop App-host code; assertsrequiredInputKeys, byte-identicallaunchArgumentsround-trip, typedtool_call_failednamingcloudId, per-member needs_signin surface (409 + absent from app-host index), and the control launch succeeding oncecloudIdis suppliedpnpm --dir evals run test:pr specs/dashboard-atlassian-launch-input.test.tsevals/specs/dashboard-atlassian-tile-error.e2e.test.ts—spec.world(atlassianDashboardTiles)(evals/worlds/dashboard-launch-input.ts); real Electron;user.clickRun on both tiles;user.seethe provider's rejection namingcloudId+ "Refresh failed",user.notSee"Unexpected server error";world.tiles()proves both tiles carry it; witness received the pasted args intactpnpm evals:e2e dashboard-atlassian-tile-errorpassedapps/server/src/mcp-app-host.test.ts(+1: hostile-provider rejection → typed, bounded host error)bun --conditions=development test src/mcp-app-host.test.tsspecs-use-testkit-only, channel ratchet, runner tests)pnpm --dir evals run testee/apps/den-api/test/external-mcp-diagnostics.test.ts(extended: message carries provider text)bun test test/external-mcp-diagnostics.test.tsee/apps/den-api/test/mcp-connection-apps.test.ts(+1:mcpToolRequiredInputKeys)bun test test/mcp-connection-apps.test.tsee/apps/den-web/tests/dashboard-mcp-app-catalog.test.ts(+1:missingRequiredInputKeys)bun test --conditions development tests/dashboard-mcp-app-catalog.test.tstsc --noEmitreports no errors in any touched file inapps/server,ee/apps/den-api, oree/apps/den-web. Pre-existing, unrelated:external-mcp-diagnostics.test.ts › uses one absolute deadline…fails only when co-scheduled in one bun process withmcp-connection-action-app.test.ts; reproduces on pristineorigin/devfiles and passes in isolation.Test evidence for both specs is published below (runs bound to the head SHA
174208abc). Warden findings on1a40e49a8(bounded provider text;user.seewitnesses) were addressed in174208abcwith inline replies.Follow-up worth a separate ticket: the test-evidence publisher keeps one sticky comment per PR, so the PR-lane run is posted as a second labelled comment.
Verdict: Passed.