Skip to content

Releases

v20261128

Choose a tag to compare

@github-actions github-actions released this 28 Nov 12:45

New Features

  • Compaction recall & retention: summaries now cite session entries ([rN]), include ## Key Facts (cNrN) and ## Replaced Context (E<n>) sections restored on demand via recall_context, enforce long-session retention rules, and add opt-in compaction.growthGateTokens (see Compaction Reference and Compaction settings) (#767, #794)
  • Externalized truncated tool outputs: truncated read, grep, find, and ls results are saved under the agent directory and paged back in 50KB chunks via recall_tool_result (#767)
  • Autonomous image generation (generate_image): generates or edits images (supporting aspectRatio and size) using the session provider's image model when available, gated by the permission prompt in non-yolo sessions (see Use image models) (#757, #893)
  • Built-in git, /token-usage, batch (execute_many), and subagents.preferredCli: unified git (status|diff|log|branch, including reading diffs) and /token-usage join the built-in modules, hidden execute_many batches multiple tool calls into one round trip, and subagents can run via claude, codex, or agy (see Slash commands) (#803, #824)
  • Read-only subagent viewer & status UI: pressing Down in an empty editor opens a read-only subagent list and job report overlay; the working indicator aligns at column 0 with a breathing dot, and retry/compaction rows shimmer at 30fps (#877, #906)
  • o200k_base token estimation, Usage.pricing snapshots, and fail-closed sandbox: context estimation uses gpt-tokenizer o200k_base instead of character division, costed responses freeze rate snapshots on usage.pricing, and unattended sessions fail closed when a configured sandbox launcher is missing (see Security) (#763, #803)
  • Embedded sidecars in full: full bundles embed TUI native prebuilds and photon wasm again, removing on-demand downloads so image and clipboard features work offline (#840)

Added

  • Ported four pi-extensions picks as built-in modules: pi-deepwiki (repo-grounded Q&A), pi-git-tools (read-only git, no gh), pi-meat (faithful reading diff via subagent), and /token-usage over the existing usage ledger. subagents-mini gains subagents.preferredCli so a spawn can run claude, codex, or agy with the harness default model (issue #824)

  • Read-only subagent viewer: pressing Down on an empty editor when subagent jobs exist opens a job list overlay (Up/Down selects, Enter opens the selected job report, Esc exits) without altering the transcript or the live widget under the editor

  • Added the hidden built-in batch module (execute_many tool, module/batch build component) to run multiple callable tools sequentially or in parallel within one model round trip (issue #803)

  • Costed responses now freeze an auditable Usage.pricing snapshot (provider, model, revision, rates) via calculateCost() and preserve it in combineUsage(), keeping historical spend explainable across catalog edits (issue #803)

  • A compaction summary cites the session entries behind its facts as [rN], and recall_context reads one back. Every message handed to the summarizer carries its entry id, the summary prompt asks for a trailing <refs> block that defines each tag, and the tool resolves the tags against that block and appends a context_recall entry, so the recalled history returns as history instead of a tool result the next compaction eats. An undefined tag, a summary without a <refs> block (any session compacted before this change), an entry still inside the kept region, and a block over a quarter of the context window are all refused with a reason (#767)

  • Compaction summaries now follow explicit long-session retention rules: exact paths, signatures, errors, decisions, constraints, and unfinished work are kept; consumed logs, repeated reads, and settled discussions are dropped. The rules live in the summarization system prompt and do not change the summary format (issue #767)

  • The summarization system prompt now keeps every open, unsuperseded user objective as its own line even when the summarized range made no progress on it, and requires user requests, decisions, and constraints to be quoted verbatim or explicitly marked as a paraphrase. Both the default and the Codex compaction paths share this prompt, so the rules apply to each (#794)

  • Compaction summaries gain a ## Key Facts block with stable refs (c0r2) to the session entries they compress; the recall_context tool restores those original messages on demand when a summary is too compressed to continue safely (issue #767)

  • A compaction summary now lists the history it replaced, and recall_context pulls one region back. The summary ends with a ## Replaced Context (recallable) section, one line per replaced turn with a ref, a one-line preview, an entry count, and a token size; recall_context({ ref }) answers with the original messages of that region, capped at 8000 tokens so a recall cannot refill the window the summary just freed. A ref is an ordinal over the branch (E3 = the third model-visible entry), recomputed from the branch and the newest cut point, so it survives a reload and a fork with no schema change. session_before_compact can now post-process a summary it did not write: the event is dispatched a second time with replacedSummary when no handler built one, which is what lets the appendix land on the Codex-style summary (#767)

  • Added opt-in compaction.growthGateTokens. Automatic threshold compaction now waits for enough estimated context growth since the last compaction, so a threshold that is barely exceeded cannot produce a second summary right after one finished. The default 0 keeps the existing threshold-only behavior (issue #767)

  • The pi-image module registers generate_image, the first caller of modelRegistry.generateImages(). It picks an image model for the session's own provider when there is one (a ChatGPT OAuth session draws with its own subscription, otherwise the first available image model), returns the image as a tool result, and writes it to the path the model asked for, taking the extension from the returned format. Its guideline lets the model draw on its own when the task's output includes an image file, not only when the user asks for one (#757)

  • generate_image accepts optional aspectRatio (e.g. "16:9") and size (e.g. "2K") arguments and forwards them to image providers. Values are passed through unchanged, so an unsupported value is reported by the provider (issue #893)

Changed

  • todo tool result cards for add, done, undone, and clear no longer echo the full step list beneath the count summary; list still renders all steps (issue #908)
  • Unattended sessions (print, json, rpc) now fail closed on shell calls when a configured sandbox launcher is missing, instead of running commands unsandboxed; interactive sessions keep the warning (issue #803)
  • Context token estimation (estimateTokens, message codecs, estimateContextTokens) now uses o200k_base (gpt-tokenizer) instead of chars / 4 or chars / 3.5 and excludes opaque thinkingSignature payloads, preventing severe underestimates on code, JSON, and CJK text (issue #763)
  • mcp subagent calls now run with only the single mcp__<server>__<tool> tool and --mcp-only-prompt --no-context-files instead of inheriting read, the coding-assistant system prompt, and AGENTS.md (issue #800)
  • Cloudflare Workers AI and Cloudflare AI Gateway default models now target @cf/zai-org/glm-5.3 (issue #822)
  • Qwen Token Plan Individual now lists qwen4-max instead of the retired qwen4-max-preview (upstream 22f5f2995)
  • Together drops reasoning-effort overrides for deprecated models; every listed Together reasoning model takes the Together thinking toggle (upstream e459be65a)
  • GitHub Copilot Claude and GPT-6 models preserve the prompt cache across thinking-level and tool changes: Clau...
Read more

v20261114

Choose a tag to compare

@github-actions github-actions released this 13 Nov 16:33

Added

  • nanopi mcp add|remove|list manages MCP servers without a session: add writes one server to ~/.nanopi/mcp.json (or .nanopi/mcp.json with --project), remove deletes it from both, and list prints what the project can reach with the file each server came from. mcp-lite already read those files, discovered a dozen other clients' configs, and showed all of it in /mcp; only the writing was missing, which made "add this server" a hand-edit of a JSON document whose shape depends on the transport. Everything after -- is the server's own argv, a file that does not parse is reported instead of overwritten, and a name already present is refused unless --force says otherwise. A name that comes from a discovered file (Cursor, Claude Desktop, …) is not removed: the command names the file it came from instead
  • /btw <question> asks something beside the session instead of in it. The question travels with the conversation tail (user and assistant text, no tool traffic) to a direct model call with no tools, and the answer is appended as a btw custom message whose codec projects to nothing: the transcript shows it, the next request does not carry it. A second /btw continues the first side thread in memory, so a detour builds up without ever entering the main context. subagent isolates work; this isolates a question
  • nanopi auth login --provider <provider> runs a provider's OAuth sign-in from the shell and exits, so a container or a headless setup can log in without starting a session. It drives the same flow as /login: an auth URL, a device code, or a question (which sign-in method, then a pasted code) is printed and answered on the terminal, and --no-browser keeps the URL in the output instead of handing it to the browser. The credential lands in the same store the TUI writes, so the next session already sees it. An API key is not part of this command: use $PROVIDER_API_KEY or models.json
  • registerMarkdownTransformer now reaches the rows it was documented for: a custom message body, a compaction or branch summary, and the startup what's-new block, each tagged with its own messageType (custom, summary, changelog). Filtering stays in the callback, so no new registration parameter was added; the Mermaid transformer the host registers first is limited to user/assistant so it leaves custom and summary rows alone (#650)
  • Forking a session whose stored working directory is gone: interactive mode now offers Continue, Fork, or Cancel instead of only continuing. Fork copies the session into the current directory under a new session ID (like --fork), so the next resume no longer asks. This applies at startup (--session, --resume), to /resume, to /import, and to ctx.switchSession() from extensions, which now takes cwdOverride with forkToCwd; importFromJsonl() takes the same option object instead of a bare cwd override
  • /status shows a rolling usage total over every session file, not just the open one: tokens, cost summed from the per-response prices recorded at write time, session and response counts, and the cache hit rate. The walk runs on the event loop and re-parses only files whose size or mtime moved, so a dialog opened mid-pass is redrawn when the totals land instead of presenting a partial sum as the total (#693)
  • The webui shows what a chat cost: a meta row under each reply (context sent, output, cache hit rate, cost) and a composer dock with the session totals, both summed over the branch the session file ends on rather than every line, because a retry or a fork appends a sibling. /chat/active also accepts wait_s and parks until a turn starts or settles, which replaces the 2 s poll a tab that did not start the turn had to run (#596)
  • The webui picks the Moonshot host that answers for a key instead of assuming one: the China and international hosts issue separate keys and 401 the other one, so "fetch models from the endpoint" probes both and writes back the host that returned a non-empty listing. The catalog stays one provider; the detection is per request and never persisted (#598)

Changed

  • Project skills and prompts move to .agents: .agents/skills/ and .agents/prompts/ are now the project scope, searched in the working directory and every ancestor, so a nested checkout finds the resources at the repository root. .nanopi/skills/ and .nanopi/prompts/ are still read, after .agents/, so an existing project keeps loading with no migration step; the first path to define a name wins and the other is reported as a collision. Project .agents/prompts now requires a project-trust decision the same way .agents/skills already did, and the user's own ~/.agents/ is still never treated as a project resource. .agents/extensions/ joins .nanopi/extensions/ as a trusted project module directory (issue #641)
  • The clipboard paste action no longer swallows the autocomplete menu's paging keys: handleInput ran app.clipboard.pasteImage before anything else, so a user who rebound it to pageup/pagedown lost those keys while a menu was open. Selection page keys now go to an open menu first, and the paste action only runs when no menu is showing (issue #634)
  • find still finds the files sitting directly in a directory for a path pattern: src/**/*.ts is rewritten to **/src/**/*.ts for fd, and fd's own ** does not cover the files one level under src/ on every release (see the fd pin below). The relative form is now run as well and the two results merged, so the fd path and the walker share one candidate set (issue #669)
  • The grep tool returns the context it was asked for: context never reached ripgrep and every block was rebuilt by reading the matched file whole, so context: 2 on an 8 x 95 MB log loaded the files into memory, and a block could show a different match than the one found. Context lines now come from ripgrep's own context events, the stream is formatted as it arrives, and the walker (no ripgrep) is the only path that reads a file. A fractional limit reached the notice verbatim and limit: 0 meant "no limit"; both are floored and clamped. glob is now rooted at the search path, so path: "repo", glob: "migrations/main/*.js" no longer answers "No matches found" because the glob was resolved against the directory nanopi started in (issue #634)
  • Truncation no longer splits a surrogate pair: truncateLine cut grep match lines at a UTF-16 index, so a line whose cut fell inside an emoji or a CJK extension-B character kept a lone surrogate. JSON.stringify still emits it as \ud83d, and a strict encoder on the receiving side (serde_json rejects lone surrogates) then refuses the whole message, which is how a half emoji in a session file broke a request. sliceHead and sliceTail now move the cut off the pair, and the compaction summary truncation uses the same helper (issue #634)
  • Command arguments stop losing words to apostrophes: parseCommandArgs opened a quote at any ' or ", so /ask why doesn't the user's cache work reached the model as why doesnt the users cache work and the swallowed spaces shifted $1/$2. A quote now only opens at the start of an argument, an unclosed one stays literal text, and quoted empty strings are no longer dropped (issue #634)
  • Editing a file keeps the line endings of the lines it did not touch: the edit tool normalized the whole file to LF for matching and then restored every \n to the first line ending it found, so one CRLF anywhere rewrote the file to CRLF and a lone CR was erased. applyEditsToNormalizedContent now also reports the content the matched offsets index into, and applyReplacementsToOriginal rebuilds the file line by line: untouched lines keep their own bytes, a changed line keeps the terminator of the line it replaced, and a line the replacement added takes that same terminator. detectLineEnding / restoreLineEndings are gone with the code path that forced one ending onto the whole file (issue #640)
  • A timed-out command reports the exit code the shell produced, when there is one: the local backend threw timeout:N before computing the exit status, so a command that failed and then outlived the deadline (a descendant keeping the pipe open is enough) was reported only as slow. The local backend now throws a ShellTimeoutError carrying the exit code and the status line reads Command timed out after N seconds and exited with code X. BashOperations is a public contract, so a backend that keeps throwing the bare timeout:N message still gets the original wording (issue #640)
  • The removed line of a single-line hunk keeps its indentation: renderIntraLineDiff ran Diff.diffWords, which ignores whitespace while matching and then re-attaches it to the first run, so -83 await commitRecordingChunk({ rendered as -83 await commitRecordingChunk({ while the + line was aligned. It now diffs with diffWordsWithSpace, so a pair that only differs in indentation keeps both indentations and neither is inverse-highlighted (issue #640)
  • The image paste keybinding on Windows and WSL is alt+v and ctrl+v: some embedded terminals hand Ctrl+V to the program instead of pasting, and a single-value default left the key doing nothing with no hint why (issue [#640](https://cnb.cool/...
Read more

v20261107

Choose a tag to compare

@github-actions github-actions released this 07 Nov 12:57

New Features

  • Module hot reload and hot swap: a module file under $NANOPI_EXTENSIONS, ~/.nanopi/agent/extensions or .nanopi/extensions can be edited, deleted, or added while the process runs; the change lands at the next idle moment. A stat ledger of the files that were actually loaded decides what changed, so add, change, and unlink need no classification and a deleted module really unloads. Unloading tears down for real: session_shutdown{reason:"unload"} to that module alone (the event extras already clean up on), then its optional SessionModule.dispose, then every registration its factory made. The module list is swapped on the registry the session already bound, so contexts and tool wrappers handed out earlier stay valid. Off by default; --hot or settings.modules.hotReload turns it on (issue #558)

  • Substituted responses are re-issued silently: a relay or aggregator that answers with a different model than the selected one is detected from the response headers (openai-model, x-model, x-served-model, …), compared by last path segment so a vendor prefix or dated suffix does not count, and the request is repeated once on the model the user picked. The substituted response is rewound out of the active branch and nothing is shown: no message, no footer marker, no error. A second mismatch ends the re-issue and keeps the answer, because the endpoint cannot serve the selected model. The Gemini adapters now report onResponse at all, from the first stream chunk's HTTP response (issue #499)

  • Module API split into surfaces: ModuleApi is now a composition of eight contracts - events, tools, commands, rendering, actions, session, model, and providers - and SessionModule<S> takes the surfaces a module declares, so SessionModule<ModuleCommandsSurface> cannot reach registerProvider or the other six. The host still passes the full API; the type parameter is a checked promise about what the module may touch (issue #453)

  • Message types are priced, not free: estimateMessageTokens reads the session's message-type table, so a kind a module registered through registerMessageType() is measured by its own estimateTokens instead of counting as 0 tokens, and a codec can re-measure a built-in role. A kind nobody listed stays out of the token budget and out of the compaction cut search, so registering a kind never moves a cut point (issue #453)

  • AssistantMessageRenderContext.theme: an assistant message renderer receives the live theme, so it styles through the host's forwarding proxy and follows a system-theme refresh instead of reaching for globalThis (issue #457)

  • mdSectionHeading theme token: /status paints its named section headings with a token of their own, defaulting to mdHeading, so a reskin can color [Context] / [Skills] without touching markdown headings in the transcript. pi-ui uses it for its frame gradient, behind a settings row; the gradient stays out of the transcript because the markdown renderer cannot strip a per-character style prefix (issue #457)

  • ctx.ui.redrawWidget(key, content): a widget write the host keeps on record and replays after it rebuilds its widget table, so a module that writes once at session start no longer loses its widget to /new, /resume, /fork or /reload. undefined records the key as cleared, so a suppression stays suppressed instead of being reinstalled. pi-ui's todo-widget suppression uses it instead of wrapping setWidget (issue #457)

  • Transcript rows as module contracts: a module can now draw rows it does not own. registerToolRowRenderer restyles, flattens, or hides the row of a tool another module registered (without replacing its execute), registerShellRenderer draws ! command rows, registerAssistantMessageRenderer draws an assistant message body, registerWorkingIndicator draws the streaming working line, and registerSettingsItem / unregisterSettingsItem add or retire settings rows — the last one also retires a built-in row. pi-ui's prototype patches are gone (issue #453)

  • Narrow SDK subpaths for modules: @nanopi/pi-coding-agent/modules carries the contracts a module factory needs (SessionModule, ModuleApi, ModuleContext, the event types, isToolCallEventType, ToolDefinition) and @nanopi/pi-coding-agent/ui the rendering surface (Theme, getMarkdownTheme, renderDiff, CustomEditor, ToolExecutionComponent). Writing a module no longer drags in the package root's ~490-name barrel, and check:entry-graphs now holds both subpaths to a file budget so they cannot grow back into it. The jiti loader aliases the subpaths for module files on disk (issue #442)

  • Ctrl+Enter steers immediately: app.message.steer sends the composer text as steering that may interrupt the current sequential tool batch, instead of waiting for every call in it to finish. Calls that already ran keep their results, the remaining ones are reported as interrupted with the steering text, and parallel batches still deliver at the next turn boundary (issue #411)

  • Qoder model catalog: the registered qoder / qoder-cn providers refresh their models from the account's signed model list on startup, so /model lists what the logged-in plan can actually use (issue #398)

  • Qoder daily check-in: a session start claims the day's Qoder credits for every logged-in Qoder account (both sites) and reports the outcome in one status line; /qoder-checkin runs it on demand and NANOPI_QODER_CHECKIN=0 turns it off (issue #398)

Changed

  • Retries wait long enough to outlast a throttle: the agent-level retry default baseDelayMs went from 2000 to 15000, which with the existing 60000 cap makes the three default attempts wait 15s, 30s and 60s. A gateway that answers 429 with retry_after=30 used to exhaust all three attempts in 14 seconds against the same wall (issue #574)
  • full drops six cold grammars: buildconfig.json gains grammarSets and a selective grammars component, the mechanism providers and apis already use. full selects curated, which excludes 1c, mathematica, isbl, gml, sqf and maxima; base and minimal name no set and keep every grammar. The build resolves an excluded highlight.js/lib/languages/<tag> to an empty module so its bytes stay out, and NANOPI_BUILD_GRAMMARS makes supportsLanguage answer false for it so the existing plain-text fallback runs. Full's single file goes 10,060,199 → 9,556,039 bytes (issue #528)
  • full downloads its native sidecars instead of embedding them: the TUI prebuilds and the photon wasm moved to the existing NANOPI_SIDECARS download path, which drops 0.9 MiB packed — four platform builds of which a machine uses one, and a 4.19 MiB wasm that compresses worse than anything else in the bundle. Full goes 11,517,558 → 10,213,090 bytes; base and minimal never embedded them (issue #528)
  • base keeps the Bedrock catalog but not the Bedrock implementations: apis gains a bedrock set and providerSets separates the catalog from the client, so a base build still lists Bedrock models without carrying the AWS SDK implementation. A Bedrock model in models.json under base is reported as an api the build does not carry
  • minimal no longer bundles the whole OpenAI SDK: with apis cut to openai-completions, the adapter uses a narrow client (api/openai-chat-completions-client.ts) built from the SDK's own parts (APIPromise, Stream.fromSSEResponse, APIError.generate) that implements only the path the adapter calls, and scripts/build-openai-client.mjs aliases the bare openai import to it when the API set is exactly that one. The OpenAI input goes 1379 → 61 KiB and the minimal artifact 2,655,211 → 2,266,491 bytes; check:openai-client-size catches both a lost alias and the SDK growing back (issue #540)

Fixed

  • A nanopi installed from npm loads module files from disk: the diskModulesIncluded() gate read the bundle's NANOPI_BUNDLED_NODE marker as "this build has no jiti", so $NANOPI_EXTENSIONS, <agent dir>/extensions/, and .nanopi/extensions/ were silently ignored by the one artifact the docs describe. The gate now answers by resolving jiti — the same resolution the lazy import uses — and only the single-file nanopi.js, which is zero-dependency and meant to load nothing, is excluded by its own marker. Two build-side faults surfaced once the gate was open: the bundle hardcoded its external list instead of BUNDLE_EXTERNAL_PACKAGES, so jiti was bundled and its ../dist/babel.cjs require failed next to a hashed chunk; and a module's bare imports resolved to the unbundled dist/ tree beside the bundle, a second copy of the host whose Text/CustomEditor/Theme classes fail the TUI's own instanceof checks. A bundled runtime now answers from virtualModules, and typebox joins the path aliases so a tool definition's schema comes from the host's TypeBox instance. jitiAliases() also stopped deriving the host tree by counting ..s from its own file, which only held while that file sat exactly two levels below it; it now walks up to the tree holding...
Read more

v20261031.1.0

Choose a tag to compare

@github-actions github-actions released this 30 Oct 17:06

Changed

  • install.js --version completes a follow-up release line: --version=20261031.1 fetches v20261031.1.0, so a same-day follow-up does not require remembering the patch part. Only the missing .0 is filled in — a date alone (--version=20261031) still names that date's tag, and a full tag is used as given

v20261031

Choose a tag to compare

@github-actions github-actions released this 30 Oct 16:35

New Features

  • Prompt presets: --preset <name|path> appends a preset to the system prompt, looked up as presets/<name>.md in the project and then the agent directory, or read from a path
  • Failure digest: a failed bash call ends with a [failures] block carrying the lines each toolchain prints for its failures, and /diagnose writes the diagnostic bundle on demand (issue #336)
  • /kill-bashbg: stops background bash_bg jobs from the keyboard, one job or all (issue #381)
  • LSP navigation: lsp_hover, lsp_definition, lsp_query and lsp_edit, plus diagnostics before read and after edit (issue #333)
  • Remember aging: /remember entries carry (kept YYYY-MM-DD), --list shows ages, /forget deletes by number and --prune offers stale entries (issue #214)
  • Markdown export: /export <path>.md and --export write Markdown next to HTML, and each flavor carries only the formats it ships (issue #184)

Breaking Changes

  • --mode is now --output (text, json, rpc): the flag already meant the output interface, and the run-mode settings wanted the same word, so a script passing --mode json must pass --output json. --mode is no longer recognized, and the CLI's Mode type is now OutputMode
  • pi-lsp-mini's lsp_rename and lsp_delete are now one lsp_edit tool with kind: "rename" (plus newName) or kind: "delete". They are the same lifecycle — destructive, workspace-wide, sequential, then a server rescan — and keeping them apart meant two copies of the dry-run, outside-project-skip, and post-change-check logic that had to be kept in sync by comment. apply now defaults to false for both branches, where rename used to default to true: one tool cannot keep two defaults, and a workspace edit a model did not ask to be written is not recoverable from a tool message. A rename therefore costs one extra call (preview, then apply=true) and no longer writes anything by accident

Added

  • /kill-bashbg stops background bash_bg jobs from the keyboard: no argument stops every running job, <jobId> stops one, list shows them without stopping anything, and job ids complete as arguments. The jobs are the ones pi-smart-flow starts, so this is the user's side of the tool the agent already drives; the tool is what starts a dev server, and the command is what stops it without going back through the model. A stop that leaves a process alive reports which job survived instead of claiming success (issue #381)
  • pi-lsp-mini gained lsp_hover and lsp_definition, the two LSP requests that save the most context per call: a signature or a doc comment is one short answer instead of a whole file read, and a definition is a file:line instead of a grep. Both take line/character or a symbol name that the server's own document symbols are asked to locate, so a model that knows the name does not have to read the file to find the column; a server without textDocument/documentSymbol falls back to the file text, and hover output is capped at 1600 characters so a 4k doc comment does not undo the saving. read now also carries the errors a file already has (readDiagnostics in ~/.nanopi/agent/lsp.json, on by default, errors only, 4s budget): the model learns a file was broken before it started editing it instead of after, and nothing is reported when the file is clean, no server matches, or the publish is not newer than the didOpen for that read (issue #333)
  • Session export now covers Markdown next to HTML, and the build flavors split it the way the SKU ladder does: full writes MD / HTML, base writes MD only, minimal writes nothing. /export <path> picks the format from the extension (.md, .html, .jsonl; HTML stays the default), --export does the same for a session file, --export-format overrides it, and RPC gains export_session with a format field. Markdown keeps tool calls and tool results so the transcript is readable on its own. There is no PDF export: the HTML export document is the printable one, and its template now reveals collapsed tool output, thinking and compaction detail when printed (and hides the interaction bar), so a browser's Print > Save as PDF produces the paper copy. Asking for a PDF says exactly that instead of writing HTML under a .pdf name. A flavor that drops a format fails with "not included in this build" instead of writing an empty file (issue #184, issue #187)
  • nanopi --export <session> <output>.jsonl now writes the file it names. It used to answer with the input session path and leave the output unwritten, so the one format the docs call a copy was the one that produced no copy; without a destination the JSONL export now asks for one instead of overwriting the session it reads
  • pi-lsp-mini can now report a language server's diagnostics for the content an edit just wrote, opt-in through "editDiagnostics": { "enabled": true } in ~/.nanopi/agent/lsp.json (debounceMs, timeoutMs, errorsOnly, maxDiagnostics). Publishing is revision-stamped, so the pre-edit snapshot a server sends on its own is never reported as the outcome of the edit, and no matching server, crash, or timeout leaves the edit result untouched. edit runs far more often than write, which is why a language server on that path has to be a choice
  • NANOPI_DEBUG=1 now also writes a diagnostic bundle to <agent dir>/diagnostics/, once when an interactive session starts and once when it ends, without asking: the bundle is only useful when it was already on disk when the session went wrong, and the directory is printed on exit. Each bundle holds diagnostics.json (environment, model and provider with credentials redacted, loaded modules, settings), report.json (failed assistant turns and recorded crashes), the session branch as session.jsonl, and the tail of nanopi-debug.log, beside a bundle.zip with the same files. Nothing is uploaded; the loose files stay readable without unzipping, and the transcript is only as private as the agent dir. This is the local half of the /bug flow restored without the command (issue #211)
  • Startup memory is now measured without asking anyone to turn a flag on: interactive mode appends mem startup (before the TUI mounts) and mem first-render (at first usable state) to nanopi-debug.log in the agent dir even with NANOPI_DEBUG off, so the delta between the two lines is what managed tools, grammar loading, and session setup cost. pnpm run profile:tui prints the same figure as startup rss and METRIC startup_rss_mib, next to startup_time_ms
  • /status now reports process memory: RSS, peak RSS, heap, and external/arrayBuffers. NANOPI_DEBUG=1 turns on periodic sampling (every NANOPI_DEBUG_INTERVAL_MS, default 5000) that appends the same line to nanopi-debug.log under the agent dir, so startup cost and per-turn growth can be measured instead of guessed — the log is a file because interactive mode repaints over anything written to stderr (issue #165)
  • Release tags now also publish a container image and an npm package. GHCR gets ghcr.io/nekosekaimoe/nanopi (node:24-bookworm-slim + the release bundle + git/ripgrep, non-root user, latest on semver tags) and npm.pkg.github.com gets @nekosekaimoe/nanopi, the same CLI under the scope GitHub Packages requires (GitHub only accepts publisher-scoped names). Both run in build-binaries.yml before the release goes public, so a failed publish cannot leave a public release that nothing can install. The npm route never carried provenance; scripts/publish.mjs keeps --provenance for a return to npmjs (issue #278)
  • Added the pi-memory module and its /remember command: a session's durable conclusions are distilled into the project's context file (AGENTS.md and its siblings) as one-line bullets. The extraction is deliberately stingy — the prompt names what the file already says, the reply is re-checked locally, and narration of one session, secrets, and anything the diff already states are rejected — so a rejected write costs nothing and an accepted one has to stay true after the session. A bullet retires its predecessor only inside a ## Summary section, where the content describes current state; /remember <text> appends one line directly. Writes preserve every line they do not own, and the file the loader already reads puts the entry in front of the next session with no new format (#158)
  • /remember entries now carry an age, and the list they live in can shrink. Every bullet pi-memory writes ends with (kept YYYY-MM-DD), and each write restamps the other bullets in the same section — ignoring a candidate is a statement that the section is still true, so the stamp tracks "last confirmed", not "last edited", which no per-line annotation can express once the annotation is itself deleted. /remember --list prints every entry with its age, /forget <numbers> deletes what that list numbers, and /remember --prune offers entries whose backticked path no longer exists or that nobody has confirmed for 180 days. Extraction also asks the model which existing entries this session proved wrong and offers those for deletion in the same confirmation step, which is the only reader that can tell "the file moved" from "the rule changed". Writes past 80 ...
Read more

v20261022

Choose a tag to compare

@github-actions github-actions released this 22 Oct 03:25

New Features

  • Web search without keys: the new websearch module ships web_search and read_page tools that run on a failover chain needing no account - Firecrawl's keyless channel first, then Keenable, with Tavily and Exa joining once keys are configured. Per-engine key rotation handles auth, rate-limit, and quota failures. See Web Search and Page Reading
  • MCP auto-discovery and a single mcp shell tool: mcp-lite imports server configs from Claude Desktop, Cursor, Windsurf, VS Code, Codex, ZCode, OpenCode, and project-level .mcp.json / .vscode/mcp.json / .cursor/mcp.json / .codex/config.toml / .agents/mcp.json below your own ~/.nanopi/mcp.json; every MCP call goes through one mcp shell tool that routes to the real server inside an isolated subagent
  • Modules from disk: base and full builds load .ts/.js modules from $NANOPI_EXTENSIONS, <agent dir>/extensions/, and the project's .nanopi/extensions/ (when trusted), transformed with jiti - plus a package of public SDK exports for extensions and embedders. See Modules
  • Copilot Free/Student unblocked: the built-in github-copilot/auto virtual model routes requests through Copilot's Auto session and router for accounts that reject direct model requests (400 model_not_supported), recording the physical model that answered so usage, cost, and compaction limits stay accurate
  • Shell sandbox: /sandbox on|off wraps bash commands in bubblewrap (Linux) or sandbox-exec (macOS): the working directory stays writable, everything else is read-only, and network is cut unless --network was passed, with configuration in the extra settings

Breaking Changes

  • A tool set can now name the tools it ships (tools in the toolsetComponents entry of buildconfig.json), and the build drops the other tool implementations instead of only filtering them at runtime. The minimal flavor's tool set lists bash and powershell, so read, edit, write, grep, find, and ls are no longer compiled in: their barrel exports throw, and createAllToolDefinitions builds only the listed tools (names argument). minimal also drops OAuth login (oauth/* off: no /login OAuth option, no /logout in autocomplete, no x flow code in the bundle), syntax highlighting (syntax-highlight off: every code block renders in the plain color, ~1.4 MiB of highlight.js grammars stay out), and embedded-code detection in shell call display (embedded-code off). Its endpoint support is cut to the OpenAI-compatible chat completions API (new apis component and apiSets map, openai set): models.json entries naming another api fail with a build-scoped error, and the other API clients stay out of the bundle
  • Build flavors are now full, base, and minimal (previously full and minimal). base keeps the core CLI and every builtin module except the bundled extras, with the standard tool set. minimal is base plus the toolset: "bash" component: the build registers only the shell tools (bash, powershell), so read, edit, write, grep, find, ls, and the extra tools cannot be activated by settings, --tools, a resumed transcript, or a module, and a call to any of them is blocked at execution. The former minimal (core CLI without peripherals) is now base

Added

  • Added module files on disk: the base and full builds load .ts/.js from $NANOPI_EXTENSIONS, <agent dir>/extensions/, and the project's .nanopi/extensions/ (the last one only when the project is trusted), transforming each file with jiti and feeding the result to loadModules() as an ordinary SessionModule. The SessionModule = { name, factory } contract and the module registry are unchanged; a broken file is a diagnostic, not a startup failure. jiti is a runtime dependency of the npm package, imported lazily, and stays out of the build entirely for minimal and for every single-file artifact through the new jiti-modules component (#126)
  • Added MCP server auto-discovery to mcp-lite: the config files the other clients already have are imported and merged below the user's own ~/.nanopi/mcp.json / .nanopi/mcp.json entries — Claude Desktop (claude_desktop_config.json on all three platform paths), Cursor (~/.cursor/mcp.json), Windsurf, VS Code (Code/User/mcp.json, servers key), Codex (~/.codex/config.toml [mcp_servers.*], parsed by a small TOML subset reader), ZCode (~/.zcode/cli/config.json), OpenCode, and project-level .mcp.json / .vscode/mcp.json / .cursor/mcp.json / .codex/config.toml / .agents/mcp.json. Both server shapes are normalized (command+args and OpenCode's argv array, type/transport/no discriminator, url means remote, enabled: false/disabled: true skipped) and ${VAR} / ${VAR:-default} expand from the environment. .nanopi/mcp.json gains a discovery block (mode: "auto"|"off", globalOnly, include, exclude) because a project config file can start an arbitrary command; /mcp reports each server's source file and every file that failed to parse. Compared against Codex, pi, DeepSeek Harness, and ZCode: none of them silently imports every client, so discovery stays inside a known-path list with visible status
  • Added the mcp shell tool to mcp-lite: every MCP call from the main agent has one shape — the main agent calls mcp with server + tool + args, mcp spawns a subagent, the subagent calls the real mcp__<server>__<tool> with those arguments passed through unchanged, and the server's output comes back. Without server it lists the configured servers, without tool it lists that server's tools. The isolated child turn is what keeps the external payload out of the main transcript, and the shell falls back to an in-process call only when a build has no subagent tool
  • Added Modules, a guide page for the only extension mechanism: how a module is written, where it can come from (SDK modules, this repository's .nanopi/extensions/, or the build), what it can register, the event set, and what it cannot do. docs/sdk.md linked a 06-extensions.ts that no longer exists; the examples table, examples/sdk/README.md, and the focused-example links now point at 06-modules.ts, and the guides that still described extensions as a loadable resource now describe modules (cli.md documented the removed --extension/--no-extensions flags and package commands, security.md project trust listed .nanopi/extensions, compaction.md documented a cut session_compact_failed event)
  • Added the retry.nonRetryableErrorPatterns setting: extra case-insensitive substring patterns that skip automatic retry, for gateways that return a terminal quota or limit error the built-in patterns do not recognize (for example a plain 429 body). Each retry backoff costs up to 14 seconds before such an error surfaces
  • Added the websearch module with two tools, web_search and read_page. Both run on a failover chain that needs no account: Firecrawl's keyless channel first (search and page fetch), then Keenable (search), then Tavily and Exa once keys are configured. Firecrawl and Keenable answer without sign-up, so a fresh install searches and reads pages immediately
  • Added per-engine key rotation to websearch: firecrawl, keenable, tavily, and exa each take a comma-separated key list (apiKey in websearch.json, or FIRECRAWL_API_KEY / KEENABLE_API_KEY / TAVILY_API_KEY / EXA_API_KEY). Auth (401/403), rate-limit (429), and quota (402 or quota wording) failures rotate to the next key before the chain fails over; a 5xx or timeout fails over immediately instead, since it says nothing about the key. A key that reports an exhausted quota is recorded in websearch-state.json and tried last on the next call. See Web Search and Page Reading
  • Added the unofficial Google Antigravity provider (/login antigravity): Google sign-in against the same Cloud Code Assist backend the Antigravity IDE uses. The provider docs call out that third-party clients can get the Google account suspended, and that Google can close the endpoint at any time
  • Added registerBashOperations(id, operations), setActiveBashOperations(id), and getActiveBashOperations() to the module API, plus the operationsProviders/operationsProvider options on BashToolOptions and the exported resolveShellOperations(). BashOperations, createBashToolDefinition({ operations }), and createLocalBashOperations were exported before, but a module had no way to reach the built-in tool's execution backend, so an out-of-tree sandbox or remote runner could not be plugged in without reimplementing the tool. The backend is resolved on every command, so a session can switch at runtime; the resolved id is reported as executed_on in the bash tool's structured output. A backend must wrap exec() rather than replace it, since the caller keeps the description, truncation, renderers, and permission gating
  • Added public SDK exports for the pieces extensions and embedders were reaching into internals for: isBuildComponentEnabled, isBashOnlyBuild, Toolset, build-component helpers alongside the existing config helpers; filterToolDefinitions; DEFAULT_THINKING_LEVEL and THINKING_LEVEL_OPTIONS; DEFAULT_TOOL_NAMES, applyToolModifiers, isToolModifier, getToolListError, createToolNameMatcher, FileSettingsStorage, InMemorySettingsStorage, and the SettingsScope / SettingsStorage / SettingsError types; AuthStorage and `ReadOnlyAut...
Read more

v20261013

Choose a tag to compare

@github-actions github-actions released this 13 Oct 07:00

Breaking Changes

  • Removed the extension plugin system in favor of programmatic modules: the jiti file loader, extension discovery (~/.nanopi/agent/extensions, .nanopi/extensions), the extensions and packages settings keys, --extension/-e/--no-extensions, builtin:<name> resolution, the install/remove/uninstall/list/config subcommands, the npm/git package manager, bundled-extras dist/extras shipping, and runtime module reload are gone. Extensions are now SessionModule objects ({ name, factory }, factory receives a ModuleApi) composed in code via DefaultResourceLoader({ modules }) or createAgentSession({ modules }); the bundled extras, the run-mode module, llama.cpp, the built-in commands, and codex compaction are compiled in as BUILTIN_MODULES. Fourteen zero-consumer events were removed with their emit sites (user_bash, context, context_with_system, cache_warming_decision, after_provider_response, provider_stream_event, agent_before_settle, ui_prompt_start, ui_prompt_end, session_before_switch, session_info_changed, session_compact_failed, thinking_level_select, resources_discover), ExtensionRuntime reload/invalidation machinery was deleted (/reload now only refreshes settings, skills, prompts, and themes), and all Extension* API types were renamed to Module* (ModuleApi, ModuleContext, ModuleUIContext, ModuleRegistry, bindModules(), session.moduleRegistry).

  • Removed the built-in MCP support and the @earendil-works/pi-mcp package: the pi mcp command, mcp.json discovery, --no-mcp, MCP OAuth continuations (pi auth --continue), the mcp/codemode/tool-search built-in extensions, pi.registerMcpServer()/pi.getMcpServers()/mcp_servers_change, the McpServersChangeEvent export, and list_mcp_resources/list_mcp_resource_templates/read_mcp_resource are gone.

  • Removed codemode scripting (the @earendil-works/pi-codemode package, the QuickJS runtime, createCodemodeExtension, createToolSearchExtension, and the codemode settings section) and the "codemode" and "deferred" tool exposures; ToolExposure is now "direct" | "model-only" | "hidden".

  • Changed before_agent_start to also fire for runs started by pi.sendMessage(..., { triggerTurn: true }) while idle. BeforeAgentStartEvent is now a union on messageType: "user" events carry prompt and images, and "custom" events carry the starting message and no prompt. Messages returned by handlers are added to both kinds of run, and pending deliverAs: "nextTurn" messages are delivered with the custom-message run. Handlers that should act only on user prompts must check event.messageType === "user" (#10267, #5581)

  • Changed the session to count as busy while a run starts, including during before_agent_start handlers: ctx.isIdle() is false, pi.sendMessage() queues into the starting run instead of starting a second run that failed with "Agent is already processing", pi.sendUserMessage() requires deliverAs, and an abort requested meanwhile aborts the run once it starts

  • Removed the Bun runtime and compiled-binary distribution: the src/bun/ entrypoints, isBunBinary/isBunRuntime, the Bun sandbox-env restore, the Bun websocket proxy wrapper, build:binary/copy-binary-assets, scripts/build-binaries.sh, the six per-platform release archives, and the Bun install consumer in scripts/local-release.mjs. Node >= 22.19 is the only supported runtime.

  • Renamed the built-in /quit command to /exit, and the built-in /thinking command to /effort.

  • Removed the full screen TUI mode: the tuiMode, fullscreenExitOutput, fullscreenScrollbar, fullscreenCopyOnSelect, and fullscreenWheelScrollLines settings, the --tui-mode flag, the fullscreen transcript layout with its search/selection, the fullscreen-only 3D easter egg, and the now-unused scrollbar*/searchMatch* theme tokens are gone. The interactive TUI always renders inline with the terminal scrollback.

  • Removed the startup loaded-resource listing ([Context]/[Skills]/[Prompts]/[Extensions]); conflict and error diagnostics still render at startup and the listing moved into /status.

  • Removed the user-facing theme system and the /reload command. nanopi always renders with the system theme generated from the terminal's reported colors (grayscale until they arrive, refreshed on terminal light/dark switches): the built-in dark/light themes and their JSON files, custom theme discovery (~/.nanopi/agent/themes, .nanopi/themes), the theme and themes settings, --theme/--use-theme/--no-themes, the /settings Theme submenu and ThemeSelectorComponent, the theme file watcher, schemas/theme.schema.json, and SettingsManager.getThemeSetting()/getTheme()/setTheme()/getThemePaths() are gone; .nanopi/themes no longer requires project trust, and first-time setup is analytics-only. The SDK keeps the rendering layer (Theme class, theme, terminal color detection, getMarkdownTheme() and the other TUI helpers); initTheme() takes no arguments and installs the system theme, refreshSystemTheme() regenerates it, module UI contexts lose getAllThemes()/getTheme()/setTheme(), ResourceLoader loses getThemes(), and exportToHtml() loses its themeName option. The interactive /reload slash command is removed along with its handler; the runtime reload machinery (module-requested and models.json hot reloads) stays, and settings/keybindings/skill/prompt/context changes now require a restart to apply.

Added

  • Added xhigh and max to the thinkingBudgets settings schema, matching the new ThinkingBudgets fields and their 24576/32768-token default budgets.
  • Added the @nanopi/pi-extra run-mode and permission module (new packages/extra workspace package, modes build flavor component): registered as a hidden inline extension it provides plan/minimal/standard run modes via tool_call interception, --yolo, /plan and /mode, permission prompts for edit/write/shell calls (allow once / allow session / reject / let the AI decide), footer badges, subsystem toggles, NANOPI_INIT_MD / NANOPI_API_* ENV overrides, and the webui bridge (modes, permission SSE, settings, OAuth, pairing). Flavors that disable modes alias the module to an inert stub (see scripts/pi-extra-disabled-stub.mjs), leaving no flags, commands, badges, prompts, or bridge endpoints.
  • Added the mcp-lite bundled extra: a zero-dependency slim port of irahardianto/pi-mcp-extension (stdio + streamable-http transports, initialize/tools list+call/cancel, ~/.nanopi/mcp.json + .nanopi/mcp.json config layering, /mcp status). Its tools register as mcp__* with defaultActive: false; pi-subagent-mini forwards the extension to children and adds mcp__* to their default tool list when the extra module's mcp switch is on, and the extra module blocks mcp__* calls in main-agent sessions — MCP is subagent-only. Registers the extra/mcp-lite build flavor component.
  • Added built-in /init (generate an AGENTS.md contributor guide) and /context (interactive context-window distribution dialog with per-part previews) commands, and switched compaction to Codex style by default: every compaction (manual /compact, threshold, overflow) produces a handoff-framed summary with verbatim retention of the last 20,000 tokens of recent user messages across the cut point, rolling file lists, and a TUI-only post-compaction accuracy warning. Ported from the pi-extra-cmd and pi-codex-compact extension packages and registered as built-in inline extensions; any failure (no model, auth, empty summarize set) falls back to the default compaction.
  • Added bundled extras: twelve extension packages vendored under packages/coding-agent/src/extras/ (ask-lite, pi-codex-compact, pi-extra-cmd, pi-fake-codex, pi-fake-opencode, pi-lsp-mini, pi-rewind, pi-simplify, pi-smart-flow, pi-subagent-mini, pi-ui, todo-lite), compiled into every build as BUILTIN_MODULES (no extra/<name> build flavor components, no dist/extras shipping, no runtime registration; see the breaking changes above).
  • Added the pi-lsp-mini bundled extra: zero-dependency LSP integration with lsp_diagnostics, lsp_references, lsp_callgraph, lsp_rename (workspace rename, dry-run by default), and lsp_delete tools plus a /lsp server listing; diagnostics are appended after every write/edit. Language servers spawn lazily per language when first used (typescript/pyright/gopls/rust-analyzer/clangd auto-detected on PATH, overridden or extended via ~/.nanopi/agent/lsp.json). Gated by the extra module's lsp subsystem switch.
  • Added build flavors controlled by the root buildconfig.json: --flavor <name> / NANOPI_BUILD_FLAVOR selects a flavor for scripts/build-coding-agent-bundle.mjs, scripts/build-coding-agent-single-file.mjs, and the coding-agent copy-assets step (now packages/coding-agent/scripts/copy-assets.mjs). Flavors toggle peripheral components (webui, export-html, docs, examples, the goal placeholder, oauth/* flows) in bundle and single-file builds; the npm packages always publish the full flavor, and disabled components fail at runtime with "not included in this build" errors instead of module-not-found.
  • Added nanopi webui [-p <port>] (default port 5335): a loopback HTTP server that serves the new @nanopi/webui browser UI (ported from AtomCode, MIT) and bridges its /chat SSE transport, models, projects, sessions, skills, and filesystem browsing onto a headless AgentSession. nanopi runs tools without per-call approval, so the webui approval mode is always bypass
  • Added webui provider accounts mapped onto models.json: /config returns the vendor-preset and protocol catalogs plus the current accounts, and the provider-account CRUD,...
Read more