Repository navigation
v0.17.1
v0.17.1 — Kimi/Moonshot fixes, indexing performance, auto-update reliability
What's Fixed
Kimi/Moonshot 400 errors
Two related fixes for openai-compatible providers (Kimi, Moonshot, etc.) that previously rejected requests with errors like the message at position N with role 'assistant' must not be empty or reasoning_content is missing.
- Empty assistant message rejection. Whole-message sentinels for non-Anthropic providers now use
[dropped]instead of"". Anthropic still gets empty content because its SDKnormalizeMessagesfilters those out cleanly. Other openai-compatible backends serialize empty content into the wire request and reject it. - Empty
reasoning_contentrejection on tool-call assistants. The Anthropic groupIntoBlocks workaround (stripReasoningFromMergedAssistants) is now strictly Anthropic-only. For Kimi/Moonshot, every assistant tool-call message now keeps its originalreasoning_contentinstead of being stripped to satisfy a rule that doesn't apply.
These fixes preserve cache stability — both gates use the same per-pass deterministic provider check, with no oscillation across passes.
Auto-update checker — actually fires now
The previous auto-update checker gated all work on a session.created event. In real usage that gate almost never triggered:
- TUI restart with a resumed session never fires
session.createdfor that session. - Multi-project plugin reloads each got their own plugin lifetime with a fresh
hasChecked=false, so only the project that happened to create a brand-new session first ever ran the check. - Sidebar/status polling and idle TUI use never trigger
session.created.
Message-history indexing — major perf and lock fix
Reconciliation was previously building a Set of every indexed message ID for the session inside a write transaction (~30 k+ rows on long-lived sessions). That held the SQLite writer lock long enough to produce intermittent SQLITE_BUSY stack traces during steady-state operation — about 78 lock errors over 4 hours of active use on the development DB.
The fix removes that bulk SELECT entirely. The lastIndexedOrdinal watermark already encodes "every ordinal ≤ N has been processed," so any message above the watermark is by definition unindexed. The reconciliation transaction now contains only the actual inserts. A UNIQUE(session_id, message_id) constraint catches the rare partial-reconciliation duplicate; other errors still propagate.
Async indexing also tolerates residual BUSY now: a one-line warning is logged and reconciliation catches up on the next pass automatically, instead of producing stack traces.
Internal
@opencode-ai/plugin and @opencode-ai/sdk bumped to ^1.14.39
Both were pinned at ^1.2.26, twelve minor versions behind the current 1.14.39. The API change between them is purely additive (new optional hooks, experimental_workspace, provider?: ProviderHook, more typed event payloads) — no removals affect existing code. Bumped to keep the door open for newer hooks in future releases.
Upgrade
- Run
npx @cortexkit/magic-context@latest doctor --forceto refresh the OpenCode plugin cache and pull v0.17.1. - No config changes required.
- No migrations triggered by this release.
Notes for power users
The 5-second auto-update window is configurable via the initDelayMs option, and the cross-process dedup interval via checkIntervalMs (default 1 hour). Both are passed through createAutoUpdateCheckerHook in packages/plugin/src/hooks/auto-update-checker/. For end users no action is needed — the defaults are fine.