Fix MCP session-mode negotiation logged at error level, recurring false error signal - #18
Open
polylane[bot] wants to merge 1 commit into
Open
Fix MCP session-mode negotiation logged at error level, recurring false error signal#18polylane[bot] wants to merge 1 commit into
polylane[bot] wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: MCP session-mode negotiation logged at error level, recurring false error signal
The executor's MCP session-mode negotiation snapshot is logged through console.error even though it is informational state — client capabilities, elicitation mode, and the resume flag recorded at the end of a successful session negotiation. This has made monitoring treat ordinary session traffic as errors, producing a false high-severity incident on Aug 31 and re-flagging the same line again now.
What caused this
Affected: Durable Object
executor-cloudflare_McpSessionDO· Cloudflare accountfdd120ce6acd80e0c9812d5fbc910db0· DO Requests at 0 · 1 dependent, ~7% of nearby trafficLog lines that fired the check
[executor] VITE_PUBLIC_SITE_URL is not set and no platform origin was detected; falling back to the per-request origin. OAuth redirects, MCP metadata, and connect links will use this — set VITE_PUBLIC_SITE_URL to your public origin (e.g. https://your-instance.example.com). {"level":"warn","message":"[executor] VITE_PUBLIC_SITE_URL is not set and no platform origin was detected; falling back to the per-request origin. OAuth redirects, MCP metadata, and connect links will use this — set VITE_PUBLIC_SITE_URL to your public origin (e.g. https://your-instance.example.com)."}[executor] MCP session mode {"clientCapabilities":null,"elicitationSupport":{"form":false,"url":false},"elicitationMode":"model","resumeEnabled":true} {"level":"error","message":"[executor] MCP session mode {\"clientCapabilities\":null,\"elicitationSupport\":{\"form\":false,\"url\":false},\"elicitationMode\":\"model\",\"resumeEnabled\":true}"}[executor] MCP session mode {"clientCapabilities":{"elicitation":{"form":{}},"roots":{"listChanged":true}},"elicitationSupport":{"form":true,"url":false},"elicitationMode":"model","resumeEnabled":true} {"level":"error","message":"[executor] MCP session mode {\"clientCapabilities\":{\"elicitation\":{\"form\":{}},\"roots\":{\"listChanged\":true}},\"elicitationSupport\":{\"form\":true,\"url\":false},\"elicitationMode\":\"model\",\"resumeEnabled\":true}"}What changed
packages/hosts/mcp/src/tool-server.ts:syncToolAvailabilitynow emits its[executor] MCP session modenegotiation snapshot withconsole.infoinstead ofconsole.error; the payload is unchanged.Why it's safe
internal error; reference = ...and thrown exceptions) are emitted elsewhere and remain error-level, so real faults stay distinguishable from session negotiation.Validation
pnpm --filter @airbooks/mcp typecheck: 0 errorspnpm --filter @airbooks/mcp lint(oxlint, changed file): 0 warningspnpm --filter @airbooks/mcp test: 216/216 passRoot cause and scoping notes
Root cause
Cloudflare Workers observability flagged 55 error-level events over 24h, all the
[executor] MCP session mode {...}signature from the executor worker. The emitting call site issyncToolAvailabilityinpackages/hosts/mcp/src/tool-server.ts:2324, which serializes the negotiated session state after a successful (re)negotiation — it is not an error path. Corroboration that nothing failed:workersInvocationsAdaptiveshows 99 requests and 0 errors over the same window, and traces show 0 errors/faults. The same signature produced confirmed issue iss_055aef9a9001b0v7jafym0cy (severity high) on 2026-08-31, so this mislabel is the root cause of recurring false incidents. Emitting the snapshot at info level keeps the visibility (the worker persists info logs at full head sampling) while letting genuine failures keep their error level.Outcome after fix
A client connects and the server negotiates session mode.
syncToolAvailabilitycompletes and emits the same[executor] MCP session modeJSON snapshot, now at info level. Workers observability routes it to info logs rather than error logs, so the "mcp-session-error" content review no longer matches informational session traffic, and the false error signal stops. A genuine failure later producesinternal error; reference = ...or an exception, which still lands at error level and is still flagged. The session-mode state that previous incidents relied on remains queryable in the info-level logs.1 file changed (+1/-1)
packages/hosts/mcp/src/tool-server.ts: modified, +1/-1Generated by Polylane.