@nanobpm/nano-coder 0.44.0 → 0.45.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +40 -7
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -255,8 +255,12 @@ phases). Disable them with `--no-hooks`, or granularly via the
255
255
  `command`, optional `timeout_seconds` (default `bash_timeout_secs`, 600) and
256
256
  `max_output_length` (default 40,000, max 1,000,000 characters each for stdout and stderr).
257
257
  Returns stdout, then `Stderr:` and `Exit code: N` when relevant, or `(no output)`.
258
- Long output keeps its head and tail with `...N bytes truncated; complete output in <path>...`;
259
- the full capture stays in that file.
258
+ Long output keeps its head and tail with `...N bytes truncated (sha256:<digest>); complete output in <path>...`;
259
+ the full capture stays in that file. The digest is the first 16 hex characters (64 bits) of a
260
+ SHA-256 over the capture's complete content — a truncated prefix of the full `sha256sum` value,
261
+ hashed incrementally while the command runs (not re-read after it exits) — so two results whose
262
+ bounded head, tail and byte count match but whose content differs are still told apart, without
263
+ an unbounded post-exit reread of a multi-gigabyte capture.
260
264
  - `read_file` - Numbered lines of a text file; `path`, optional `offset` (1-based) and `limit`
261
265
  (default 2000 lines). Refuses binary files.
262
266
  - `write_file` - Create or overwrite a file (`path`, `content`), creating parent directories.
@@ -383,7 +387,7 @@ argument: a type-ahead list narrows as you type and Tab completes it.
383
387
  base URL, key source (env var, shell command, or a literal key; the file is then
384
388
  written with mode 0600) and default model
385
389
  - temperature, max tokens, system prompt
386
- - **Turn cap** (`max_iterations`): LLM calls per input (0 = unbounded); a positive cap makes normal mode ask before stopping
390
+ - **Turn cap** (`max_iterations`): LLM calls per input (0 = unbounded); a positive cap makes normal mode ask before stopping. In a headless (non-interactive) session an unbounded cap falls back to a 300-call safety net
387
391
  - **Context**: auto-compaction on/off, threshold, compaction mode, context-window override
388
392
  - **Verbosity**
389
393
  - **Save to config file**: writes only the keys you changed into the config file
@@ -399,7 +403,7 @@ argument: a type-ahead list narrows as you type and Tab completes it.
399
403
  - `/mode [normal|plan|auto]` - Show or set the agent mode (Shift+Tab cycles it, at the prompt or mid-turn):
400
404
  - **normal** - full tools; reaching a positive turn cap asks whether to keep going
401
405
  - **plan** - read-only: mutating tools (`bash`, `write_file`, `edit_file`) are gated, only analysis and output
