Repository navigation
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 the package entry, so a module importing@nanopi/pi-coding-agentfrom the bundle gets the code that is running instead ofdist/index.js(issue #555, issue #558) - A module that registers a working indicator now actually draws the streaming row: the editor's top border went through
super.render, so the embedded line kept the host's spinner-plus-message and pi-ui's shimmer never appeared.renderInBorderasks the subclass'srendernow, and the row receives a realdtMsfrom a frame loop the indicator owns (30fps, stopped on dispose) instead of a hardcoded0that froze the animation (issue #469) - A module can claim ctrl+t again:
app.thinking.toggleis no longer a reserved built-in key, so pi-ui'sregisterShortcut("ctrl+t")takes effect instead of being skipped with "conflicts with built-in shortcut". The editor asks module shortcuts before app actions, so the module that replaces the thinking display owns the press. Every other editor action keeps its key exclusively, and covering one of them is now silent rather than reported as a conflict that was already resolved (issue #464) - pi-ui keeps a way to hide thinking: the core "Hide thinking" row it retires is replaced by a pi-ui one, and the new
ctx.ui.setThinkingHidden()hides the rows in every rendered message. Without it, removing the built-in row also removed the only control for the setting it stored (issue #464) ask_user_questiontells the model which questions the user skipped: a partial submission now ends the envelope withunanswered: "<question>", …and carriesdetails.unanswered(indices), instead of closing with "continue with the user's answers in mind" as if every tab had been settled (issue #449)ask_user_questionpages by the current tab's option window instead of tab 0's, so PgUp/PgDn no longer step by a stale row count when the questions have different option counts- Escape sequences that carry a private parameter byte are stripped whole, so an SGR mouse report (
ESC [ < 35 ; 59 ; 1 M) or a device-attributes reply (ESC [ > 0 ; 276 ; 0 c) no longer leaves35;59;1Mas plain text in tool output.>and<are final bytes only in the two-byte VT52 escapes, which still strip - The HTML export no longer blanks out on sessions with a few thousand entries: the tree helpers walked the session chain recursively, so the export died with
Maximum call stack size exceededinside the page and rendered nothing. They are iterative now, and flattening 50000 entries takes ~50ms grepkeeps ripgrep's line numbers for files that contain an isolated\r: the file was split on\ras well as\n, which inflated the line count, so every context line after a stray CR was printed under the wrong number and away from the match- Skill diagnostics are no longer all labelled
[Skill conflicts]: only name collisions are conflicts, and a missing frontmatter or unreadableSKILL.mdis reported under[Skill warnings]. Same split for prompts pi-memoryno longer writes its/rememberreminder into the footer. The extraction now runs once in the background after the session has gone somewhere, the result is cached for the session, and/rememberbecomes a pure confirmation step that costs no extra model call. A background run reports itself with one transcript notice naming the file, so the reminder no longer competes with the mode badges, checkpoints, and the shell label for the bottom bar's width; sessions with no UI (print, RPC) skip the extraction entirely instead of paying for an answer nobody can confirm (issue #470)install.js --mirror=<url>downloads the bundle from a mirror that carries the release assets instead of GitHub Releases, which makes installation usable where GitHub is slow or blocked. The URL carries the tag (nightlyor a release), so--versionis ignored;--sku,--prefixand--outbehave as before (issue #481)grepandfindfall back to an in-process walk whenrgorfdis unavailable, instead of failing:NANOPI_OFFLINE=1, an unreachable GitHub Releases host, or a container without the binaries all leaveensureToolreturning nothing, and the two read-only tools used to report an error. The fallback walks the tree withignoreandnode:fs, matches lines withRegExpforgrepand paths withminimatchforfind, accumulates ignore rules per directory, re-roots globs the way ripgrep does, does not follow symlinks, and shares the limit, per-file budget and truncation accounting between both paths. The result ends with a notice saying the tool still works and why it degraded (issue #574)- The first LSP request gets its full budget:
remainingMssubtracted a raw elapsed time, so a request submitted 1 ms after the budget was armed ran with 299 ms while the budget's own timer still fired at 300 ms, and the deadline error reported the smaller number. The first request now spends nothing, and only later requests pay for whole milliseconds that actually passed /resumesearch matches a session ID as a literal substring instead of fuzzy-matching it:1024matched digits scattered through a UUID and selected sessions that never contained it, and an exact substring in the body now outranks a fuzzy name hit, so searching a phrase from a message ranks that message's session first (issue #436)- A saved "Do not trust" for a project is honored even when the folder has no trust-requiring resources:
resolveProjectTrustedreturned early and trusted such a folder, andmain.tsre-armed the reload auto-trust for an explicit rejection
Removed
- llama.cpp support: the built-in module (
/llama, the managedllama-serversupervisor started through--internal-llama-supervisor, Hugging Face search and download, thellamaCppsettings keys, and the dynamic catalog that mapped a router's loaded models onto chat and classifier models), its documentation page, and its tests are gone. A llama.cpp router is a compatible endpoint:models.jsonnames its/v1URL and the model IDs it serves, which needs no code here because the router loads a model on first request. The provider was the one built-in serving a single-digit audience while costing a hand-written merge every time the upstream module changed shape (issue #584) - The
llama.cpp-specific post-login message in interactive mode, which pointed at/llama. The generic per-provider message covers a provider with no default model, which is what amodels.jsonprovider is