Repository navigation
perf(agents): reduce repeated turn setup latency - #105220
Merged
Merged
Conversation
Contributor
Author
|
Land-ready proof for the repeated-turn performance fix:
Known proof gaps: none in the changed runtime/test surface. The direct path-scoped Testbox check exposed an unrelated current-main Plugin SDK baseline drift, while the exact-head authoritative hosted CI and repo-native prepare gate passed. |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 13, 2026
* perf(agents): reuse prepared auth route models * chore: leave release notes to release automation
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.
Closes #105207
What Problem This Solves
Repeated Gateway agent turns materialized the same prepared OpenAI route twice during auth setup. On a warm process, duplicate provider/model discovery accounted for roughly half of the local pre-model latency measured in the live path.
Why This Change Was Made
The runner now carries the exact materialized model forward for the same immutable auth-plan object. Unscoped direct-auth routes also reuse an already matching runtime model tuple, while credential-scoped, profile, mismatch, and fallback routes continue to resolve independently. Trace-only auth substages make future regressions attributable without adding normal-path logging.
AI-assisted: yes. The implementation, route invariants, tests, live provider runs, and benchmark measurements were reviewed and verified by the maintainer agent.
User Impact
In repeated live
openai/gpt-5.6Gateway turns, warm median local pre-model setup fell from 441.5 ms to 206.5 ms (53.2%). Warm auth setup fell from 236 ms to 8 ms, and cold pre-model setup fell from 1169 ms to 983 ms. Provider response and tool execution time are unchanged.Evidence
run_05d253dc5e45; warm pre-model 455 ms / 428 ms, auth 235 ms / 237 ms.run_68ba04715c1a; warm pre-model 187 ms / 226 ms, auth 7 ms / 9 ms.run_0eae5386bbe1; local samples identified repeated module/package resolution in the duplicated materialization path.run_86d623a9d822passed on fresh AWS Crabbox.check:changedpassed formatting, lint, typecheck, cycle, and guard lanes before the final clean rebase.