Commit Graph

537 Commits

Author SHA1 Message Date
NCBM 6ec7b4de12 cli/interrupt: route SIGINT through a session handler
A SIGINT delivered while the event loop is parked in its selector is raised in
the loop's own frame: it escapes run_until_complete, the Runner cancels the main
task, and the REPL is left half-shut-down (no prompt, and the next line the
human types is eaten by an abandoned prompt reader) until the following Ctrl+C
kills the process. Off-loop prompts (ask_user_* / wait / tool confirms run in a
worker thread via asyncio.to_thread) and the auto-retry countdown are the usual
windows.

Keep one asyncio-level SIGINT handler installed for the whole session instead:
it cancels the innermost registered target (run_cancellable registers the turn
task, sleep_cancellable the retry countdown, off_loop_prompt the waiting prompt)
and never raises. Reads that block on the main thread inside a coroutine (the
REPL entry prompt, synchronous click prompts) suspend the router and take SIGINT
as a KeyboardInterrupt. Off-loop readline prompts cannot be interrupted without
abandoning their reader thread on stdin, so they ignore SIGINT with a one-line
hint.
2026-09-22 19:16:05 +08:00
NCBM 0790b5dd9f runtime/mcp: spawn servers in their own process group
A terminal Ctrl+C is delivered to every process in the foreground process
group, so a server spawned in our group died on any Ctrl+C during a turn -
killing in-flight tool calls and leaving the connection dead until
/mcp reconnect. start_new_session (POSIX) / CREATE_NEW_PROCESS_GROUP
(Windows) puts each server in its own session/group instead.

