Repository navigation
Description
Problem
#4682 (acd5dbd10, merged 2026-10-12 03:07Z) added OpenAI ChatGPT subscription keys with a ChatGPT account ID to Settings › AI providers. Two of the new dialog paths fail, and neither says why. Paths are under services/platform/app/features/settings/ at main acd5dbd10.
1. Replace subscription key can't be saved unless the account ID is typed again.
- The field looks optional: in the replace dialog,
SecretFieldsrenders the account ID withrequired={!replacing}(providers/credential-adapter.tsx:216), so it carries no required marker. - But Save needs it:
isComplete(:610-617) requiresdraft.accountIdfor everysubscription-keydraft whose vendor declaressubscriptionAccountIdVar, replace included.replace-secret-dialog.tsxstarts from an empty draft (:53) and passesisValidtoFormDialog, whose submit isdisabled={isSubmitting || !isDirty || !isValid}(packages/ui/src/components/dialog/form-dialog.tsx:182). - The server doesn't need it: the update keeps the stored account ID when none is sent (
backend/domains/provider_credentials/service.ts:816). - What the user sees: on an OpenAI subscription-key row, Replace subscription key with only a new key pasted keeps Save disabled, with no message.
2. A hidden account ID gets Create refused, in English.
- The draft carries it over: in Add credential › OpenAI, a user types an account ID under Subscription key, then switches the method to API key. The method change keeps the draft (
credentials/credential-add-dialog.tsx:315-320only clears the error). The account ID field is shown only forsubscription-key(credential-adapter.tsx:188). - It is sent with the API key:
buildArgsstill sendsaccountIdfor any secret-like method,api-keyincluded (:98-99,:623-631). - The server refuses it:
CREDENTIAL_ACCOUNT_ID_INVALIDwith "An account ID is only valid for a subscription-key credential" (service.ts:585-589).mapCredentialErrorshows that sentence verbatim in every locale, about a field the form no longer displays.
Tests: #4682's tests don't cover either path.
Expected
-
Replace: allow Save without an account ID and keep the stored one, as the server does. Or mark the field required with a reason, if a new key must always come with its account.
-
Add credential: send
accountIdonly forsubscription-key, or clear it on a method change. MapCREDENTIAL_ACCOUNT_ID_INVALIDto a localized sentence. -
Regression:
- a replace-dialog test where pasting only a new subscription key enables Save and submits without
accountId; - an add-dialog test where switching from Subscription key, with an account ID typed, to API key creates the credential without
accountId.
On
acd5dbd10both fail. - a replace-dialog test where pasting only a new subscription key enables Save and submits without
Severity and owner
- Severity: medium. Rotating a subscription token, the routine operation for this credential type, is blocked unless the admin finds and retypes the account ID.
- Owner: platform (AI providers), the author of feat(platform): support provider subscription accounts #4682.
- Related: bug(platform): AI provider settings show English server text and a wrong "no provider files" diagnosis when reads fail #4831 (the credential error text and failed reads on the same page).
- Found by: Review A (TALE-358), 2026-10-12 08:15 Zurich occurrence, in the changed-cell sweep of feat(platform): support provider subscription accounts #4682. This is static reading at
acd5dbd10; I didn't run it, because Review A's stack is BLOCKED.
Activity
fix(platform): keep the account ID when a subscription key is replaced