Commit Graph

228 Commits

Author SHA1 Message Date
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
NCBM 4feb0e0d26 core/tools: catalog, tags, state context, and PersistentDataView 2026-07-24 14:56:19 +08:00
NCBM 30beec6600 core/config: split agent system_prompt and tool_directives 2026-07-21 22:55:51 +08:00
NCBM db7c097466 test/cli: isolate oneshot chat from user-data database 2026-07-21 22:44:26 +08:00
NCBM b06bb1d409 core/agent: shift persist_from when prepending system prompt 2026-07-21 22:44:09 +08:00
NCBM b51d4780ab core/agent: refresh synthetic_tool todo nags to live stack 2026-07-21 22:42:27 +08:00
NCBM 6d74d31cea core/config: default system prompt for coding agent tools 2026-07-20 18:21:27 +08:00
NCBM 767578723e core/runtime: configurable provider HTTP request timeouts 2026-07-20 18:08:27 +08:00
NCBM 71b9f91e14 core/agent: keep more recent tool results in soft-compact
Raise DEFAULT_RECENT_TOOL_RESULTS from 4 to 12 so near-term tool
payloads stay full-size longer when trimming older dumps for context.
2026-07-20 17:34:01 +08:00
NCBM 879e28ea4c core/agent: synthetic_tool review always when stack non-empty
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).
2026-07-20 16:20:01 +08:00
NCBM 614ffaaf8f ci: publish only after CI check succeeds
Merge release into ci.yml: tag pushes run check then publish (needs:
check). Remove standalone python-publish so PyPI never ships on red CI.
Retag (delete+push v*) still retriggers the pipeline.
2026-07-20 04:44:57 +08:00
NCBM 7bdd9ff8b7 chore: pin ruff and basedpyright for prek and lockfile
Match prek additional_dependencies and pyproject dev pins to pdm.lock
(ruff==0.15.22, basedpyright==1.39.9). Format fix for ruff 0.15.22.
2026-07-20 04:35:26 +08:00
NCBM bec14e76af release: plyngent 0.1.3
Bump package version; refresh lock (ruff 0.15.22, platformdirs 4.10.1).
prek.toml already tracks latest ruff/basedpyright via additional_dependencies.
v0.1.3
2026-07-20 04:30:07 +08:00
NCBM 59017fd61b core/agent: synthetic_tool nag uses real todo_list render body
developer/user keep OPEN WORK prose; synthetic_tool injects forged
todo_list call with stack.render() only so the result matches a real
tool output.
2026-07-20 04:10:21 +08:00
NCBM 2e6cb3834a core/agent: drop system todo nag; emit events for synthetic_tool
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.
2026-07-20 03:55:50 +08:00
NCBM f6d14ed549 core/agent: configurable todo nag strategies
Add [agent] todo_nag_strategy: developer (default), system, user,
synthetic_tool (forged todo_list pair), or none. Shared inject helper
used for turn-start and end-of-turn nags; CLI wires agent config.
2026-07-20 03:33:02 +08:00
NCBM a4ab11c9a2 core/agent: stronger open-work signals in todo stack prompts
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.
2026-07-20 03:17:44 +08:00
NCBM 0d783b6d96 core/tools: claim PTY controlling TTY after setsid (sudo without -S)
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.
2026-07-20 03:15:56 +08:00
NCBM d6616d0da3 core/tools: timed human allow for denylisted commands
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.
2026-07-20 03:02:34 +08:00
NCBM a677e06af4 core/tools: add ask_into_pty for human-local PTY input
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.
2026-07-20 02:47:19 +08:00
NCBM aadcd237db core/cli: soft-fail GET /models cancel/timeout on provider switch
Map CancelledError and TimeoutError from models() to RuntimeError so
merged_model_choices falls back to config/cache. Stub remote fetch in
/provider unit tests so they never hit the network.
2026-07-19 22:38:22 +08:00
NCBM 58ff646034 core/cli: config open via VISUAL/EDITOR or system default
Prefer $VISUAL then $EDITOR (blocking). Without either, fall back to
xdg-open / open / startfile (non-blocking) for config paths only.
/edit stays blocking-only so the temp buffer can be re-read.
2026-07-19 22:33:02 +08:00
NCBM d528f65c4c core/tools: edit_replace max_replaces and richer match messages
Default still replaces first match only. Report how many matches were
found, how many replaced, and remaining hits so agents can raise
max_replaces or narrow old_string.
2026-07-19 21:55:16 +08:00
NCBM 0ec0d542e8 core/cli: keep database url :memory:; default url None
Unset/empty url still maps to durable user-data chat.db.
Explicit :memory: is not rewritten; CLI warns when not quiet.
DatabaseConfig.url default is None; engine treats None as memory.
2026-07-19 21:38:21 +08:00
NCBM 182546d60e core/tools: narrow list[object] for batch command argv typing
basedpyright treated bare list elements as Unknown after isinstance(list);
cast to list[object] so prek basedpyright exits clean.
2026-07-19 20:39:16 +08:00
NCBM e1e4df0f3f core/agent: strengthen todo prompts when stack not empty
Inject turn-start [TODO REMINDER] for non-empty stacks; rewrite end-of-turn
[TODO OPEN] copy so open items read as unfinished work. needs_review now
always true while open items remain (even if todo_* ran this turn); terminal-only
stacks still need review if untouched. Update tool docs and tests.
2026-07-19 20:34:01 +08:00
NCBM a54fa534f3 test/tools: clean shell confirm format test 2026-07-19 13:05:43 +08:00
NCBM fa9f28687f test/tools: fix shell confirm format test syntax 2026-07-19 13:02:24 +08:00
NCBM 95f277eda7 core/tools: shell confirm argv uses $(command); full -c body indented 2026-07-19 13:01:06 +08:00
NCBM f13ea9f316 core/tools: soft-confirm file overwrite only, not partial edits 2026-07-19 03:05:01 +08:00
NCBM f51d11d46f core/tools/process: add run_command_batch with pipe_out and mix_stderr 2026-07-19 02:46:21 +08:00
NCBM 5b51de12e0 core/cli: skip blocking GET /models on chat ready
Only fetch remote catalog when interactive model pick needs it; otherwise
use config/--model/session and warm Tab cache in the background. Cap list
fetch at 5s so a dead API cannot hang startup.
2026-07-19 02:08:58 +08:00
NCBM d473cd2508 project: bump version to 0.1.2 v0.1.2 2026-07-18 19:43:33 +08:00
NCBM badcb3c9f3 core/cli: fix Ctrl+C after mid-turn prompts (SIGINT cancel)
asyncio signal handlers freeze ContextVars at install time; reinstalling
while allow_task_cancel was still False left cancel permanently disabled.
Use a process-level prompt depth counter and reinstall only after depth=0.
2026-07-18 19:31:40 +08:00
NCBM fc74b271bd core/cli: richer Tab completion for slash commands
Complete /todos actions and todo ids, session ids for /resume|/delete
(from cache after /sessions), /rounds hints, and --flags. Pass prior
tokens so multi-arg completion works.
2026-07-18 19:04:45 +08:00
NCBM 1012894f0d core/cli: multi-line boxed tool confirm prompts
Echo a terminal-width box with wrapped reason (argv / -c code) before a
short Allow? y/N prompt so shell confirms are not jammed on one line.
2026-07-18 18:41:00 +08:00
NCBM 020e9215bf tools: new_temporary_workspace with cross-platform allowlist
Create scratch dirs under system temp (tempfile), allow absolute paths
under them without rebinding the project workspace or session. Cleanup
owned temps on chat exit. Cap 16 concurrent temps; sanitize prefix.
2026-07-18 18:16:06 +08:00