Commit Graph

560 Commits

Author SHA1 Message Date
NCBM 0dd70ff31b core/cli: prompt for a round's tool calls once
prompt_confirm_batch_async answers a ToolBatchConfirmHook with one box that numbers every call the round wants to make (continuation lines stay under their entry). The prompt is the plain ``Allow these N tool calls?`` confirm: a deny offers the same one comment for all of them, a non-interactive host denies, and the next round asks again.

The ReplState registry installs the hook next to the per-call one, and format_tool_confirm_box now shares the box drawing with the batch header.
2026-10-17 17:32:44 +08:00
NCBM 86596633e8 core/agent: confirm a round's mutating calls in one prompt
ToolRegistry.prepare_batch_confirm pre-scans a round of tool calls, drops the ones that cannot run (unknown tool, undecodable arguments, missing required argument), and turns two or more soft reasons into a single ToolBatchConfirmHook prompt. The BatchConfirmDecision it returns is applied per call through execute(..., decision=...): allow, or deny with one comment shared by every call of that round.

_execute_tool_calls asks before it gathers, so a batch of moves or deletes no longer stacks one confirm box per call. A single request keeps the old one-call prompt, a host without a batch hook keeps the per-call behaviour, and the answer never outlives the round it was asked in.
2026-10-17 17:32:44 +08:00
NCBM f4c0c45403 docs: describe the compact summarizer tool notice 2026-10-17 17:13:49 +08:00
NCBM f5cff9d90d core/agent: tell the compact summarizer that tools are unavailable 2026-10-17 17:13:42 +08:00
NCBM eef1d3cd29 docs: describe fetch/fetch_local and the DeepSeek search default 2026-10-17 17:08:11 +08:00
NCBM 9742a1ae7a core/config: default the local search to DeepSeek only 2026-10-17 17:06:56 +08:00
NCBM cfe36b024b core/tools+cli: split fetch into remote fetch and fetch_local 2026-10-17 17:06:43 +08:00
NCBM 37e130a7dc docs: describe the DeepSeek Search API backend 2026-10-17 16:52:40 +08:00
NCBM cb19652b2a core/tools+config: search through the DeepSeek Search API 2026-10-17 16:52:31 +08:00
NCBM 7a4205a588 core/lmproto: add the DeepSeek Search API client 2026-10-17 16:52:20 +08:00
NCBM 2054423ebb release: plyngent 0.9.1 v0.9.1 2026-10-16 22:31:50 +08:00
NCBM 3c8ca5fcde docs: describe the truncated-round continuation 2026-10-16 22:29:35 +08:00
NCBM 3cd95504c6 core/agent+cli: keep a round cut off at the output limit 2026-10-16 22:29:25 +08:00
NCBM 3c555278d5 docs: describe the disabled-thinking fallback 2026-10-16 22:16:35 +08:00
NCBM f39ec5fb1a core/agent+anthropic: drop the thinking block a model refuses to disable 2026-10-16 22:16:25 +08:00
NCBM 06a5bafab7 docs: describe the adaptive-thinking retry 2026-10-16 22:12:09 +08:00
NCBM 9156df2b02 core/agent+anthropic: retry a refused thinking budget as adaptive thinking 2026-10-16 22:12:00 +08:00
NCBM 3e7acbaf18 release: plyngent 0.9.0 v0.9.0 2026-10-16 19:46:54 +08:00
NCBM c55c5be779 deps: refresh the lock (sqlalchemy 2.1.4, platformdirs 4.13.3, tomlkit 0.15.2, pywinpty 3.1.0) 2026-10-16 19:46:44 +08:00
NCBM b0afed612f docs: describe the same-file write ordering of a batch 2026-10-16 19:37:38 +08:00
NCBM 85b0318b77 core/agent+tools: apply a batch's same-file writes in call order 2026-10-16 19:37:29 +08:00
NCBM ab6b5d590c docs: describe the escape error's access mode 2026-10-16 19:29:20 +08:00
NCBM 1c84d63f37 core/tools+config: name the access mode in the workspace escape error 2026-10-16 19:29:11 +08:00
NCBM a4f852eec6 docs: describe the batch command listing 2026-10-16 19:08:24 +08:00
NCBM 6232925c2c cli/display: list a batch's commands above the '* Run batch' row 2026-10-16 19:08:14 +08:00
NCBM 60dd96329d docs: describe the numbered todo listing 2026-10-16 18:53:10 +08:00
NCBM 3bc585ad3d docs: describe the write_file overwrite rule 2026-10-16 18:52:59 +08:00
NCBM 2eb99a079d core/agent+tools+cli: number todos by listing order, not the internal id 2026-10-16 18:52:36 +08:00
NCBM ac33e92d33 core/tools+config: refuse write_file overwrite unless overwrite=true 2026-10-16 18:44:14 +08:00
NCBM 8729330120 core/skills: announce the skill tools in a notice, not a catalog 2026-10-09 21:40:45 +08:00
NCBM e72d2359d7 core/skills: read the filesystem live, drop the cache and reload 2026-10-09 21:40:38 +08:00
NCBM 1f04889449 cli/skills: open the skill directory instead of printing SKILL.md 2026-10-09 21:40:27 +08:00
NCBM 64a8cf7062 docs: drop the /clear references 2026-10-09 21:15:55 +08:00
NCBM 6807055b9f cli/slash: remove the /clear command 2026-10-09 21:15:48 +08:00
NCBM 287b838db9 docs: drop the multi-tenant router plan 2026-10-09 21:15:07 +08:00
NCBM d3f8132b5d core/agent: note the live-probe result for the echoed blocks
A search round goes back with and without a local `tool_use` after its blocks: the endpoint takes both, and the model answers from the results it already holds. With the blocks stripped it calls its own earlier answer fabricated instead. The note sits where the ordering decision lives, so the shape needs no re-probe.
2026-10-09 20:15:38 +08:00
NCBM b0116a67c1 docs: describe the kept provider blocks 2026-10-09 20:09:43 +08:00
NCBM f89c8dec31 lmproto/openai_compatible: drop provider blocks on a chat wire
`provider_blocks` means something only to the surface that produced them (Anthropic `thinking` / server-tool blocks). A session that switched surface would otherwise send those dicts to a chat-completions provider as an assistant-message key it does not know; the request normalization drops the field, on a copy, so the history keeps it.
2026-10-09 20:09:36 +08:00
NCBM 7a54642ecf core/agent: rebuild a streamed round's provider blocks
Streaming is the default path: `thinking` fragments, a `server_tool_use`'s `partial_json` query and a `web_search_tool_result`'s entries arrive as separate SSE events, so the blocks the round has to hand back exist only as fragments. The dispatch rebuilds each one from its start payload (field for field, under the stream's own names) plus the fragments that follow, and passes it to the loop as a chunk; the loop copies it onto the round's message, where a round that kept only those blocks counts as payload rather than an empty completion.

The thinking text streams as reasoning as it arrives — the search query and the signature go back with the round only.
2026-10-09 20:09:29 +08:00
NCBM 2fdbc3ce5d core/agent: keep a Messages round's provider blocks on the assistant message
DeepSeek's Anthropic compat answers a hosted search inside the turn: the response carries the `thinking` that picked the query, the `server_tool_use`, and the `web_search_tool_result`. The response mapping kept text and tool_use only, so the round lost its evidence — and the `thinking` signature, which only the provider can verify, could not go back at all. `AssistantChatMessage.provider_blocks` carries those blocks as raw JSON now (`thinking` text *and* signature, the query, the result entries with an `encrypted_content` the API rejects when trimmed) and the assistant turn hands them back first, ahead of its text and tool_use blocks; `thinking` also lands in `reasoning_content`, so the chain of thought streams as reasoning like every other surface's.

`AnthropicRawContentBlock` names the provider fields a streamed block carries, and `AnthropicServerToolUseContent` keeps the `caller` metadata the wire sends.
2026-10-09 20:09:20 +08:00
NCBM 6c4c8b9328 core/tools: edit_lineno rejections name the read_file call 2026-10-09 19:46:16 +08:00
NCBM 279cbe9389 core/tools: document fetch's 0-based body offset 2026-10-09 19:46:09 +08:00
NCBM 38e2dd58b0 core/config: state the 0-based offsets of skill_read and fetch 2026-10-09 19:46:02 +08:00
NCBM a89543fd35 release: plyngent 0.8.0 v0.8.0 2026-10-07 00:51:49 +08:00
NCBM 9296242881 ci/lint: ignore PLR0917 like PLR0913 2026-10-07 00:47:56 +08:00
NCBM 5a7bd55f2d lmproto: keep None last in the optional unions 2026-10-07 00:47:20 +08:00
NCBM c56449bfce deps/dev: upgrade ruff to 0.16.10 and basedpyright to 1.40.2 2026-10-07 00:47:03 +08:00
NCBM 9fc74e1866 deps: refresh the lock (msgspec 0.22, sqlalchemy 2.1, niquests 3.21.2) 2026-10-07 00:43:54 +08:00
NCBM 6e8368c169 docs: record the complexity gate and the nested-function counting 2026-10-07 00:40:31 +08:00
NCBM e0e19fde8f ci/lint: drop PLR0912 as a duplicate of C901 2026-10-07 00:40:08 +08:00