Tests assert the spawned server's process group and session differ from the
CLI's (they used to be the same group).
2026-09-19 11:05:33 +08:00
NCBM a9f77a3b96 docs: document wait shape checks and missing-argument errors 2026-09-19 09:51:25 +08:00
NCBM f94d9a6f49 agent/tools: report missing required arguments before running 2026-09-19 09:50:13 +08:00
NCBM cb35e3b105 tools/chat: shape-check the wait duration and reason 2026-09-19 09:44:43 +08:00
NCBM 9224241841 docs: document ask-family argument shape checks 2026-09-19 09:39:08 +08:00
NCBM 86d90bfeb1 tools/chat: return shape errors for mis-typed ask-family arguments 2026-09-19 09:37:25 +08:00
NCBM 55b25b5068 docs: document host notices, restart resume, and /btw scope 2026-09-19 09:25:18 +08:00
NCBM 8b9233090f cli/btw: tell the model side questions are unsaved and tool-scoped 2026-09-19 09:24:38 +08:00
NCBM 8a8de1b018 cli: notify the model when a session resumes after a restart 2026-09-19 09:20:59 +08:00
NCBM bd18a88370 agent/notices: host notices as trailing developer messages 2026-09-19 09:15:13 +08:00
NCBM e0913e60a4 docs: document the retry budget and its reset 2026-09-14 22:10:09 +08:00
NCBM 47331fed48 cli/retry: reset the auto-retry budget after a recovered round 2026-09-14 22:09:53 +08:00
NCBM 4ef96daa7d docs: document in-progress pretty tool lines 2026-09-14 22:03:17 +08:00
NCBM e50cbfb46f cli/display: show pretty tool calls while they run 2026-09-14 22:01:20 +08:00
NCBM ef8d74a92a release: plyngent 0.6.0 v0.6.0 2026-09-09 22:58:03 +08:00
NCBM 3fa05a86c6 docs: document limit auto-continue (yyy) 2026-09-09 22:48:16 +08:00
NCBM 18cbcf6835 cli/config: --auto-continue flag and [agent] auto_continue_limits 2026-09-09 22:47:39 +08:00
NCBM aba3765def cli: reset auto-continue at turn boundaries 2026-09-09 22:46:19 +08:00
NCBM 685370d3cb cli/limits: yyy turn-scoped auto-continue for limit prompts 2026-09-09 22:44:20 +08:00
NCBM af1e4a4770 docs: document directory access grants 2026-09-09 22:24:44 +08:00
NCBM a1f106a5e2 cli: directory access confirm, /grants, and session grants 2026-09-09 22:23:25 +08:00
NCBM 22f52a0bd2 config: [agent] allow_paths static pre-allow 2026-09-09 22:19:23 +08:00
NCBM d17c80b07e memory: persist session access grants 2026-09-09 22:17:34 +08:00
NCBM 49d1e08ebe tools: request_directory_access and grant stores 2026-09-09 22:16:22 +08:00
NCBM ba021cb138 tools/workspace: mode-aware path grants and escape hint 2026-09-09 22:11:50 +08:00
NCBM 66c58cf156 release: plyngent 0.5.0 2026-09-08 14:30:44 +08:00
NCBM a1455989f2 docs: document MCP initialize instructions folding 2026-09-08 13:09:41 +08:00
NCBM 4f142f1db9 cli: fold MCP initialize instructions into agent prompt and /mcp 2026-09-08 13:09:32 +08:00
NCBM 5f28a49bc1 config: add [agent] mcp_instructions and variadic system compose 2026-09-08 13:09:23 +08:00
NCBM a4baf38a52 runtime: capture MCP initialize instructions per connection 2026-09-08 13:09:14 +08:00
NCBM c638f6a5da docs: rename CLAUDE.md to AGENTS.md 2026-09-08 12:59:26 +08:00
NCBM ede614aa9e gitignore: add .codegraph index directory 2026-09-08 12:58:13 +08:00
NCBM 41ba0f9dda docs: document MCP server config, runtime, and /mcp command 2026-09-08 12:19:54 +08:00
NCBM 4916494e44 cli: start MCP servers around chat and add /mcp slash command 2026-09-08 12:18:35 +08:00
NCBM d603615d6a tools: register MCP server tools in the catalog (mcp source, purge) 2026-09-08 12:06:34 +08:00
NCBM 7967095dbc runtime: MCP stdio client and per-process connection manager 2026-09-08 12:02:16 +08:00
NCBM dd70d02491 config: [mcp] section with server definitions and disable gate 2026-09-08 11:53:19 +08:00
NCBM 7c377a1a53 core/tools: two-line wait prompt with reason input and colors 2026-08-17 17:42:32 +08:00
NCBM 0a0f05ad14 cli: restore line range in read_file pretty summary 2026-08-17 17:33:55 +08:00
NCBM ab8828f7b6 release: plyngent 0.4.1 v0.4.1 2026-08-15 18:45:09 +08:00
NCBM 95a48873c1 cli: pretty printed summary for wait tool 2026-08-15 18:42:31 +08:00
NCBM e27effcefe cli: pretty printed summaries for vcs_status and vcs_log 2026-08-15 18:37:12 +08:00
NCBM 8e8a10a05e cli: reduce pretty summaries to minimal done/error semantics 2026-08-15 18:36:21 +08:00
NCBM 5344a20b67 cli: pretty printed summaries for file mutation tools 2026-08-15 18:09:52 +08:00
NCBM aeae99a496 cli: pretty printed summary for fetch with HTTP status coloring 2026-08-15 18:09:05 +08:00
NCBM 259dd87c43 cli: pretty printed summaries for run_argv and run_argv_batch 2026-08-15 18:08:28 +08:00
NCBM 6f939e52b2 cli: pretty printed summaries for listdir, glob_paths and grep_files 2026-08-15 18:06:36 +08:00
NCBM 41ce98bf42 cli: style pretty tool summaries, verbose shows full results, preview shows first line 2026-08-15 18:05:40 +08:00
NCBM 5436457ac0 core/tools: allow edit_lineno append to an empty file
Appending via edit_lineno required the last line to be read, which made
writing to an empty file impossible (line 0 does not exist). An empty
file has nothing to clobber, so the append needs no prior read.
2026-08-15 17:41:06 +08:00