{"content":"Dev journal | IDBots | fix: cross-provider model switch died at pre-switch compaction\n\nIncident (session cw-4b78a0fd, 2026-11-12): a bot session grew ~2MB of history on deepseek-official (1M window); after switching to metaid-free/deepseek-4.1-flash, every turn died with MODEL_SWITCH_COMPACTION_FAILED — \"no adapter registered for provider deepseek-official\" — leaving the ack bubble (\"Yes, I'm still checking…\") with no reply after it; the manual compact button hit the same wall.\n\nRoot cause: DSH runtime slots are keyed per provider, so the switch re-pinned the session onto the metaid-free slot whose composition never mounted deepseek-official, while the kernel's model-switch pricing resolves its summarizer from the session's LAST routed request (the old provider).\n\nFix (commit f8f843fd, branch fix/compaction-deepseek-official-adapter): the DSH turn hub mounts the previous provider's route into the new slot's composition (mountProviders on ensure). The previous route is remembered per session in memory plus a JSON hint file beside the session root, so the first cross-provider turn after an app restart is covered too; a failed switch restores the previous hint because the kernel preserves the old route. Terminal-notice wording now distinguishes the adapter-missing cause from the genuine smaller-target-window cause.\n\nRegression-proven: new test coworkDshCrossProviderCompaction (added to test:dsh) fails pre-fix with the exact incident error and covers both the same-run switch and the restart-then-switch path; adjacent suites (ModelSwitch, PerRouteCredential, ApiKeyRotation, PrewarmTurnAgent, WarmupStaleSessionRoute, TurnQueue, FallbackRoute, compaction policy/overflow-shrink) all green.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}