Skip to content

bug(platform): Replace subscription key can't be saved without retyping the account ID, and a hidden account ID gets Create refused (#4682) #4830

Closed

Description

@yannickmonney

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, SecretFields renders the account ID with required={!replacing} (providers/credential-adapter.tsx:216), so it carries no required marker.
  • But Save needs it: isComplete (:610-617) requires draft.accountId for every subscription-key draft whose vendor declares subscriptionAccountIdVar, replace included. replace-secret-dialog.tsx starts from an empty draft (:53) and passes isValid to FormDialog, whose submit is disabled={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-320 only clears the error). The account ID field is shown only for subscription-key (credential-adapter.tsx:188).
  • It is sent with the API key: buildArgs still sends accountId for any secret-like method, api-key included (:98-99, :623-631).
  • The server refuses it: CREDENTIAL_ACCOUNT_ID_INVALID with "An account ID is only valid for a subscription-key credential" (service.ts:585-589). mapCredentialError shows 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 accountId only for subscription-key, or clear it on a method change. Map CREDENTIAL_ACCOUNT_ID_INVALID to 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 acd5dbd10 both fail.

Severity and owner

Activity

  1. added
    agent-ready
    on Oct 29, 2026
  2. added a commit that references this issue on Oct 30, 2026
    2953f12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions