Skip to content

Agentic UI: Pick the AI provider per conversation - #4534

Closed
sejas wants to merge 26 commits into
trunkfrom
add-conversation-ai-provider-picker
Closed

Agentic UI: Pick the AI provider per conversation#4534
sejas wants to merge 26 commits into
trunkfrom
add-conversation-ai-provider-picker

Conversation

@sejas

@sejas sejas commented Aug 13, 2026

Copy link
Copy Markdown
Member

Related issues

How AI was used in this PR

  • AI helped to build the code and tests.

Proposed Changes

Add API key input in settings AI modal
Add dropdown for provider when the API key exists
Migrate API key to shared.json

Testing Instructions

  1. npm run cli:build:ui && node apps/cli/dist/cli/main.mjs ui --no-open, open http://localhost:8081.
  2. Settings → AI: no toggle — only the "Anthropic API key" section with the input. Save a valid key; reload the page: the field shows the key obfuscated (sk-…***1234) as its value.
  3. Open a conversation. The composer now shows two pills: provider and model. The provider pill only appears when a key is saved.
  4. Switch the provider pill to "Anthropic API key": the model picker narrows to Sonnet 5 / Opus 5. Send a message; the reply comes from the pinned provider. Reload — the pin survives (it's in the session JSONL).
  5. Open a different conversation: it still uses the default provider — pins are per conversation.
  6. On a wpcom conversation using GPT, switch the provider to Anthropic: the model flips to Sonnet 5 automatically.
  7. Back in settings, select-all + delete in the key field: the key is removed, the provider pill disappears from composers, and conversations fall back to WordPress.com. Partially editing the obfuscated value saves nothing.
  8. Desktop app (npm start, full restart): repeat 2–7; with STUDIO_DEBUG_TRACKS=1, a conversation switch logs studio_setting_ai_provider_change with surface: 'conversation'.
  9. Check the settings section and the two pills in both light and dark appearance.
provider-dropdown-chat.mp4

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

sejas added 26 commits August 11, 2026 13:19
…y-settings

# Conflicts:
#	apps/cli/ai/providers.ts
#	packages/common/ai/anthropic-key.ts
…y-settings

# Conflicts:
#	apps/cli/lib/cli-config/core.ts
…y-settings

# Conflicts:
#	apps/cli/commands/ai/index.ts
#	apps/studio/src/modules/user-settings/lib/ipc-handlers.ts
#	apps/studio/src/modules/user-settings/lib/tests/settings-tracks.test.ts
#	apps/studio/src/preload.ts
#	apps/ui/src/components/settings-view/studio-code-panel.tsx
#	docs/design-docs/analytics-tracks.md
#	packages/common/lib/record-tracks-event.ts
…y-settings

# Conflicts:
#	apps/local/src/index.ts
#	apps/ui/src/ui-classic/components/session-view/composer/index.tsx
@sejas sejas self-assigned this Aug 13, 2026
@sejas
sejas requested review from bcotrim and nightnei August 13, 2026 16:01
@sejas
sejas requested a review from katinthehatsite August 13, 2026 16:01
@sejas
sejas changed the base branch from add-anthropic-api-key-settings to trunk August 13, 2026 16:02
@sejas sejas closed this Aug 13, 2026
@sejas
sejas deleted the add-conversation-ai-provider-picker branch August 13, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant