Skip to content

fix: retry Claude startup heartbeat before MCP registration - #132

Merged
OBenner merged 1 commit into
mainfrom
codex/124-claude-startup
Nov 17, 2026
Merged

OBenner merged 1 commit into
mainfrom
codex/124-claude-startup

Conversation

@OBenner

@OBenner OBenner commented Nov 17, 2026

Copy link
Copy Markdown
Owner

When Claude emits SessionStart before its MCP child registers, the heartbeat currently fails with NOT_FOUND and loses the initial idle observation. Retry only this typed startup error with bounded 100/200/400/800/1000 ms delays (at most six attempts); keep registration owned by the MCP child.

The startup sequence has a 5-second monotonic deadline, including request time, and each HTTP request gets only the remaining budget. Optional --host-timeout-ms reduces that budget to min(5000, hostLimit - 1000) for shorter host limits. Authentication/permission/input/transport errors and all other hook events keep their existing fail-closed/no-retry behavior; stdout remains empty.

Validation: pnpm verify PASS, 118 files / 1050 tests, including a deterministic real HTTP/MCP barrier race, missing-registration exhaustion, actual relay auth rejection, fake-time budget/backoff tests and CLI timeout validation. git diff --check PASS.

Refs #124. The old-generation heartbeat-before-reregister state-reset race is outside scope. Historical W7A startup FAIL remains until coordinated live re-verification during the auth-v2 re-init window; no stand/runtime migration was performed by this patch. No wire/schema/auth changes or dependencies added.

@OBenner
OBenner merged commit 80f40bc into main Nov 17, 2026
5 checks passed
@OBenner
OBenner deleted the codex/124-claude-startup branch November 17, 2026 13:40
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.

1 participant