Adds ai.models tRPC router with provider CRUD, role routes, testProvider, and resolveForRole; Vercel AI SDK client factory in packages/ai; Settings pages for providers and role routing; agent_runs model metadata columns with MCP complete_task fields and runs UI column. Co-authored-by: Cursor <cursoragent@cursor.com>
63 lines
1.8 KiB
Markdown
63 lines
1.8 KiB
Markdown
---
|
|
kind: task
|
|
slug: settings-ai-providers-ui
|
|
title: Settings UI — AI model providers
|
|
plan_slug: automation-foundation
|
|
epic_slug: model-provider-registry
|
|
status: done
|
|
priority: P1
|
|
tenant_id: global
|
|
owner: unassigned
|
|
cursor_todo_id: null
|
|
updated_at: "2026-07-03"
|
|
agent_prompt: |
|
|
Read docs/adr-model-routing.md. apps/web UI only — reuse components/ui.
|
|
Route: /[workspaceSlug]/settings/ai/providers. Do not store secrets in
|
|
forms — only api_key_env_var name field. claim_task before work.
|
|
---
|
|
|
|
# Task summary
|
|
|
|
Build the workspace Settings page for CRUD on model provider aliases, including a “Test connection” action.
|
|
|
|
## Description
|
|
|
|
### Route
|
|
|
|
`apps/web/app/(app)/[workspaceSlug]/settings/ai/providers/page.tsx`
|
|
|
|
Add nav link under Settings (near runs/audit).
|
|
|
|
### UI
|
|
|
|
- Table: alias, display name, provider type, model id, base URL (truncated), enabled, actions
|
|
- Add/Edit dialog: all fields from ADR; provider type select drives whether base URL is required
|
|
- Test button → calls `ai.models.testProvider` → toast with latency or error
|
|
- Delete with confirm
|
|
|
|
### UX notes
|
|
|
|
- Show helper text: “API key is read from server env var `ANTHROPIC_API_KEY`” — not a password field
|
|
- Example presets (optional buttons): “Ollama local”, “MLX local (mlx-openai-server)”, “Anthropic”, “NVIDIA NIM”, “Gemini” — prefill form per `docs/adr-model-routing.md` § Provider examples
|
|
|
|
## Subtasks
|
|
|
|
- [ ] Page + list query
|
|
- [ ] Create/edit dialog
|
|
- [ ] Test connection + delete
|
|
- [ ] Settings nav entry
|
|
|
|
## Estimation
|
|
|
|
M
|
|
|
|
## Acceptance criteria
|
|
|
|
- [ ] Admin can add `qwen-coder` with Mac Ollama base URL and test it
|
|
- [ ] Non-admin sees read-only or hidden mutations
|
|
- [ ] Matches existing settings page visual patterns (e.g. runs page)
|
|
|
|
## Links
|
|
|
|
- Epic: `./Epic-model-provider-registry.md`
|
|
- Depends on: `Task-trpc-models-router.md`
|