Skip to content

The chat waits for its host at start - #138

Merged
robertblust merged 1 commit into
mainfrom
the-chat-waits-for-its-host
Oct 25, 2026
Merged

robertblust merged 1 commit into
mainfrom
the-chat-waits-for-its-host

Conversation

@robertblust

Copy link
Copy Markdown
Contributor

The deploy of guestgraph/mcp-guestgraph-io deployed its host and its chat at the same moment; the chat's new revision connected while the host was restarting behind Firebase Hosting, met 503 backend read error, exited 2 at start, and Cloud Run does not start a failed revision again. The first connection to the host is now tried again where the failure passes: a 5xx, a 429 or a 408, a request that timed out or a connection that closed, or fetch failing to reach the host. Any other 4xx and a protocol error fail at once, since they say the address or the protocol is wrong.

The waits are 1, 2, 4, 8, 15, 15 and 15 seconds: eight attempts over a minute of waiting, each attempt ended after ten seconds, so a host that accepts and never answers costs 140 seconds against the 240 of Cloud Run's default start-up probe. Each failed attempt writes one chat.host warning naming the attempt and the reason, the status alone where a front end answered with a page; when the attempts run out, the operator's error and exit 2 are as before. The server still listens only once the host is connected, as bin/http.mjs meant, so the probe cannot pass on a chat with no host. No version moves; the release is its own PR.

Verified: npm test (395 pass, including a host that answers 503 twice, one that answers 404 and one that never answers, and the process waiting out a 503), typecheck, build:check, the pins.json verify list, conventions-check and conventions-format pass.

🤖 Generated with Claude Code

The first connection to the MCP host, made before the server listens, is now tried again where the host failed in a way that passes: a 5xx, a 429 or a 408, a request that timed out or a connection that closed, or fetch failing to reach the host at all. Any other 4xx and a protocol error fail at once, since they say the address or the protocol is wrong. The waits are 1, 2, 4, 8, 15, 15 and 15 seconds, eight attempts over a minute of waiting, each attempt ended after ten seconds, so a host that accepts and never answers costs 140 seconds against the 240 Cloud Run's default start-up probe allows. Each failed attempt writes one chat.host warning naming the attempt and the reason, the status alone where the front end answered a page, and when the attempts run out the operator's error and exit 2 are as before.

The server still listens only once the host is connected, as bin/http.mjs meant, so the probe cannot pass on a chat with no host. This is what failed the deploy of guestgraph/mcp-guestgraph-io, whose host answered 503 from Firebase Hosting while it restarted beside the chat; the sleep, the warning and the attempt's deadline are injected, so the suite waits on none of them.

Verified: npm test (395 pass), npm run typecheck, npm run build:check, the pins.json verify list (terraform init and validate for both deployments, terraform fmt -check), conventions-check and conventions-format pass.

Process: Delivery
Phase: Implement
Track: Code
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@robertblust
robertblust merged commit 7a93406 into main Oct 25, 2026
3 checks passed
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