Conversation
Summary (Non-blocking)Lets legacy clients supply Notes
|
Adapt the client-ID compatibility change from local commit 6117359a604ee145592ce37dc79d73e10e7dc145 onto current upstream. Close the collision transaction before returning, so a rejected identity cannot poison later admission. Cover HTTP retry, conflicting identity, and follow-on admission with real SQLite storage.
Joeywrz
force-pushed
the
fix/legacy-client-run-id-followup
branch
from
September 18, 2026 19:04
cb794c4 to
af49398
Compare
This branch has not been deployed
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.
What does this PR do?
Preserve UUID-shaped client
run_idvalues onPOST /v1/runsusing the existing durable, profile/credential-scoped idempotency store.Legacy thin gateways retry the body ID after a lost 202 without sending
Idempotency-Key. On basec4a5deeffa959f8ebc891e02c5bcf767aff1dd2a, that ID is ignored and a new server ID is generated. This change adds only the compatibility adapter; it does not introduce another retry store or an exactly-once execution guarantee.Related Issue
No separate open issue is claimed as fixed. Related predecessor and overlapping work:
The client-ID use case was previously proposed in #34399 by @lepapillonterrible; that PR was closed unmerged. This candidate keeps the narrower UUID-shaped syntax from Joey's locally carried compatibility work and corrects a transaction-close defect in that implementation.
#83253, #89754 and #84139 cover adjacent header-based admission/correlation work. Live duplicate searches found no equivalent open body-ID adapter; this is not a claim of exhaustive search. If another admission change lands first, rebase and rerun against its authoritative store rather than introduce parallel machinery.
Type of Change
Changes Made
gateway/platforms/api_server_runs.py: client-ID validation, reuse of scoped durable admission, and replay after concurrent history loading.gateway/platforms/api_server_run_idempotency.py: reject cross-key/scope run-ID collisions and close the transaction on the conflict path.tests/gateway/test_api_server_client_run_id.py: HTTP, durable ownership, follow-on admission and synchronized simultaneous-retry regressions.website/docs/user-guide/features/api-server.md: accepted ID syntax, header precedence, conflicts and retention limits.Accept body IDs matching
run_[0-9a-f]{32}and reject malformed IDs before allocating run state.Without a nonblank header, reserve
legacy-run:<run_id>through the existing request fingerprint and authenticated scope.With both fields present, the header selects the idempotency key and the body selects the run ID. Mismatched bodies/session keys or an ID already owned by another key/scope fail closed.
Reject durable run-ID collisions inside the insertion transaction and commit before returning conflict, keeping the next lookup/admission usable.
Document the precedence and retention boundary. No schema, dependency, config, or model-tool changes.
How to Test
run_idto/v1/runs; the server returns a different generated ID. Use the regression cases below for an isolated localhost reproduction without a real provider.Regression coverage
Three invariant tests (six parameterized cases):
The second adapter has no live run-owner cache, so the HTTP collision exercises durable reservation rather than only the in-memory guard. The external LLM agent is replaced; no live provider or deployed gateway is contacted.
Local verification
cb794c42ff417e7da608681bc96ac1da84f1c3b0received an independent delta review and a fresh six-case regression pass.git diff --check: pass.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass — not claimed. Local affected-area tests used the canonicalscripts/run_tests.sh; the full local repository suite was not run. Hosted CI is reported separately below.Documentation & Housekeeping
website/docs/user-guide/features/api-server.mdupdatedcli-config.yaml.exampleif I added/changed config keys — N/A, no config keys changedCONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/A, neither changedscripts/check-windows-footguns.py --diff c4a5deeffa959f8ebc891e02c5bcf767aff1dd2apassed. Local execution was macOS; no local Windows/Linux execution claimed.Screenshots / Logs
No UI change; no screenshot required. Local logs recorded 209 passing tests across eight files. No live-provider or real gateway crash/restart test was performed; no full local suite or docs build is claimed.
Hosted checks at exact head
cb794c42ff417e7da608681bc96ac1da84f1c3b0completed successfully:CI success and local review are not maintainer approval or a merge claim.