fix(agents): normalize volcengine-plan and byteplus-plan provider IDs for auth lookup#31821
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d21d322dcf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (normalized === "volcengine-plan") { | ||
| return "volcengine"; | ||
| } | ||
| if (normalized === "byteplus-plan") { | ||
| return "byteplus"; |
There was a problem hiding this comment.
Keep coding-plan provider IDs distinct in normalization
Mapping volcengine-plan/byteplus-plan to their base providers here changes model parsing globally (parseModelRef() and normalizeModelRef() call normalizeProviderId()), so a configured default like volcengine-plan/ark-code-latest is rewritten to volcengine/ark-code-latest. That breaks provider routing because the runtime defines separate provider configs for base vs coding plans (src/agents/models-config.providers.ts:709-739,987-1002) with different base URLs and model catalogs; the base providers do not carry the coding defaults, so these onboarded defaults can resolve as unknown models or hit the wrong endpoint.
Useful? React with 👍 / 👎.
Greptile SummaryFixes auth profile lookup for
Confidence Score: 5/5
Last reviewed commit: d21d322 |
d15a49b to
c4a410a
Compare
…le resolution The configure flow stores auth credentials under `provider: "volcengine"`, but the coding model uses `volcengine-plan` as its provider. Add a scoped `normalizeProviderIdForAuth` function used only by `listProfilesForProvider` so coding-plan variants resolve to their base provider for auth credential lookup without affecting global provider routing. Closes openclaw#31731 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c4a410a to
34c9175
Compare
|
Reworked based on the code review feedback — thank you for the catch. Before: Modified global After: Added a scoped |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 34c9175361
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const providerKey = normalizeProviderIdForAuth(provider); | ||
| return Object.entries(store.profiles) | ||
| .filter(([, cred]) => normalizeProviderId(cred.provider) === providerKey) | ||
| .filter(([, cred]) => normalizeProviderIdForAuth(cred.provider) === providerKey) |
There was a problem hiding this comment.
Normalize provider consistently during auth order validation
This change makes listProfilesForProvider("volcengine-plan"/"byteplus-plan") return base-provider credentials, but resolveAuthProfileOrder still validates each candidate with normalizeProviderId(cred.provider) === providerKey (src/agents/auth-profiles/order.ts:45), so those newly returned profiles are filtered out immediately. In the onboarding/default flow (volcengine-plan/ark-code-latest with stored volcengine:default creds), auth order remains empty and resolveApiKeyForProvider still falls through to a missing-key error unless an env var is present.
Useful? React with 👍 / 👎.
|
Landed via temp rebase onto main.
Thanks @justinhuangcode! |
Thanks for the thorough review and landing! |
Summary
volcengine-plan→volcengineandbyteplus-plan→byteplusinnormalizeProviderId()so auth profile lookup finds credentials stored under the base provider namevolcengine:defaultwithprovider: "volcengine", but the default coding model (volcengine-plan/ark-code-latest) usesvolcengine-planas its provider — causing subagent auth failuresTest plan
volcengine-planandbyteplus-plannormalizationmodel-selection.test.tstests passCloses #31731