Skip to content

fix(extension): omit credentials from daemon ping (fixes #2278) - #2282

Open
kagura-agent wants to merge 1 commit into
jackwener:mainfrom
kagura-agent:fix/daemon-ping-431-cookie-overflow
Open

fix(extension): omit credentials from daemon ping (fixes #2278)#2282
kagura-agent wants to merge 1 commit into
jackwener:mainfrom
kagura-agent:fix/daemon-ping-431-cookie-overflow

Conversation

@kagura-agent

@kagura-agent kagura-agent commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Problem

Fixes #2278. The extension can silently stop before its WebSocket connection when the daemon /ping returns HTTP 431.

A large localhost cookie jar can exceed the Node default HTTP header limit. Because the ping used the browser default credential mode, Chrome attached those cookies, the daemon answered 431, and the extension quietly scheduled another retry without exposing the response.

Fix

  • send only the extension /ping request with credentials: omit, so browser cookies are not attached
  • log non-OK ping status codes before scheduling the normal reconnect
  • keep connection errors silent because a stopped daemon is the expected idle state

This deliberately does not raise the daemon header ceiling globally. The reproduced failure is the HTTP ping, and omitting credentials resolves that narrow path without expanding parsing limits for every HTTP endpoint or WebSocket upgrade.

Verification

Exact head 62d1f202 rebased onto main 50565efd:

  • npx vitest run --project extension — 3 files, 97 tests passed
  • npm run typecheck — passed
  • cd extension && npm run build — passed
  • git diff --check origin/main...HEAD — passed

The final diff contains only extension/src/background.ts and extension/src/background.test.ts.

@kagura-agent

Copy link
Copy Markdown
Contributor Author

Hi @jackwener 👋 — gentle ping. This fix for #2278 (silent 431 wedge from localhost cookie overflow) has been open for 3 days with all CI green. Would appreciate a review when you have a moment. Happy to adjust anything.

@jackwener
jackwener force-pushed the fix/daemon-ping-431-cookie-overflow branch from 3fb21ef to 183871a Compare August 17, 2026 11:43
A large localhost cookie jar can push the extension ping past the Node default header limit. The daemon then responds 431, but the extension silently retries and never reaches the WebSocket connection.

Send the ping without credentials so browser cookies are not attached, and log non-OK HTTP statuses so future probe failures remain visible. Keep connection errors quiet because a stopped daemon is the expected idle state.
@jackwener
jackwener force-pushed the fix/daemon-ping-431-cookie-overflow branch from 183871a to 62d1f20 Compare August 17, 2026 11:44
@jackwener jackwener changed the title fix(extension): prevent silent 431 wedge from localhost cookie overflow (fixes #2278) fix(extension): omit credentials from daemon ping (fixes #2278) Aug 17, 2026
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.

Extension silently never connects when daemon /ping returns 431 (localhost cookie overflow); ping preflight swallows status

1 participant