Commit Graph

43 Commits

Author SHA1 Message Date
NCBM 4741341888 core/agent: yield stream text deltas as chunks arrive
Stop buffering the full SSE response before emitting TextDeltaEvent so
CLI/UI can render assistant output token-by-token.
2026-07-15 10:27:49 +08:00
NCBM 5b4d3985b7 core/tools/vcs: add read-only vcs_* agent tools
Expose vcs_kind/status/diff/log/branch over detect_vcs; cover git and
custom detector registration.
2026-07-15 10:22:00 +08:00
NCBM c2d132de09 core/tools/file: add grep_files regex content search
Line-oriented regex search under the workspace; skip VCS/hidden/binary
and cap match count.
2026-07-15 10:15:20 +08:00
NCBM 007efdef5a core/tools/file: add glob_paths workspace search tool
Stdlib Path.glob with VCS/hidden skip and match cap; paths relative to
workspace root.
2026-07-15 10:15:13 +08:00
NCBM 3215a5cc35 core/cli: show context char estimate in /status
Surface soft budget usage (context_chars and tool_result_max) for
Phase D without introducing a local tokenizer.
2026-07-15 10:12:01 +08:00
NCBM 001619d9dd core/cli+agent: /compact and resume latest by workspace recency
Soft-compact history, model-summarize without tools, seed a new session;
/resume with no id loads the lately-used session for this workspace.
2026-07-15 10:03:22 +08:00
NCBM 19128735a2 core/memory: order sessions by recency and touch on activity
List/get-latest by updated_at; bump updated_at when messages are
appended so workspace resume picks the lately-used session.
2026-07-15 10:03:15 +08:00
NCBM a7d9c9879b core/cli+agent: run TTY confirms off the event loop
Max-rounds and destructive-tool prompts use asyncio.to_thread with
cancel paused on the main thread so multi-tool turns no longer look
like user cancel. Hooks may be sync or async.
2026-07-15 09:41:32 +08:00
NCBM b80ebf783a core/cli+memory: prompt on session workspace mismatch
When /resume or --session hits a different directory, ask keep (switch
tools root), update binding to current, or abort. Legacy unbound
sessions attach to the current workspace.
2026-07-15 09:33:39 +08:00
NCBM 0a2dac2561 core/memory: bind sessions to workspace path with SQLite migrate
Add session.workspace column, create/list filters, and ALTER TABLE
migration for existing chat databases.
2026-07-15 00:00:50 +08:00
NCBM 566a06c996 core/cli: pause turn cancel during TTY confirm prompts
Max-rounds and destructive-tool confirms no longer cancel the in-flight
turn; SIGINT during the prompt aborts only the confirm.
2026-07-15 00:00:40 +08:00
NCBM f31032b801 core/agent+cli: wire max_context_chars and re-raise CancelledError
Propagate context budget from [agent] config; preserve cancel through
tool invoke for mid-turn interruption.
2026-07-14 23:42:55 +08:00
NCBM 5cfe4d6a24 core/agent: soft context compact and cooperative cancel points
Shrink older tool dumps for model requests without mutating history;
check task cancellation between tool/model steps.
2026-07-14 23:42:50 +08:00
NCBM bcfd1098f8 core/cli+config: confirm destructive tools and path denylist
Wire [agent] confirm_destructive / path_denylist into CLI; default
confirm prompt denies; document Phase C safety hooks.
2026-07-14 23:30:17 +08:00
NCBM 35e89c4dcc core/agent: optional confirm hook on ToolRegistry execute
Serialise dangerous-tool prompts under a lock so parallel tool rounds
cannot race the TTY confirm.
2026-07-14 23:30:10 +08:00
NCBM 510dd67a54 core/tools: classify destructive tools and clarify policy denies
Add classify_danger for delete/move/overwrite paths, get_path_denylist,
and clearer path/command denial messages.
2026-07-14 23:30:02 +08:00
NCBM 81a30d0e4d core/tools/file: add edit_lineno line-range edit tool
1-based inclusive range replace/delete/append; document Phase B agent
and tool updates in CLAUDE.md.
2026-07-14 23:24:34 +08:00
NCBM 3363ab928b core/agent+cli: wire system prompt and agent budgets
ChatAgent accepts system_prompt, result budget, and parallel_tools;
CLI loads them from config [agent].
2026-07-14 23:24:23 +08:00
NCBM 9ec06c7398 core/config: add [agent] section for profile defaults
Parse and sync system_prompt, max_tool_result_chars, and parallel_tools.
2026-07-14 23:24:17 +08:00
NCBM b1964951ea core/agent: parallel tool calls and tool-result char budget
Truncate large tool outputs and run multiple tool calls in one round
concurrently when enabled.
2026-07-14 23:24:11 +08:00
NCBM bd6d98ceda core/lmproto+agent: stream via chat_completions(stream=True)
Keep library async-def→async-iterator shape; remove raw-lines path;
typed StreamToolCallDelta merge; scripted clients emit real chunks.
2026-07-14 22:40:24 +08:00
NCBM 4548828354 core/lmproto+agent: use normal stream API for chat loop
Accept async-def returning async iterator; stream via
chat_completions(..., stream=True); typed StreamToolCallDelta merge;
update scripted test clients to emit real chunks.
2026-07-14 22:40:15 +08:00
NCBM bdb52bdef5 test/agent: cover merge_stream_tool_calls accumulation 2026-07-14 22:22:22 +08:00
NCBM ed028dc00b core/cli: update display and state for streaming, error, cancel events 2026-07-14 22:11:30 +08:00
NCBM f26e13c2c1 core/tools/file: copy, move, and delete paths via shutil
Workspace-bound copy_path/move_path/delete_path for files and
directories; overwrite and recursive flags where needed.
2026-07-14 21:47:57 +08:00
NCBM 25ff849efe core/cli: level-1 cancel of in-flight turns via Ctrl+C
Run turns as asyncio tasks; SIGINT cancels the task; agent rolls back
and keeps pending_retry_text for /retry.
2026-07-14 21:02:54 +08:00
NCBM e0916a6352 core/agent+cli: defer DB write until turn success; auto/manual retry
Failed turns roll back memory and keep pending_retry_text; persist only
after success. CLI auto-retries 10s/20s/30s (cancellable) and /retry.
2026-07-14 20:56:08 +08:00
NCBM f079ab73df core/tools/file: add tree with depth, entry, and VCS filters
Workspace-relative tree; always skip VCS dirs; skip hidden dirs by
default; max_depth and max_entries caps.
2026-07-14 20:19:49 +08:00
NCBM 4f1e99fa4b core/tools/process: timeout partial output, per-session PTY budget
run_command keeps stdout/stderr on timeout with timed_out=true;
open_pty uses shlex.join; PTY output budget is per-session.
2026-07-14 20:07:07 +08:00
NCBM a634021a80 core/cli: interactive continue prompts for loop and PTY limits
on_limit raises tool-round allowance; PTY session/budget limits can
prompt to raise; MaxRoundsEvent.continued marks extended runs.
2026-07-14 19:53:34 +08:00
NCBM 1b53b415b6 core/tools/process: harden PTY sessions for agents
Structured alive/exit_code/data reads; until= wait; SIGTERM then
SIGKILL; exec-fail marker; session limit, idle TTL, output budget.
2026-07-14 19:47:32 +08:00
NCBM 73c11cee36 core/tools/process: run_command stdin/env and write_pty
Optional stdin and env overlay for run_command; write_pty for
interactive PTY input.
2026-07-14 19:36:46 +08:00
NCBM bd6f8f5d9a core/cli: resume sessions, history, editline Tab, higher tool rounds
Default to file SQLite DB and latest session; /history and /rounds;
bind Tab for libedit; max tool rounds default 32.
2026-07-14 19:15:12 +08:00
NCBM 5d90e48618 core/cli: open config in $EDITOR with optional prompt
shlex-split EDITOR (e.g. codium --wait); prompt when no providers;
add config path/edit commands.
2026-07-14 18:44:32 +08:00
NCBM a017adda39 core/cli: readline Tab completion and persistent history
Complete slash commands and provider/model/tools args; store history
under platformdirs user data.
2026-07-14 18:33:34 +08:00
NCBM 566c1d7d4d test/cli: cover selection, slash commands, and providers list 2026-07-14 18:29:46 +08:00
NCBM f45af76c9b test/tools: cover workspace, file, run_command and PTY 2026-07-14 18:20:32 +08:00
NCBM 770e239d27 ci/lint: replace dead type:ignore with casts and clean async gen
Drop ignored # type: ignore comments (basedpyright skips them); type
tomlkit tables via cast; empty stream without reportUnreachable.
2026-07-14 18:08:22 +08:00
NCBM 6d536ab913 test/agent: cover tools, loop, and memory-backed ChatAgent 2026-07-14 17:45:47 +08:00
NCBM 227373914f test/memory+runtime: cover store and client factory
Enable pytest-asyncio auto mode; assert default user, message
round-trip, and provider→client mapping including errors.
2026-07-14 17:25:22 +08:00
NCBM c3e44cfff0 core/config: add database section to config store
Parse and expose [database] with defaults; keep providers API unchanged.
2026-07-14 17:19:21 +08:00
NCBM 223c456ebf test/config: add tests for config 2026-07-06 21:55:48 +08:00
NCBM 21aa7dd143 project: init 2026-06-25 23:22:45 +08:00