mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: treat a missing serve endpoint as a fatal dial error (#27864)
Adds 404 as a terminal error for establishing DRPC connection. A standalone AI Gateway pointed at a coderd that does not expose `/api/v2/ai-gateway/serve` gets a 404, which the connect loop classified as transient and retried forever. Redialing cannot fix a missing endpoint. 404 now is treated as terminal handshake failure. `--url` is expected to point directly at coderd, so a 404 from an intermediary is not distinguished. Refs https://linear.app/codercom/issue/AIGOV-320/write-connection-tests --- Generated with Coder Agents.
This commit is contained in:
@@ -310,6 +310,13 @@ The standalone Gateway image does not need to match the `coderd` image version e
|
||||
The components can connect when their AI Gateway API versions are compatible, and `coderd` checks compatibility whenever a Gateway replica connects.
|
||||
|
||||
A replica may run at the same API version as `coderd` or an earlier minor version of the same major version, but never a newer one.
|
||||
The Gateway treats certain handshake failures from `/api/v2/ai-gateway/serve` as fatal and exits rather than retrying:
|
||||
|
||||
- HTTP 400: incompatible API version.
|
||||
- HTTP 401: invalid Gateway key.
|
||||
- HTTP 403: missing entitlement.
|
||||
- HTTP 404: endpoint not found. `coderd` may be too old and not expose `/serve` endpoint.
|
||||
|
||||
Sequence changes that move both components:
|
||||
|
||||
- To upgrade, upgrade `coderd` first, then roll out the standalone Gateway release.
|
||||
|
||||
Reference in New Issue
Block a user