402
- - **auto** - no turn cap; a `question` left unanswered for 15s is answered with "the user is away from the keyboard, make the best decision you can"
406
+ - **auto** - no turn cap (headless runs still get the 300-call safety cap); a `question` left unanswered for 15s is answered with "the user is away from the keyboard, make the best decision you can"
403
407
  - `/thinking [level|default|off|reset]` - Show the thinking level in use and the levels the current model takes, or set one for this session (`reset` goes back to the configured level). See [Thinking](#thinking)
404
408
  - `/providers` - List providers, endpoints and whether their API key is available
405
409
  - `/session` - Show the session ID and log path
@@ -464,7 +468,7 @@ model = "anthropic/claude-sonnet-4-5" # provider/model
464
468
  default_provider = "mock" # used when the model has no known provider prefix
465
469
  temperature = 0.7 # or "default" to send none (see Temperature below)
466
470
  max_tokens = 4096
467
- max_iterations = 0 # LLM calls per user input (0 = unbounded)
471
+ max_iterations = 0 # LLM calls per user input (0 = unbounded; headless runs get a 300-call safety cap)
468
472
  system_prompt = "You are a helpful assistant with access to tools."
469
473
  bash_timeout_secs = 600
470
474
  persist_sessions = true
@@ -843,7 +847,10 @@ of relying on the terminal's native reflow, and resizes are debounced (~40ms) so
843
847
  settles on one clean redraw. The `/` command menu is drawn under the input editor as part of
844
848
  the frame. The prompt shows whose turn it is: a green `›` with a dim `ready` hint
845
849
  when nano-coder is waiting for you, and a spinner with `working 12s · Enter steers, Esc Esc
846
- cancels` while a turn runs (the hint shows while the input is empty). It never captures the mouse. Setting `renderer = "legacy"` (or picking it in
850
+ cancels` while a turn runs (the hint shows while the input is empty). The `working` count is
851
+ working time, not wall time: while the turn is blocked waiting for a picker — the agent
852
+ asking a question, or the turn-cap prompt — the clock pauses, so the time you spend
853
+ answering does not inflate it. It never captures the mouse. Setting `renderer = "legacy"` (or picking it in
847
854
  `/settings`) switches back to the scroll-region renderer, where the terminal owns the
848
855
  scrollback and reflows history itself on a resize, with the status line pinned to the bottom.
849
856
 
@@ -1051,7 +1058,33 @@ To turn plans off, set `plan_tools = false`.
1051
1058
  the result:
1052
1059
  - after 12 tool calls with no plan change while items are open, naming the item in progress
1053
1060
  (or the next one) and asking for `plan_update`; again every 12 calls;
1054
- - once per session, after 10 tool calls in one turn with no plan, suggesting `plan_add`.
1061
+ - once per session, after 10 tool calls in one turn with no plan, suggesting `plan_add`;
1062
+ - when the model repeats the same tool call — same tool, same (normalised) arguments, same
1063
+ result — three times in a row, telling it to change approach or report `blocked`. The
1064
+ warning fires at most twice per turn; if the model keeps repeating after that, the turn
1065
+ ends with a `blocked` outcome instead of burning budget, and any remaining calls in the
1066
+ same batch are skipped rather than run. For `bash`, the match strips a trailing run of
1067
+ read-only diagnostic pipeline stages (`| wc -l`, `| head`, `| grep …`, …) off the base
1068
+ command (parsed quote- and escape-aware, so a `|` inside quotes or a `||` operator never
1069
+ splits a command), so appending `| wc -l`/`| grep …`-style stages does not dodge it while
1070
+ the stable base — which may itself contain non-diagnostic stages like `sed` — keeps
1071
+ matching. Stripping stops at the first stage that could change state (a writer like
1072
+ `tee`, a redirection, a write option such as `sort -o`, a shell control construct like
1073
+ `;`/`$(…)`, or an unrecognised command), so everything to its left stays in the
1074
+ fingerprint and genuinely different calls are never conflated. The result fingerprint
1075
+ ignores only the per-call spill filename in the output bounder's `complete output in …`
1076
+ marker (matched through its `...` terminator, so even a `session_dir` path with spaces is
1077
+ normalised; not arbitrary output that merely resembles one). The marker also carries a
1078
+ `(sha256:<digest>)` of the *complete* output, so identical runaway output is still recognised
1079
+ while a result that changes only in its truncated middle — invisible to the bounded head,
1080
+ tail and byte count — stays distinct and is never hard-stopped as a false repeat. The
1081
+ fingerprint likewise folds in each attached image's content hash, so a `read_file` of a
1082
+ changing image (whose result text is only the unchanging metadata) is told apart by the
1083
+ bytes the model actually received. Enabled
1084
+ plan, outcome and
1085
+ `question` calls break the streak (so only genuinely consecutive repeats count, and an
1086
+ interleaved such call makes the calls around it non-consecutive); when plan tools are
1087
+ *disabled* a repeated hallucinated `plan_*` call is itself detected rather than exempted.
1055
1088
 
1056
1089
  Plan and outcome calls don't count. Set `reminders = false` to turn them off.
1057
1090
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanobpm/nano-coder",
3
- "version": "0.44.0",
3
+ "version": "0.45.1",
4
4
  "description": "A 6MB coding agent. Run a fleet on your laptop.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -31,9 +31,9 @@
31
31
  "node": ">=18"
32
32
  },
33
33
  "optionalDependencies": {
34
- "@nanobpm/nano-coder-darwin-arm64": "0.44.0",
35
- "@nanobpm/nano-coder-darwin-x64": "0.44.0",
36
- "@nanobpm/nano-coder-linux-arm64": "0.44.0",
37
- "@nanobpm/nano-coder-linux-x64": "0.44.0"
34
+ "@nanobpm/nano-coder-darwin-arm64": "0.45.1",
35
+ "@nanobpm/nano-coder-darwin-x64": "0.45.1",
36
+ "@nanobpm/nano-coder-linux-arm64": "0.45.1",
37
+ "@nanobpm/nano-coder-linux-x64": "0.45.1"
38
38
  }
39
39
  }