Skip to content

feat(web): connect a model provider from the composer with Enable AI - #138

Merged
TheGreatAxios merged 5 commits into
mainfrom
cl-12083-connect-a-model-provider-from-the-composer-instead-of-an
Nov 4, 2026
Merged

TheGreatAxios merged 5 commits into
mainfrom
cl-12083-connect-a-model-provider-from-the-composer-instead-of-an

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Closes CL-12083

What changed

A project with no model provider connected showed an error banner in place of the composer. The composer now stays, disabled, with the placeholder "Enable AI to start the conversation" and a highlighted Enable AI button in place of Send; the mic and attach controls are hidden. Enable AI opens the model setup provider tiles in a dialog, so connecting never leaves the project; once connected, the coordinator starts.

Only model_provider_missing gets this. model_profile_required keeps the existing banner with Open Settings and Retry, since connecting another provider cannot settle a profile choice.

  • model-setup.tsx: the tiles move into ProviderTiles, shared by ModelSetup and the new EnableAiDialog.
  • workspace/index.tsx: modelRefusal returns the refusal code with its message, and the composer branches on it.
  • config.ts: action.enableAi, conversation.enableAiFirst.

How it was verified

  • bun run test: 218 passed, 0 failed.
  • bun run lint, bun run format:check, bun run typecheck: passed.
  • In the app with no provider: the composer shows Enable AI and the placeholder, the dialog opens, and an API-key tile opens the key prompt over it. A real connection was not exercised.

@linear-code

linear-code Bot commented Nov 4, 2026

Copy link
Copy Markdown

CL-12083

@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Self-Review Summary

Reviewed the branch against origin/main with /code-review. One blocking issue was found and fixed before pushing.

Files Reviewed

  • apps/web/src/pages/model-setup.tsx: moves the tiles into ProviderTiles and adds the EnableAiDialog wrapper. No behaviour change to ModelSetup.
  • apps/web/src/pages/workspace/index.tsx: branches the composer and banner on the refusal code.
  • apps/web/src/config.ts, apps/web/src/App.tsx: wording, prop wiring.

Issues Found and Resolved

  • Enable AI showed for model_profile_required, which a new provider cannot fix, and the Open Settings path had been removed (dead end). Now gated on model_provider_missing; the profile cases keep the banner.
  • The locked composer did not say why: placeholder added.
  • Mic and attach stayed live on the locked composer: hidden.
  • Unused enable-ai-dialog class: removed.

Known, not addressed

  • A provider connected outside the dialog only takes effect after reopening the project.
  • Closing the dialog mid subscription login drops the in-flight guard, so a second login can start.
  • The web refusal set omits model_profile_custom (this was already the case).
  • No automated test covers the new flow.

@corbits-triage

corbits-triage Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

Comment thread apps/web/src/pages/workspace/index.tsx Resolved
Comment thread apps/web/src/pages/model-setup.tsx Resolved
Comment thread apps/web/src/pages/workspace/index.tsx Resolved
Comment thread apps/web/src/pages/workspace/index.tsx Resolved
Comment thread apps/web/src/pages/model-setup.tsx Resolved

@corbits-triage corbits-triage Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No defects reported.

@TheGreatAxios
TheGreatAxios added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 2face0e Nov 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant