Repository navigation
Closed
Labels
Description
Problem
The main chat composer remains fully editable when the selected model's provider has no API key. The user can type a message, but sending is blocked — which reads as a broken input rather than a deliberate gate.
Current behaviour
ChatInterfacedetects a missing key and passessendBlocked={true}with reasonmodelSelector.noApiKey("No API key configured for this model's provider — add one in Settings → AI providers.") —chat-interface.tsxlines ~431–460, ~1499–1514.ChatInputtreatssendBlockedas send-only: the textarea stays editable so the user can "revise their message" —chat-input.tsxlines ~171–176, ~363 (inputDisabled = disabled || (isLoading && !queueModeActive)—sendBlockedis excluded).- The inline error appears as a destructive status line once text is entered (
sendBlockedVisible && value.length > 0, line ~1188), or as a placeholder overlay when empty (lines ~1244–1253). Send is disabled and Enter shows a toast, but typing, pasting, and attachments (except where separately gated) still work.
Repro:
- Open an org with no API key configured for the active model's provider.
- Go to main chat.
- Click the composer and type — input accepts text despite the missing-key state.
Expected behaviour
When no API key is configured (model-level or org-wide noProviderHasApiKey), the chat composer should be non-interactive — same as other hard blocks (disabled / archived thread):
- Textarea disabled (no typing, paste, or focus editing).
- Send button disabled (already the case).
- Missing-key reason visible before the user interacts (banner or disabled placeholder), with the existing Settings → AI providers deep link for admins.
The send-only sendBlocked pattern may remain appropriate for recoverable in-session blocks (e.g. image-edit model mismatch) where the user can fix state without leaving chat — but missing API key is a setup blocker, not a draft-revision case.
Code pointers
services/platform/app/features/chat/components/chat-interface.tsx—activeModelMissingApiKey,noProviderHasApiKey,sendBlockedwiringservices/platform/app/features/chat/components/chat-input.tsx—inputDisabledvssendBlockedsplit; inline reason renderingservices/platform/messages/en.json—modelSelector.noApiKeyservices/platform/app/features/chat/components/chat-input.test.tsx— tests cover send-blocked send button, not input disable
Acceptance criteria
- With no API key for the active model's provider, the chat textarea cannot receive input (typing, paste, dictation).
- The missing-key message is visible on an empty composer without requiring the user to type first.
- Send remains disabled; Enter does not silently no-op.
- Admins still see the actionable link to Settings → AI providers.
- Other
sendBlockedcases (budget exceeded, image-edit mismatch) behave as before unless explicitly scoped into this change. - Regression test covers the disabled composer state for missing API key.
Activity