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
+13 -7
View File
@@ -291,15 +291,21 @@ describe('runtime selection', () => {
).toEqual({ provider: 'deepseek-harness' })
})
it('routes legacy automatic settings through local OpenCode when the Server is blank', () => {
expect(getConfiguredRuntimeTarget(settings())).toBe('opencode')
it('treats legacy automatic settings as the direct model, matching settings normalization', () => {
expect(getConfiguredRuntimeTarget(settings())).toBe('model')
expect(
getConfiguredRuntimeTarget(
settings({ opencodeEmbedded: false })
)
getConfiguredRuntimeTarget(settings({ provider: 'opencode' }))
).toBe('opencode')
})
it('resolves own configuration explicitly instead of the configured profile', () => {
const configured = settings({
provider: 'opencode',
opencodeModelProfile: settings().modelProfiles[0]
})
expect(
applyRuntimeSelection(settings(), { provider: 'auto' }).settings
).toEqual(settings())
applyRuntimeSelection(configured, { provider: 'opencode', runtimeConfig: true })
.settings.opencodeModelProfile
).toBeUndefined()
})
})