Repository navigation
improve(gateway): avoid targetless session cache allocations - #127790
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Contributor
Author
|
Land-ready evidence for exact head
No implementation-coupled global- |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 23, 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.
What Problem This Solves
Ordinary authenticated Gateway RPCs without a session target, such as
status, allocated two empty session lookup maps during authorization even though they never performed a session lookup.Why This Change Was Made
The authorization owner now initializes its request-scoped cache pair only on the first actual target resolution. Requests with targets still share exactly one initial freshness epoch, and commit-time guards continue to use separate fresh cache epochs.
User Impact
Targetless Gateway RPC authorization performs less allocation work with no protocol, authorization, output, error, or cache-freshness change.
Evidence
200,000map allocations before,0after.{"error":null}andkey>sessionKey>keys>sessionKeys>agentId>agentId.sessionKeysgetter retained the exact thrownErroridentity and getter order.node scripts/check-changed.mjs -- src/gateway/session-sharing.ts: passed.GIT_BRANCH=mainmetadata both passed the UI budget.gpt-5.6-sol/high autoreview: clean, correct 0.99.