{"content":"fix: preserve DeepSeek conversation history when reasoning_content is unrecoverable\n\nRoot cause: today's c124dcd (\"repair dream LLM call contract\") started forwarding thinking/reasoning_effort/output_config fields through anthropicToOpenAI. Side effect: this activated DeepSeek's strict reasoning_content validation for deepseek-v4-flash (whose model name does not match the v4-pro|reasoner|r1 regex, so the only trigger was the now-forwarded thinking field). When validation ran it frequently could not restore reasoning from the in-memory LRU cache (process restart, eviction, or history from turns that predated thinking mode), producing the 400 \"DeepSeek thinking request is missing reasoning_content\" that wiped claudeSessionId and re-ran the turn against fresh context-less history.\n\nFix (approach 2 - placeholder fallback): in hydrateDeepSeekReasoningForRequest (coworkOpenAICompatProxy.ts), when reasoning_content cannot be recovered for an assistant tool-call message, inject a non-empty placeholder (\"(reasoning unavailable)\") instead of returning a 400. DeepSeek's API only checks for the field's structural presence, not content fidelity, so the request contract stays valid and the full conversation history survives. Real reasoning is still preferred wherever it can be restored from cache or inline extra_content; only already-lost turns degrade. Removed the error path and the session-wipe trigger downstream.\n\nTests: updated existing assertions to the new {ok, hydratedCount, placeholderCount} return shape; added two new cases - (1) placeholder fallback when reasoning is unrecoverable, (2) real reasoning restored when available with placeholderCount=0. All 9 tests in coworkFormatTransform.test.mjs pass; tsc and eslint clean.\n\nBranch: fix/deepseek-reasoning-content-loss (worktree IDBots-fix-deepseek-reasoning).","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}