Repository navigation
fix(ai): a saved gateway route table keeps only failover state, so a changed default route reaches every machine - #2364
Merged
Conversation
Owner
Author
Fail-to-pass check run
|
…changed default route reaches every machine The gateway router loaded a saved route table from `<data dir>/agent/gateway_state.json` in place of `DEFAULT_GATEWAY_ROUTES`. No command refreshed that table when default routes changed in the code. A change to default routes never reached a machine that already held a saved state file. - Make `_save_gateway_state` write only failover routes (routes whose `backend_type` starts with `failover:`) to `gateway_state.json`. - Make `_load_gateway_state` start with `_build_default_routes()` and overlay only saved failover routes. Ignore any non-failover route present in an existing saved state file. - Update `test_failover_reset_restores_the_default_routes`, `_write_routes_with_a_small_coder`, and `_default_route_file` to expect an empty failover route list when no routes are in failover. - Add tests in `tests/test_ai_gateway.py` to confirm that saved old default routes do not override current defaults and that saved failover routes persist on restart. Closes #2045 Change: `openspec/changes/archive/2026-10-27-2045-gateway-routes-defaults/`
dan-petty
force-pushed
the
fix/2045-gateway-routes-defaults
branch
from
October 27, 2026 18:35
69d63df to
4795a61
Compare
dan-petty
marked this pull request as ready for review
October 27, 2026 18:42
dan-petty
pushed a commit
that referenced
this pull request
Oct 27, 2026
🤖 I have created a release *beep* *boop* --- ## [0.7.3](v0.7.2...v0.7.3) (2026-10-27) ### Bug Fixes * **ai:** a saved gateway route table keeps only failover state, so a changed default route reaches every machine ([#2364](#2364)) ([8317526](8317526)) * **k8s:** delete unused portkey routing configmap ([#2363](#2363)) ([15bd601](15bd601)) * **telemetry:** export created timestamps for cluster job counters ([#2039](#2039)) ([#2366](#2366)) ([cc34caa](cc34caa)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
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 free
to 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.
The gateway router loaded a saved route table from
<data dir>/agent/gateway_state.jsonin place ofDEFAULT_GATEWAY_ROUTES. No command refreshed that table when default routes changed in the code. A change to default routes never reached a machine that already held a saved state file._save_gateway_statewrite only failover routes (routes whosebackend_typestarts withfailover:) togateway_state.json._load_gateway_statestart with_build_default_routes()and overlay only saved failover routes. Ignore any non-failover route present in an existing saved state file.test_failover_reset_restores_the_default_routes,_write_routes_with_a_small_coder, and_default_route_fileto expect an empty failover route list when no routes are in failover.tests/test_ai_gateway.pyto confirm that saved old default routes do not override current defaults and that saved failover routes persist on restart.Closes #2045
Change:
openspec/changes/archive/2026-10-27-2045-gateway-routes-defaults/