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>
1.8 KiB
1.8 KiB
| kind | slug | title | plan_slug | epic_slug | status | priority | tenant_id | owner | cursor_todo_id | updated_at | agent_prompt |
|---|---|---|---|---|---|---|---|---|---|---|---|
| task | settings-ai-providers-ui | Settings UI — AI model providers | automation-foundation | model-provider-registry | done | P1 | global | unassigned | null | 2026-07-03 | 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-coderwith 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