feat: layer runtime and model selection across conversation, project and global

- Store runtime selection as { provider?, model? } layers and resolve them per
  field (conversation -> project -> global); drop the legacy auto provider.
- Migrate stored selections (database v49) and clear deleted profile ids.
- Re-resolve selections in Main per request and at queue dispatch.
- Add ProjectRuntimeSelector and a two-column RuntimeModelPicker; manage
  link opens model connections; restore per-runtime default model tabs.
- Stop duplicating trusted instructions and history across OpenCode,
  Continue and DeepSeek Harness runtimes.
- Document the layered design, global provider removal plan and planned
  purpose-specific models.
This commit is contained in:
mesalogo
2026-09-29 21:33:06 +08:00
parent d1b92deff3
commit 9c88ca20f3
50 changed files with 2879 additions and 1836 deletions
+4 -3
View File
@@ -228,7 +228,7 @@ import type {
SshHostValidationResult
} from './ssh-host-contracts'
import {
agentRuntimeSelectionSchema,
optionalAgentRuntimeSelectionSchema,
type AgentRuntimeSelection
} from './runtime-selection-contracts'
import {
@@ -343,7 +343,7 @@ export const agentRequestSchema = z
teamMode: z.boolean().optional(),
smartRouting: z.boolean().optional(),
queueItemId: z.string().uuid().optional(),
runtimeSelection: agentRuntimeSelectionSchema.optional(),
runtimeSelection: optionalAgentRuntimeSelectionSchema,
runtimeControl: runtimeControlSchema.optional(),
workMode: legacyWorkModeSchema.optional(),
prompt: z.string().trim().min(1).max(100_000),
@@ -386,7 +386,8 @@ export const conversationQueueUserInputSchema = z
.object({
conversationId: conversationIdSchema,
projectId: z.string().uuid().optional(),
runtimeSelection: agentRuntimeSelectionSchema,
/** Informational only; the renderer re-resolves the selection at dispatch. */
runtimeSelection: optionalAgentRuntimeSelectionSchema,
runtimeControl: runtimeControlSchema.optional(),
expertId: z.string().uuid().optional(),
teamMode: z.boolean().optional(),