Skills 2026-09-24 19:46 UTC
monopi
Committed by ifiokjr. Update Category: Bug Fixes & Stability Improvements. Commit details: fix(adaptive-routing): restore the user's default model after routed switches (#397) (#405). This update resolves known runtime errors and enhances system reliability.
CommitRaw commit message
fix(adaptive-routing): restore the user's default model after routed switches (#397) (#405) pi persists defaultProvider/defaultModel and defaultThinkingLevel into the user's global settings.json on every model switch, so an automatic per-turn route decision silently became the next session's startup model. Capture the three persisted fields before applyDecision/applyQuotaFailover switch models and write them back afterwards via pi's own SettingsManager (same lock, and absent defaults are removed instead of keeping the routed pick). pi queues its settings writes and queue ordering across instances is not FIFO, so the restore settles with a bounded diff-write-verify loop; on pi >= 0.85, where switching no longer persists, the diff finds nothing to do and the file is left untouched.