fix(ai-proxy-multi): keep existing query string in health check path; cover construct_upstream mutation contract#13506
Merged
nic-6443 merged 2 commits intoJun 11, 2026
Conversation
…checks construct_upstream is invoked once per second per instance by the healthcheck manager timers, always against the cached route config. The checks table is cloned before applying auth header/query; without the clone, the auth query string would be appended to checks.active.http_path again on every call and the cached config would no longer match the config center. Add a regression test asserting the returned checks stay stable across repeated calls and the input table is not mutated.
…uery to health check path construct_upstream always joined auth.query to checks.active.http_path with "?", so a configured path that already carries a query string (e.g. /status?probe=ready) became /status?probe=ready?api_key=... and the active probe requested a wrong path. Use "&" when the path already contains "?".
AlinsRan
approved these changes
Jun 11, 2026
membphis
approved these changes
Jun 11, 2026
shreemaan-abhishek
approved these changes
Jun 11, 2026
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.
Description
Two related changes to
construct_upstreamin ai-proxy-multi:Fix:
auth.querybroke health check paths that already contain a query string. The code always joinedauth.queryontochecks.active.http_pathwith?, so a configured path like/status?probe=readybecame/status?probe=ready?api_key=...and the active probe requested a wrong path (which can flip healthy instances to unhealthy). Now&is used when the path already contains?.Test: cover the no-mutation contract.
construct_upstreamis invoked once per second per instance by the healthcheck manager timers, always against the cached route config. The checks table is cloned before applyingauth.header/auth.query; without the clone, the auth query string would be appended tochecks.active.http_pathagain on every call and the cached config would silently diverge from the config center. This contract had no coverage — the new test callsconstruct_upstreamrepeatedly and asserts the returned checks stay stable and the input instance table is not mutated.Both test cases fail without their respective code behavior: TEST 1 fails if the deepcopy is removed (
call 2: unexpected http_path: /status?api_key=secret?api_key=secret), TEST 2 fails without the separator fix (call 1: unexpected http_path: /status?probe=ready?api_key=secret).Which issue(s) this PR fixes:
N/A
Checklist