Repository navigation
Releases
v20261128
New Features
- Compaction recall & retention: summaries now cite session entries (
[rN]), include## Key Facts(cNrN) and## Replaced Context(E<n>) sections restored on demand viarecall_context, enforce long-session retention rules, and add opt-incompaction.growthGateTokens(see Compaction Reference and Compaction settings) (#767, #794) - Externalized truncated tool outputs: truncated
read,grep,find, andlsresults are saved under the agent directory and paged back in 50KB chunks viarecall_tool_result(#767) - Autonomous image generation (
generate_image): generates or edits images (supportingaspectRatioandsize) 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), andsubagents.preferredCli: unifiedgit(status|diff|log|branch, including reading diffs) and/token-usagejoin the built-in modules, hiddenexecute_manybatches multiple tool calls into one round trip, and subagents can run viaclaude,codex, oragy(see Slash commands) (#803, #824) - Read-only subagent viewer & status UI: pressing
Downin 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_basetoken estimation,Usage.pricingsnapshots, and fail-closed sandbox: context estimation usesgpt-tokenizero200k_baseinstead of character division, costed responses freeze rate snapshots onusage.pricing, and unattended sessions fail closed when a configured sandbox launcher is missing (see Security) (#763, #803)- Embedded sidecars in
full:fullbundles 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, nogh),pi-meat(faithful reading diff via subagent), and/token-usageover the existing usage ledger.subagents-minigainssubagents.preferredCliso 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/Downselects,Enteropens the selected job report,Escexits) without altering the transcript or the live widget under the editor -
Added the hidden built-in
batchmodule (execute_manytool,module/batchbuild component) to run multiple callable tools sequentially or in parallel within one model round trip (issue #803) -
Costed responses now freeze an auditable
Usage.pricingsnapshot (provider,model,revision,rates) viacalculateCost()and preserve it incombineUsage(), keeping historical spend explainable across catalog edits (issue #803) -
A compaction summary cites the session entries behind its facts as
[rN], andrecall_contextreads 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 acontext_recallentry, 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 Factsblock with stable refs (c0r2) to the session entries they compress; therecall_contexttool 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_contextpulls 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_compactcan now post-process a summary it did not write: the event is dispatched a second time withreplacedSummarywhen 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 default0keeps the existing threshold-only behavior (issue #767) -
The
pi-imagemodule registersgenerate_image, the first caller ofmodelRegistry.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_imageaccepts optionalaspectRatio(e.g."16:9") andsize(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
todotool result cards foradd,done,undone, andclearno longer echo the full step list beneath the count summary;liststill 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 useso200k_base(gpt-tokenizer) instead ofchars / 4orchars / 3.5and excludes opaquethinkingSignaturepayloads, preventing severe underestimates on code, JSON, and CJK text (issue #763) mcpsubagent calls now run with only the singlemcp__<server>__<tool>tool and--mcp-only-prompt --no-context-filesinstead of inheritingread, the coding-assistant system prompt, andAGENTS.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-maxinstead of the retiredqwen4-max-preview(upstream22f5f2995) - 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...
v20261114
Added
nanopi mcp add|remove|listmanages MCP servers without a session:addwrites one server to~/.nanopi/mcp.json(or.nanopi/mcp.jsonwith--project),removedeletes it from both, andlistprints 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--forcesays 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 abtwcustom message whose codec projects to nothing: the transcript shows it, the next request does not carry it. A second/btwcontinues the first side thread in memory, so a detour builds up without ever entering the main context.subagentisolates work; this isolates a questionnanopi 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-browserkeeps 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_KEYormodels.jsonregisterMarkdownTransformernow reaches the rows it was documented for: acustommessage body, a compaction or branch summary, and the startup what's-new block, each tagged with its ownmessageType(custom,summary,changelog). Filtering stays in the callback, so no new registration parameter was added; the Mermaid transformer the host registers first is limited touser/assistantso it leaves custom and summary rows alone (#650)- Forking a session whose stored working directory is gone: interactive mode now offers
Continue,Fork, orCancelinstead of only continuing.Forkcopies 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 toctx.switchSession()from extensions, which now takescwdOverridewithforkToCwd;importFromJsonl()takes the same option object instead of a bare cwd override /statusshows 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/activealso acceptswait_sand 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/promptsnow requires a project-trust decision the same way.agents/skillsalready 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:
handleInputranapp.clipboard.pasteImagebefore anything else, so a user who rebound it topageup/pagedownlost 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) findstill finds the files sitting directly in a directory for a path pattern:src/**/*.tsis rewritten to**/src/**/*.tsfor fd, and fd's own**does not cover the files one level undersrc/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:
contextnever reached ripgrep and every block was rebuilt by reading the matched file whole, socontext: 2on 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 owncontextevents, the stream is formatted as it arrives, and the walker (no ripgrep) is the only path that reads a file. A fractionallimitreached the notice verbatim andlimit: 0meant "no limit"; both are floored and clamped.globis now rooted at the search path, sopath: "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:
truncateLinecut 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.stringifystill emits it as\ud83d, and a strict encoder on the receiving side (serde_jsonrejects lone surrogates) then refuses the whole message, which is how a half emoji in a session file broke a request.sliceHeadandsliceTailnow move the cut off the pair, and the compaction summary truncation uses the same helper (issue #634) - Command arguments stop losing words to apostrophes:
parseCommandArgsopened a quote at any'or", so/ask why doesn't the user's cache workreached the model aswhy doesnt the users cache workand 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
\nto the first line ending it found, so one CRLF anywhere rewrote the file to CRLF and a lone CR was erased.applyEditsToNormalizedContentnow also reports the content the matched offsets index into, andapplyReplacementsToOriginalrebuilds 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/restoreLineEndingsare 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:Nbefore 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 aShellTimeoutErrorcarrying the exit code and the status line readsCommand timed out after N seconds and exited with code X.BashOperationsis a public contract, so a backend that keeps throwing the baretimeout:Nmessage still gets the original wording (issue #640) - The removed line of a single-line hunk keeps its indentation:
renderIntraLineDiffranDiff.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 withdiffWordsWithSpace, 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+vandctrl+v: some embedded terminals handCtrl+Vto the program instead of pasting, and a single-value default left the key doing nothing with no hint why (issue [#640](https://cnb.cool/...
v20261107
New Features
-
Module hot reload and hot swap: a module file under
$NANOPI_EXTENSIONS,~/.nanopi/agent/extensionsor.nanopi/extensionscan 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, soadd,change, andunlinkneed 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 optionalSessionModule.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;--hotorsettings.modules.hotReloadturns 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 reportonResponseat all, from the first stream chunk's HTTP response (issue #499) -
Module API split into surfaces:
ModuleApiis now a composition of eight contracts - events, tools, commands, rendering, actions, session, model, and providers - andSessionModule<S>takes the surfaces a module declares, soSessionModule<ModuleCommandsSurface>cannot reachregisterProvideror 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:
estimateMessageTokensreads the session's message-type table, so a kind a module registered throughregisterMessageType()is measured by its ownestimateTokensinstead 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 forglobalThis(issue #457) -
mdSectionHeadingtheme token:/statuspaints its named section headings with a token of their own, defaulting tomdHeading, 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,/forkor/reload.undefinedrecords the key as cleared, so a suppression stays suppressed instead of being reinstalled. pi-ui's todo-widget suppression uses it instead of wrappingsetWidget(issue #457) -
Transcript rows as module contracts: a module can now draw rows it does not own.
registerToolRowRendererrestyles, flattens, or hides the row of a tool another module registered (without replacing itsexecute),registerShellRendererdraws!command rows,registerAssistantMessageRendererdraws an assistant message body,registerWorkingIndicatordraws the streaming working line, andregisterSettingsItem/unregisterSettingsItemadd 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/modulescarries the contracts a module factory needs (SessionModule,ModuleApi,ModuleContext, the event types,isToolCallEventType,ToolDefinition) and@nanopi/pi-coding-agent/uithe rendering surface (Theme,getMarkdownTheme,renderDiff,CustomEditor,ToolExecutionComponent). Writing a module no longer drags in the package root's ~490-name barrel, andcheck:entry-graphsnow 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.steersends 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-cnproviders refresh their models from the account's signed model list on startup, so/modellists 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-checkinruns it on demand andNANOPI_QODER_CHECKIN=0turns it off (issue #398)
Changed
- Retries wait long enough to outlast a throttle: the agent-level retry default
baseDelayMswent 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 withretry_after=30used to exhaust all three attempts in 14 seconds against the same wall (issue #574) fulldrops six cold grammars:buildconfig.jsongainsgrammarSetsand a selectivegrammarscomponent, the mechanismprovidersandapisalready use.fullselectscurated, which excludes1c,mathematica,isbl,gml,sqfandmaxima;baseandminimalname no set and keep every grammar. The build resolves an excludedhighlight.js/lib/languages/<tag>to an empty module so its bytes stay out, andNANOPI_BUILD_GRAMMARSmakessupportsLanguageanswer false for it so the existing plain-text fallback runs. Full's single file goes 10,060,199 → 9,556,039 bytes (issue #528)fulldownloads its native sidecars instead of embedding them: the TUI prebuilds and the photon wasm moved to the existingNANOPI_SIDECARSdownload 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;baseandminimalnever embedded them (issue #528)basekeeps the Bedrock catalog but not the Bedrock implementations:apisgains abedrockset andproviderSetsseparates the catalog from the client, so abasebuild still lists Bedrock models without carrying the AWS SDK implementation. A Bedrock model inmodels.jsonunderbaseis reported as an api the build does not carryminimalno longer bundles the whole OpenAI SDK: withapiscut toopenai-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, andscripts/build-openai-client.mjsaliases the bareopenaiimport 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-sizecatches 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'sNANOPI_BUNDLED_NODEmarker 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 resolvingjiti— the same resolution the lazy import uses — and only the single-filenanopi.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 itsexternallist instead ofBUNDLE_EXTERNAL_PACKAGES, so jiti was bundled and its../dist/babel.cjsrequire failed next to a hashed chunk; and a module's bare imports resolved to the unbundleddist/tree beside the bundle, a second copy of the host whoseText/CustomEditor/Themeclasses fail the TUI's owninstanceofchecks. A bundled runtime now answers fromvirtualModules, andtypeboxjoins 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...
v20261031.1.0
Changed
install.js --versioncompletes a follow-up release line:--version=20261031.1fetchesv20261031.1.0, so a same-day follow-up does not require remembering the patch part. Only the missing.0is filled in — a date alone (--version=20261031) still names that date's tag, and a full tag is used as given
v20261031
New Features
- Prompt presets:
--preset <name|path>appends a preset to the system prompt, looked up aspresets/<name>.mdin the project and then the agent directory, or read from a path - Failure digest: a failed
bashcall ends with a[failures]block carrying the lines each toolchain prints for its failures, and/diagnosewrites the diagnostic bundle on demand (issue #336) /kill-bashbg: stops backgroundbash_bgjobs from the keyboard, one job or all (issue #381)- LSP navigation:
lsp_hover,lsp_definition,lsp_queryandlsp_edit, plus diagnostics beforereadand afteredit(issue #333) - Remember aging:
/rememberentries carry(kept YYYY-MM-DD),--listshows ages,/forgetdeletes by number and--pruneoffers stale entries (issue #214) - Markdown export:
/export <path>.mdand--exportwrite Markdown next to HTML, and each flavor carries only the formats it ships (issue #184)
Breaking Changes
--modeis 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 jsonmust pass--output json.--modeis no longer recognized, and the CLI'sModetype is nowOutputModepi-lsp-mini'slsp_renameandlsp_deleteare now onelsp_edittool withkind: "rename"(plusnewName) orkind: "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.applynow defaults tofalsefor both branches, whererenameused to default totrue: 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, thenapply=true) and no longer writes anything by accident
Added
/kill-bashbgstops backgroundbash_bgjobs from the keyboard: no argument stops every running job,<jobId>stops one,listshows them without stopping anything, and job ids complete as arguments. The jobs are the onespi-smart-flowstarts, 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-minigainedlsp_hoverandlsp_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 afile:lineinstead of a grep. Both takeline/characteror asymbolname 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 withouttextDocument/documentSymbolfalls back to the file text, and hover output is capped at 1600 characters so a 4k doc comment does not undo the saving.readnow also carries the errors a file already has (readDiagnosticsin~/.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 thedidOpenfor that read (issue #333)- Session export now covers Markdown next to HTML, and the build flavors split it the way the SKU ladder does:
fullwrites MD / HTML,basewrites MD only,minimalwrites nothing./export <path>picks the format from the extension (.md,.html,.jsonl; HTML stays the default),--exportdoes the same for a session file,--export-formatoverrides it, and RPC gainsexport_sessionwith aformatfield. 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.pdfname. 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>.jsonlnow 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 readspi-lsp-minican now report a language server's diagnostics for the content aneditjust 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.editruns far more often thanwrite, which is why a language server on that path has to be a choiceNANOPI_DEBUG=1now 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 holdsdiagnostics.json(environment, model and provider with credentials redacted, loaded modules, settings),report.json(failed assistant turns and recorded crashes), the session branch assession.jsonl, and the tail ofnanopi-debug.log, beside abundle.zipwith 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/bugflow 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) andmem first-render(at first usable state) tonanopi-debug.login the agent dir even withNANOPI_DEBUGoff, so the delta between the two lines is what managed tools, grammar loading, and session setup cost.pnpm run profile:tuiprints the same figure asstartup rssandMETRIC startup_rss_mib, next tostartup_time_ms /statusnow reports process memory: RSS, peak RSS, heap, and external/arrayBuffers.NANOPI_DEBUG=1turns on periodic sampling (everyNANOPI_DEBUG_INTERVAL_MS, default 5000) that appends the same line tonanopi-debug.logunder 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,lateston semver tags) andnpm.pkg.github.comgets@nekosekaimoe/nanopi, the same CLI under the scope GitHub Packages requires (GitHub only accepts publisher-scoped names). Both run inbuild-binaries.ymlbefore 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.mjskeeps--provenancefor a return to npmjs (issue #278) - Added the
pi-memorymodule and its/remembercommand: a session's durable conclusions are distilled into the project's context file (AGENTS.mdand 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## Summarysection, 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) /rememberentries now carry an age, and the list they live in can shrink. Every bulletpi-memorywrites 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 --listprints every entry with its age,/forget <numbers>deletes what that list numbers, and/remember --pruneoffers 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 ...
v20261022
New Features
- Web search without keys: the new
websearchmodule shipsweb_searchandread_pagetools 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
mcpshell tool:mcp-liteimports 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.jsonbelow your own~/.nanopi/mcp.json; every MCP call goes through onemcpshell tool that routes to the real server inside an isolated subagent - Modules from disk:
baseandfullbuilds load.ts/.jsmodules 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/autovirtual 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|offwrapsbashcommands inbubblewrap(Linux) orsandbox-exec(macOS): the working directory stays writable, everything else is read-only, and network is cut unless--networkwas passed, with configuration in the extra settings
Breaking Changes
- A tool set can now name the tools it ships (
toolsin thetoolsetComponentsentry ofbuildconfig.json), and the build drops the other tool implementations instead of only filtering them at runtime. Theminimalflavor's tool set listsbashandpowershell, soread,edit,write,grep,find, andlsare no longer compiled in: their barrel exports throw, andcreateAllToolDefinitionsbuilds only the listed tools (namesargument).minimalalso drops OAuth login (oauth/*off: no/loginOAuth option, no/logoutin autocomplete, noxflow code in the bundle), syntax highlighting (syntax-highlightoff: 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-codeoff). Its endpoint support is cut to the OpenAI-compatible chat completions API (newapiscomponent andapiSetsmap,openaiset):models.jsonentries naming anotherapifail with a build-scoped error, and the other API clients stay out of the bundle - Build flavors are now
full,base, andminimal(previouslyfullandminimal).basekeeps the core CLI and every builtin module except the bundled extras, with the standard tool set.minimalisbaseplus thetoolset: "bash"component: the build registers only the shell tools (bash,powershell), soread,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 formerminimal(core CLI without peripherals) is nowbase
Added
- Added module files on disk: the
baseandfullbuilds load.ts/.jsfrom$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 toloadModules()as an ordinarySessionModule. TheSessionModule = { 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 forminimaland for every single-file artifact through the newjiti-modulescomponent (#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.jsonentries — Claude Desktop (claude_desktop_config.jsonon all three platform paths), Cursor (~/.cursor/mcp.json), Windsurf, VS Code (Code/User/mcp.json,serverskey), 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+argsand OpenCode's argv array,type/transport/no discriminator,urlmeans remote,enabled: false/disabled: trueskipped) and${VAR}/${VAR:-default}expand from the environment..nanopi/mcp.jsongains adiscoveryblock (mode: "auto"|"off",globalOnly,include,exclude) because a project config file can start an arbitrary command;/mcpreports 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
mcpshell tool tomcp-lite: every MCP call from the main agent has one shape — the main agent callsmcpwithserver+tool+args,mcpspawns a subagent, the subagent calls the realmcp__<server>__<tool>with those arguments passed through unchanged, and the server's output comes back. Withoutserverit lists the configured servers, withouttoolit 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 nosubagenttool - 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.mdlinked a06-extensions.tsthat no longer exists; the examples table,examples/sdk/README.md, and the focused-example links now point at06-modules.ts, and the guides that still described extensions as a loadable resource now describe modules (cli.mddocumented the removed--extension/--no-extensionsflags and package commands,security.mdproject trust listed.nanopi/extensions,compaction.mddocumented a cutsession_compact_failedevent) - Added the
retry.nonRetryableErrorPatternssetting: 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
websearchmodule with two tools,web_searchandread_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, andexaeach take a comma-separated key list (apiKeyinwebsearch.json, orFIRECRAWL_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 inwebsearch-state.jsonand 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), andgetActiveBashOperations()to the module API, plus theoperationsProviders/operationsProvideroptions onBashToolOptionsand the exportedresolveShellOperations().BashOperations,createBashToolDefinition({ operations }), andcreateLocalBashOperationswere 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 asexecuted_onin the bash tool's structured output. A backend must wrapexec()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_LEVELandTHINKING_LEVEL_OPTIONS;DEFAULT_TOOL_NAMES,applyToolModifiers,isToolModifier,getToolListError,createToolNameMatcher,FileSettingsStorage,InMemorySettingsStorage, and theSettingsScope/SettingsStorage/SettingsErrortypes;AuthStorageand `ReadOnlyAut...
v20261013
Breaking Changes
-
Removed the extension plugin system in favor of programmatic modules: the jiti file loader, extension discovery (
~/.nanopi/agent/extensions,.nanopi/extensions), theextensionsandpackagessettings keys,--extension/-e/--no-extensions,builtin:<name>resolution, theinstall/remove/uninstall/list/configsubcommands, the npm/git package manager, bundled-extrasdist/extrasshipping, and runtime module reload are gone. Extensions are nowSessionModuleobjects ({ name, factory }, factory receives aModuleApi) composed in code viaDefaultResourceLoader({ modules })orcreateAgentSession({ modules }); the bundled extras, the run-mode module, llama.cpp, the built-in commands, and codex compaction are compiled in asBUILTIN_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),ExtensionRuntimereload/invalidation machinery was deleted (/reloadnow only refreshes settings, skills, prompts, and themes), and allExtension*API types were renamed toModule*(ModuleApi,ModuleContext,ModuleUIContext,ModuleRegistry,bindModules(),session.moduleRegistry). -
Removed the built-in MCP support and the
@earendil-works/pi-mcppackage: thepi mcpcommand,mcp.jsondiscovery,--no-mcp, MCP OAuth continuations (pi auth --continue), themcp/codemode/tool-searchbuilt-in extensions,pi.registerMcpServer()/pi.getMcpServers()/mcp_servers_change, theMcpServersChangeEventexport, andlist_mcp_resources/list_mcp_resource_templates/read_mcp_resourceare gone. -
Removed codemode scripting (the
@earendil-works/pi-codemodepackage, the QuickJS runtime,createCodemodeExtension,createToolSearchExtension, and thecodemodesettings section) and the"codemode"and"deferred"tool exposures;ToolExposureis now"direct" | "model-only" | "hidden". -
Changed
before_agent_startto also fire for runs started bypi.sendMessage(..., { triggerTurn: true })while idle.BeforeAgentStartEventis now a union onmessageType:"user"events carrypromptandimages, and"custom"events carry the startingmessageand noprompt. Messages returned by handlers are added to both kinds of run, and pendingdeliverAs: "nextTurn"messages are delivered with the custom-message run. Handlers that should act only on user prompts must checkevent.messageType === "user"(#10267, #5581) -
Changed the session to count as busy while a run starts, including during
before_agent_starthandlers: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()requiresdeliverAs, 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 inscripts/local-release.mjs. Node >= 22.19 is the only supported runtime. -
Renamed the built-in
/quitcommand to/exit, and the built-in/thinkingcommand to/effort. -
Removed the full screen TUI mode: the
tuiMode,fullscreenExitOutput,fullscreenScrollbar,fullscreenCopyOnSelect, andfullscreenWheelScrollLinessettings, the--tui-modeflag, the fullscreen transcript layout with its search/selection, the fullscreen-only 3D easter egg, and the now-unusedscrollbar*/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
/reloadcommand. 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-indark/lightthemes and their JSON files, custom theme discovery (~/.nanopi/agent/themes,.nanopi/themes), thethemeandthemessettings,--theme/--use-theme/--no-themes, the/settingsTheme submenu andThemeSelectorComponent, the theme file watcher,schemas/theme.schema.json, andSettingsManager.getThemeSetting()/getTheme()/setTheme()/getThemePaths()are gone;.nanopi/themesno longer requires project trust, and first-time setup is analytics-only. The SDK keeps the rendering layer (Themeclass,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 losegetAllThemes()/getTheme()/setTheme(),ResourceLoaderlosesgetThemes(), andexportToHtml()loses itsthemeNameoption. The interactive/reloadslash 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
xhighandmaxto thethinkingBudgetssettings schema, matching the newThinkingBudgetsfields and their 24576/32768-token default budgets. - Added the
@nanopi/pi-extrarun-mode and permission module (newpackages/extraworkspace package,modesbuild flavor component): registered as a hidden inline extension it providesplan/minimal/standardrun modes viatool_callinterception,--yolo,/planand/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 disablemodesalias the module to an inert stub (seescripts/pi-extra-disabled-stub.mjs), leaving no flags, commands, badges, prompts, or bridge endpoints. - Added the
mcp-litebundled 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.jsonconfig layering,/mcpstatus). Its tools register asmcp__*withdefaultActive: false; pi-subagent-mini forwards the extension to children and addsmcp__*to their default tool list when the extra module's mcp switch is on, and the extra module blocksmcp__*calls in main-agent sessions — MCP is subagent-only. Registers theextra/mcp-litebuild 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 asBUILTIN_MODULES(noextra/<name>build flavor components, nodist/extrasshipping, no runtime registration; see the breaking changes above). - Added the
pi-lsp-minibundled extra: zero-dependency LSP integration withlsp_diagnostics,lsp_references,lsp_callgraph,lsp_rename(workspace rename, dry-run by default), andlsp_deletetools plus a/lspserver listing; diagnostics are appended after everywrite/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'slspsubsystem switch. - Added build flavors controlled by the root
buildconfig.json:--flavor <name>/NANOPI_BUILD_FLAVORselects a flavor forscripts/build-coding-agent-bundle.mjs,scripts/build-coding-agent-single-file.mjs, and the coding-agentcopy-assetsstep (nowpackages/coding-agent/scripts/copy-assets.mjs). Flavors toggle peripheral components (webui,export-html,docs,examples, thegoalplaceholder,oauth/*flows) in bundle and single-file builds; the npm packages always publish thefullflavor, 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/webuibrowser UI (ported from AtomCode, MIT) and bridges its/chatSSE transport, models, projects, sessions, skills, and filesystem browsing onto a headlessAgentSession. nanopi runs tools without per-call approval, so the webui approval mode is alwaysbypass - Added webui provider accounts mapped onto
models.json:/configreturns the vendor-preset and protocol catalogs plus the current accounts, and the provider-account CRUD,...