Uh oh!
There was an error while loading. Please reload this page.
fix(runtime): mount GET /ready so the readiness probe is reachable over HTTP - #2227
Merged
Conversation
…er HTTP Seam #2 added the dispatcher's `/ready` handler (200 running / 503 booting or draining) but never mounted a route for it. The dispatcher mounts routes EXPLICITLY (no catch-all), so `GET /api/v1/ready` matched nothing and returned the Hono not-found 404 before reaching dispatch() — the exact failure mode that shipped `/mcp` and `/keys` broken, hidden because the unit test called dispatch() directly. Mount `${prefix}/ready` next to `${prefix}/health`. This is the contract the EE multi-node rolling-restart drain gate polls (cloud ADR-0018) so a load balancer stops routing to a replica before it closes. Tests: - dispatcher-plugin.routes.test.ts: assert both /health and /ready are mounted (registration-level guard that would have caught this). - dispatcher-plugin.ready.integration.test.ts (new): boot a real HonoServerPlugin + dispatcher on a socket, fetch /ready -> 200 (running) and 503 (draining via getState), and confirm a bogus path returns the prod {"error":"Not found"} 404 so the test reproduces the pre-fix failure rather than passing vacuously. Adds a test-only devDependency on @objectstack/plugin-hono-server. Verified: pnpm --filter @objectstack/runtime build (strict DTS), full runtime suite (420 tests), and a CLI boot+curl (/api/v1/ready 404 -> 200). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 17 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Problem
Seam #2 (PR #2217) added a
GET /readyreadiness handler inside the dispatcher'sdispatch()(next to/health) plus a passing unit test. But in a real running server/readyreturned 404 ({"error":"Not found"}) and was unreachable, while/api/v1/healthreturned 200.Root cause: the dispatcher mounts routes on the HTTP server explicitly — there is no catch-all.
${prefix}/healthis registered indispatcher-plugin.ts;${prefix}/readynever was. SoGET /api/v1/readymatched no route and fell through to HonoServerPlugin'snotFoundhandler before reachingdispatch(). This is the exact class of bug that shipped/mcpand/keysbroken — the unit test passed because it calleddispatch()directly.Fix
Mount
${prefix}/readynext to${prefix}/health, routing todispatch('GET', '/ready', …). The 200 (running) / 503 (booting or draining) handler logic was already correct and is untouched. This is the contract the EE multi-node rolling-restart drain gate polls (cloud ADR-0018) so a load balancer stops routing to a replica before it closes.Tests
dispatcher-plugin.routes.test.ts— assert both/healthand/readyare mounted (registration-level guard that would have caught this gap).dispatcher-plugin.ready.integration.test.ts(new) — boot a realHonoServerPlugin+ dispatcher on a socket and usefetch(notdispatch()):/api/v1/ready→ 200{state:"running"}/api/v1/ready→ 503 while draining (kernel.getState()→stopping){"error":"Not found"}404, proving the harness reproduces the pre-fix failure (not a vacuous pass)@objectstack/plugin-hono-server(no cycle; not in the build/publish graph).Verification
pnpm --filter @objectstack/runtime build→ strict DTS success/api/v1/ready404 → 200{"success":true,"data":{"status":"ready","state":"running"}}🤖 Generated with Claude Code