Map reliability, operator UX, and spend-control follow-ons onto epics 1–9 so worker, webhooks, and fleet work have bead-scale task briefs. Co-authored-by: Cursor <cursoragent@cursor.com>
3.5 KiB
3.5 KiB
| kind | slug | title | plan_slug | status | priority | tenant_id | cursor_epic_id | updated_at | agent_prompt |
|---|---|---|---|---|---|---|---|---|---|
| epic | model-provider-registry | Model provider registry and per-role routing | automation-foundation | done | P1 | global | null | 2026-08-03 | Epic: model provider registry (docs/adr-model-routing.md). Server-only change — no UI component library inventing; reuse components/ui/. Admin-only mutations. Filter every DB query by workspace_id. One task per session; claim_task first. |
Epic objective
Deliver the workspace-scoped model provider registry and role → alias routing described in docs/adr-model-routing.md: Drizzle schema, zod types in packages/shared, resolveModel(), tRPC CRUD + testProvider, Settings UI, and agent_runs model metadata on completion.
This epic is the first shipped piece of the automation-foundation plan and unblocks future orchestrator/worker work.
In scope / out of scope
In scope
- Tables
model_providers,role_model_routes. - Pure resolver + unit tests.
- tRPC router (workspace admin).
- Settings pages: Providers, Role routing.
- Seed/default routes for nine L2 roles +
gate-copilot+chat-default. complete_taskoptional model logging fields..env.exampleenv var documentation.
Out of scope (moved to follow-on task)
- Billing/budget enforcement → Task-cost-budget-ui-and-caps
Related tasks
| Task | Link |
|---|---|
| Shared schemas and resolveModel | ./Task-shared-schemas-resolve-model.md |
| DB schema and migration | ./Task-db-model-providers-migration.md |
| tRPC models router | ./Task-trpc-models-router.md |
| Settings — providers UI | ./Task-settings-ai-providers-ui.md |
| Settings — role routing UI | ./Task-settings-ai-role-routing-ui.md |
| agent_runs model fields + MCP | ./Task-agent-runs-model-logging.md |
Follow-on tasks (Autensa benchmark)
| Task | Link |
|---|---|
| Cost visibility & dispatch budget caps | Task-cost-budget-ui-and-caps |
Dependencies
- Depends on: existing auth + workspace admin patterns in
apps/web. - Blocks: orchestrator epic (needs
resolveModel), worker epic (needsResolvedModel).
Acceptance criteria
- Admin can create
claude-planning(anthropic) andqwen-coder(openai_compatible + base URL) in a workspace. - Admin can map
role-implementer→qwen-coder,role-architect→claude-planning. testProviderreturns success/failure without exposing API keys.resolveModel()unit tests cover override order and missing-alias error.- At least one task in this epic completed via
claim_task→complete_taskwith model metadata.
Proposed timeline
| Phase | Window | Notes |
|---|---|---|
| Schema + resolver | Session 1–2 | Tasks: shared schemas, migration |
| API | Session 3 | tRPC router |
| UI | Session 4–5 | Both settings pages |
| Logging | Session 6 | agent_runs + MCP |
| Usage & caps | Future | Follow-on task |
Pipeline / convoy mapping
When running via agent-pipeline, architect briefs should align to tasks:
| Brief # | Task slug |
|---|---|
| 1 | shared-schemas-resolve-model |
| 2 | db-model-providers-migration |
| 3 | trpc-models-router |
| 4 | settings-ai-providers-ui |
| 5 | settings-role-routing-ui |
| 6 | agent-runs-model-logging |
Briefs 1–2 serial (schema depends on types); 4–5 can fan out after brief 3 if files: are disjoint.