Repository navigation
refactor(agents): reuse auth profile listing - #132919
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 7:55 PM ET / 23:55 UTC. ClawSweeper reviewWhat this changesThe PR removes a duplicate provider-auth profile-listing helper and makes API-key and full-auth resolution use the shared auth-profile listing helper. Merge readinessKeep open for normal maintainer merge review. The introduced substitutions preserve the exact provider-alias matching and insertion-order behavior while removing duplicate policy; the MEMBER authorship and Priority: P3 Review scores
Verification
How this fits togetherModel configuration looks up stored credentials by provider, resolves compatible profile IDs, and then selects API-key, token, or OAuth authentication for provider discovery and execution. flowchart LR
A[Provider request] --> B[Alias resolution]
B --> C[Auth profile store]
C --> D[Shared profile listing]
D --> E[Credential selection]
E --> F[Provider authentication]
Decision needed
Why: The patch appears behavior-preserving, but MEMBER-authored and maintainer-labeled items require explicit human merge judgment. Before merge
Agent review detailsSecurityNone. PR surfaceSource -8. Total -8 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the canonical-helper refactor once a maintainer approves the exact head and required checks complete. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is an internal refactor, not a report of failing user behavior. Is this the best way to solve the issue? Yes. The shared helper exactly implements the deleted provider-alias matching logic, while the two callers retain their distinct credential-selection policies. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4db43443acc1. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Before-merge resolution:
The listed human-review |
|
Merged via squash.
|
What Problem This Solves
Provider auth resolution maintained a second copy of the canonical provider-profile enumeration logic. The implementations were identical, so future alias or ordering changes could drift between model-config secret resolution and the shared auth-profile owner.
Why This Change Was Made
Both model-config consumers now import the lightweight canonical
listProfilesForProviderhelper directly. The duplicate exported helper and its unused alias resolver import are removed; the specialized auth ordering path remains unchanged.This is the best fix because
auth-profiles/profile-list.tsalready owns the exact side-effect-free invariant. Keeping an alias or another wrapper would preserve duplicate policy without a compatibility requirement.User Impact
No user-visible behavior changes. Provider aliases and profile insertion order resolve exactly as before, with one canonical implementation instead of two.
Evidence
mainconfirmed the removed helper was byte-identical apart from its name.node scripts/run-vitest.mjs src/agents/models-config.providers.auth-provenance.test.ts src/agents/models-config.providers.normalize-keys.test.ts src/agents/provider-auth-aliases.test.ts src/agents/auth-profiles/order.test.ts: 67 passed.pnpm exec oxfmt --checkon both changed files: passed.pnpm exec oxlinton both changed files: passed.pnpm tsgo:core: passed.gpt-5.6-solat high reasoning: clean, patch correctness confidence 0.98.