perf(auth-files): scope credential refresh lookups - #814
Merged
seakee merged 1 commit intoSep 17, 2026
Merged
Conversation
19 tasks
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.
Summary
Single Codex credential refresh currently fetches the complete auth-file inventory for its preflight and every polling attempt. Scope those reads to the affected physical source and credential identity, then reconcile only that source back into the complete local Accounts inventory.
This is a bounded CPAMP 1.x optimization related to #804. It does not change Accounts loading, search, filtering, sorting, metrics, pagination, selection, deletion, or batch-operation semantics.
Scope
Changes
name/auth_indexfilters and filters locally as a compatibility guard when an older CPA ignores them.User Impact
Refreshing one Codex credential no longer repeatedly transfers and normalizes the complete credential pool on CPA versions that support filtered auth-file reads. Initial Accounts loading and every global Accounts behavior remain unchanged.
Compatibility / Runtime Notes
/auth-files?name=...&auth_index=...contract. Local filtering keeps the lookup semantically scoped if an older CPA returns an unfiltered response.Data / Security Notes
No credential contents or tokens are added to requests or logs. Lookups carry only the existing physical/runtime selector and optional
auth_index. Source membership, account identity, and runtime-ID collision checks remain fail-closed before the refresh mutation.Risk / Rollback
Risk level: Medium
Rollback notes: Revert
a2646e91to restore full-list preflight and polling.Verification
Commands / evidence:
Screenshots / Recordings
N/A — no visible UI change.
Docs
Docs decision: Internal request/reconciliation optimization only; no new user-facing capability, configuration, route, or workflow.
Related
Refs #804
Depends on the filtered lookup contract already available in CPA; router-for-me/CLIProxyAPI#5897 remains useful for transport compatibility and future Manager-side query work but is not used as Accounts pagination here.