feat(events): read-only runtime-identity status verb on the event IPC (#269) - #324
Conversation
🦋 Changeset detectedLatest commit: e785249 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
Add a pinned read-only status verb and carry warm-runtime availability through Doctor and Workbench discovery.
Exercise the generated event status endpoint before and after a worker exits nonzero.
Keep every event-runtime connection failure classified as unavailable so generated hooks retain standalone fallback behavior.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f976d4ffa6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| findings.push({ path, state: 'live' }); | ||
| let runtime: DoctorRuntimeStatus; | ||
| try { | ||
| const probed = await requestEventRuntimeStatus({ endpoint: path, timeoutMs: 1_000 }); |
There was a problem hiding this comment.
Bound the endpoint scan as a whole
When the endpoint directory contains multiple listeners that accept connections but never answer—exactly the silent-runtime failure this probe is intended to diagnose—this await runs each one-second timeout serially inside the surrounding loop. Doctor and the Workbench discovery request therefore take roughly N seconds for N silent endpoints, so the per-socket timeout does not provide a useful overall bound; probe endpoints concurrently with bounded concurrency or apply a deadline to the complete scan.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in #397 (merged as d25a9c6). doctor.ts scans runtime endpoints with mapConcurrent (concurrency 8) instead of serially, so a directory of silent endpoints is bounded as a whole rather than costing one 1 s timeout each; tests/doctor.test.ts asserts concurrent probing timing against fake silent endpoints.
f976d4f to
e785249
Compare
Summary
Deliverable 2 of 2 for #269 (the #98 visibility remainder): a pinned read-only
statusverb on the event-runtime IPC exposesWarmRuntimeIdentity, so doctor and the Workbench Hosts page can honestly report which runtime instance owns process-lifetime state — previously doctor only bare-TCP-probedevent-*.sockand never spoke the protocol.{"kind":"status","protocolVersion":1}(strict); success carriesruntime: { instanceId, artifactEpoch, availability, pid, startedAt? }(strict). The verb has no artifact-epoch gate — its point is that a caller who does not know the epoch learns it. Backward compat is a detectable degraded state: an older server (or one composed without a status source) strict-rejects the request and answersinvalid-message, which the new client maps to one honestunsupportedoutcome, distinct fromunavailable(no listener). Event requests are byte-identical to before; generated hook standalone-fallback semantics on connect errors are untouched.@agent-bundle/runtime): additiveWarmFlightHost.availability()accessor (available/runtime-restarted/runtime-unavailable);createFlightWorkerHostnow marks the warm host on worker exit, so the verb reportsruntime-restartedafter a worker death while retaining the sameinstanceId(pinned in the generated-server integration test).createGeneratedRouteMcpServerfeeds the status source from the warm host's own identity — generated entries get it automatically through the existingGeneratedEventRuntimeBinding; no codegen change. Servers with no warm-host identity stay honestlyunsupported.runtime(identity orunsupported/unavailable/failed). New diagnostics registered indocs/diagnostics.md:AB7317(info: pre-Workbench state-lifetime catalog display and runtime-instance identity introspection (#98 visibility remainder) #269 runtime, no identity support) andAB7318(error: probe unavailable/timeout/invalid). Doctor never mutates and cannot hang (silent-socket bound pinned in tests).contracts/discovery.ts→ service → strict client decoder → Hosts page) carries the per-endpoint runtime identity; display is read-only with honest neutral text for unsupported/unreported (norole="alert"for absence). G6: zero mutation affordances.Per the #218 stage-2/3 deferral ("blocked on #269"): the contract matrix can now assert warm-runtime instance identity at the packed and installed-host boundaries by speaking this verb against the artifact's event endpoint (
requestEventRuntimeStatusaccepts an endpointId or a raw socket path).Test plan
pnpm build,pnpm lint(0/0),pnpm typecheckpnpm test:unit,pnpm test:route-unit,pnpm test:projectioninstanceIdacross consecutive status calls;runtime-restartedwith retained identity after worker death; thin-client event path unchangedAB7317on an old-protocol socket, boundedAB7318on a silent sockethost-discovery-dev-server) + Workbenchdiscovery.e2eat 1440×900@agent-bundle/runtimeminor,agent-bundleminor