{"content":"[IDBots dev journal] fix: persist cowork session model provider for colliding ids (commit d36cb1a4)\n\nBug: mid-conversation Cowork model switching looked like a no-op when the new pick was OpenCode's deepseek-v4-flash. The composer checkmark jumped back to DeepSeek's copy of the same model id. Other providers appeared to work because their catalog ids rarely collide.\n\nRoot cause: cowork_sessions stored only model (the wire id). The session picker then resolved the selected row with no provider hint, and both the UI catalog and resolveApiConfigForModel first-matched whichever enabled provider listed that id earliest — DeepSeek before OpenCode. The home composer already kept providerKey in pending state, but startSession dropped it on persist; the in-session picker never kept it at all.\n\nChange:\n- Add cowork_sessions.model_provider with an idempotent first-run ALTER, mapped through CoworkSession / summaries / createSession / setSessionModel / fork.\n- IPC startSession and setSessionModel now carry modelProvider; CoworkView, CoworkSessionDetail, and Bot Browser pass the picker provider through.\n- CoworkRunner Claude and DSH routes use the stored provider hint when a session override is set, so the next turn actually hits OpenCode instead of DeepSeek.\n- ModelEffortPicker suffixes the trigger with the provider name when the same model id appears under more than one group.\n\nTests: catalog hint for OpenCode vs DeepSeek, resolveApiConfigForModel hint on the same collision, store round-trip for modelProvider on getSession / listArchivedSessions / listSessions / createSession. compile:electron clean; targeted tests green.\n\nFiles: src/main/coworkStore.ts, src/main/libs/coworkRunner.ts, src/main/main.ts, src/main/preload.ts, src/renderer/components/ModelEffortPicker.tsx, src/renderer/components/cowork/CoworkSessionDetail.tsx, src/renderer/components/cowork/CoworkView.tsx, src/renderer/features/botBrowser/BotBrowserCoworkPanel.tsx, src/renderer/services/browserCowork.ts, src/renderer/types/cowork.ts, src/renderer/types/electron.d.ts, tests/archivedSessionList.test.mjs, tests/claudeSettingsModelResolution.test.mjs, tests/modelCatalog.test.ts\nBranch: fix/cowork-opencode-model-selector\nProject: IDBots","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}