Commit Graph

314 Commits

Author SHA1 Message Date
NCBM f5b566b371 core/tools: add per-turn guard requiring lineno read before edit_lineno 2026-07-29 01:40:31 +08:00
NCBM 39ecd55ddd cli: fix limit prompt redundancy and line-break 2026-07-29 01:38:04 +08:00
NCBM 60f9c9b56d core/agent: danger classification overrides YOLO tag in confirm pipeline 2026-07-29 01:37:17 +08:00
NCBM 904ac3d982 core/agent: remove turn-start todo nag -- nag only fires after complete turn 2026-07-29 01:07:59 +08:00
NCBM f60fd876c6 test: update for kind-based dispatch and remove ResponsesChatClient references 2026-07-29 00:46:08 +08:00
NCBM f0c27bf366 core: wire kind-based dispatch through agent, runtime, and state 2026-07-29 00:40:23 +08:00
NCBM 4562eaa1cb core/agent: remove ChatClient protocol and ResponsesChatClient wrapper 2026-07-29 00:36:19 +08:00
NCBM 6eaadd6ebf core/lmproto: add kind property to all clients + AnyLLMClient type 2026-07-29 00:34:42 +08:00
NCBM 49e878fe3a core/lmproto: add Anthropic messages models, config, and client 2026-07-29 00:33:58 +08:00
NCBM 200bde0bfb core/todo-nag: inject reasoning_content on synthetic assistant messages
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.
2026-07-29 00:03:04 +08:00
NCBM 0ce9ed84a0 core/agent: suppress end-of-turn todo nag on retry when turn-start pair survived 2026-07-28 23:52:06 +08:00
NCBM a83c67ba6d test/agent: cover synthetic_tool todo nag retry detection
Adds 7 unit tests for _synthetic_todo_pair_after and committed_prefix_end
with synthetic todo nag pairs: survival across rollback, detection at
correct index, immunity to real tool calls, and multiple rollbacks.

These directly verify the guard that prevents duplicate turn-start
nag injection on /retry when a synthetic pair from a previous failed
attempt survived rollback (committed tool batch).
2026-07-28 23:45:27 +08:00
NCBM 3a5c715e8f core/deepseek: inject thinking parameter to satisfy API reasoning mode requirement
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.
2026-07-28 23:32:02 +08:00
NCBM fc98b080e1 core/agent: skip duplicate synthetic todo nag injection on retry 2026-07-28 22:44:21 +08:00
NCBM 9600d2f757 core/lmproto: coerce developer role for chat completions 2026-07-28 22:16:36 +08:00
NCBM c7ee9b0063 test/config: cover model-level preset routing 2026-07-28 21:45:59 +08:00
NCBM 3b72698e14 core/runtime: route clients by model-level preset 2026-07-28 21:44:12 +08:00
NCBM 68025ca626 core/config: model-level preset and url overrides 2026-07-28 21:42:48 +08:00
NCBM 0ca92dfd7e core/config: networking ssrf_assume_public_cidrs for fetch Fake-IP 2026-07-24 20:20:30 +08:00
NCBM f3cefccefc test/memory: cover session context usage fields 2026-07-24 19:41:37 +08:00
NCBM 6b8874b26d core/cli: wire directive reminder config and status 2026-07-24 19:41:06 +08:00
NCBM e3e0cf2080 core/agent: append-only directive checkpoints on token bands 2026-07-24 19:40:37 +08:00
NCBM f473fed708 core/memory: persist session context usage and reminder band 2026-07-24 19:33:45 +08:00
NCBM 6cf8902c57 docs: document fetch network tool 2026-07-24 19:09:07 +08:00
NCBM f5a667567d test/tools: cover fetch SSRF, methods, and user-agent 2026-07-24 19:08:10 +08:00
NCBM 05fe1b4070 core/cli: wire fetch private-host policy confirm 2026-07-24 19:07:39 +08:00
NCBM d74b03923f core/tools: add fetch tool with SSRF policy and catalog wiring 2026-07-24 19:07:08 +08:00
NCBM acdc62f2a9 release: plyngent 0.2.0 v0.2.0 2026-07-24 17:51:43 +08:00
NCBM 908e68665b core/agent: run_aside side turns; CLI /btw with --tools 2026-07-24 17:42:34 +08:00
NCBM 559a3410bc core/config: write LF strings as TOML multi-line literals 2026-07-24 17:21:50 +08:00
NCBM da4d3d097a core/config: persist provider models as TOML inline tables 2026-07-24 17:11:39 +08:00
NCBM 03e04f9a38 core/cli: plugins list/enable/disable commands and /plugins slash 2026-07-24 16:44:44 +08:00
NCBM 1d718582ac core/tools: drop process workspace/todo globals; require bound state 2026-07-24 16:32:33 +08:00
NCBM 4215a8cea0 core/config: top-level [plugins] enable/disable allowlist 2026-07-24 16:19:50 +08:00
NCBM 278c930fae docs: tool plugins guide and config cross-links 2026-07-24 16:05:10 +08:00
NCBM ac3230647a test/agent: bind todo tools via SessionState instead of process global 2026-07-24 16:00:17 +08:00
NCBM 8baaa3f2e1 core/tools: hang workspace policy on InstanceState 2026-07-24 15:58:55 +08:00
NCBM 6c6cec05c4 core/cli: bind todo persist via session state, not process global 2026-07-24 15:49:57 +08:00
NCBM 3c0eb8ffad core/tools: session on_todo_change and MemoryViewStore seed helpers 2026-07-24 15:47:57 +08:00
NCBM 7a3704edc1 core/tools: resolve_path accepts instance workspace root 2026-07-24 15:41:59 +08:00
NCBM 90c07061f3 core/tools: persist soft-confirm grants under session.data 2026-07-24 15:41:39 +08:00
NCBM 3d5380a3d4 core/tools: todo tools commit via session.data transactions 2026-07-24 15:31:26 +08:00
NCBM e82a226f91 core/tools: serialize domain objects on PersistentDataView commit 2026-07-24 15:31:06 +08:00
NCBM 96518974be core/tools: allowlisted entry-point plugin loader 2026-07-24 15:09:11 +08:00
NCBM 07e3c5caa5 core/tools: PTY tools use instance-aware manager facade 2026-07-24 15:06:18 +08:00
NCBM 662e95f693 core/cli: /tools --list shows tags and catalog source 2026-07-24 15:04:33 +08:00
NCBM 7253ca84dd core/tools: prefer instance workspace and session todo views 2026-07-24 15:02:52 +08:00
NCBM 12c8adda3a test/tools: catalog, grants, and async tool helpers 2026-07-24 14:57:03 +08:00
NCBM 2f6133f685 core/cli: catalog select, session state, tag-aware yolo 2026-07-24 14:56:48 +08:00
NCBM 15dde7cdaf core/tools: async builtins with policy tags 2026-07-24 14:56:33 +08:00