DeepSeek's reasoning API enforces: if an assistant with tool_calls sits
between two user messages, its reasoning_content must be passed back.
The synthetic todo nag pair creates an AssistantChatMessage with tool_calls
but no reasoning_content, which triggered a 400 error:
"The reasoning_content in the thinking mode must be passed back to the API."
Fix:
1. _append_synthetic_todo_list now sets reasoning_content="" so NEW pairs
carry the field.
2. refresh_synthetic_todo_nags runs _inject_reasoning_content_for_synthetic
to fix EXISTING pairs (in DB) even if reasoning_content was UNSET.
3. The earlier _inject_thinking change is reverted in the next commit since
the real root cause was the missing reasoning_content on forged tool_call
messages, not the thinking parameter itself.
DeepSeek's reasoning model requires the `thinking` parameter to be
explicitly set in every request (default is enabled). The agent loop
constructs the base ChatCompletionsParam which lacks this field, so the
DeepseekOpenAIClient now injects `thinking: {type: "enabled"}` into the
JSON request body after msgspec encoding.
Fixes the HTTP 400 error:
"The `reasoning_content` in the thinking mode must be passed back to the API."
which occurred when a cancelled turn was retried and the request history
contained assistant messages with reasoning_content but no thinking param.
needs_review is true for any non-empty stack so end-of-turn inject
keeps firing under synthetic_tool. Message history keeps only the last
todo-nag tool pair (dedupe by todo-nag- tool_call_id).
Remove system strategy (legacy maps to developer). synthetic_tool still
forges the call but uses real stack text as the tool result, and now
yields ToolCall/Result events so the CLI flushes and does not glue nag
text to the next assistant stream.
Split tags: [TODO OPEN WORK] for pending/in_progress (undone work) vs
[TODO HYGIENE] for all-terminal leftover groups. End-of-turn review lists
open titles; tool docs stress open items as unfinished work.
After setsid(), ioctl(TIOCSCTTY) (or reopen slave) so the session leader
has a real controlling terminal. Live-tested: open_pty([sudo,echo,test])
shows a password prompt; ask_into_pty + read_pty yields test with exit 0.
Denylist hits ask the user (default deny, timeout) instead of only hard
rejecting when a policy hook is installed. Independent of YOLO soft-confirm;
session grants skip re-prompt for the same basename. CLI installs the hook
via install_cli_limit_hooks.
Prompt the human (optional no-echo secret) and write only to the PTY.
Tool results never include the answer so secrets stay off external APIs.
Empty/Ctrl-C cancel without writing; submit defaults to trailing newline.