Skip to content

v20261107

Choose a tag to compare

@github-actions github-actions released this 07 Nov 12:57
· 675 commits to main since this release

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 the package entry, so a module importing @nanopi/pi-coding-agent from the bundle gets the code that is running instead of dist/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. renderInBorder asks the subclass's render now, and the row receives a real dtMs from a frame loop the indicator owns (30fps, stopped on dispose) instead of a hardcoded 0 that froze the animation (issue #469)
  • A module can claim ctrl+t again: app.thinking.toggle is no longer a reserved built-in key, so pi-ui's registerShortcut("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_question tells the model which questions the user skipped: a partial submission now ends the envelope with unanswered: "<question>", … and carries details.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_question pages 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 leaves 35;59;1M as 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 exceeded inside the page and rendered nothing. They are iterative now, and flattening 50000 entries takes ~50ms
  • grep keeps ripgrep's line numbers for files that contain an isolated \r: the file was split on \r as 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 unreadable SKILL.md is reported under [Skill warnings]. Same split for prompts
  • pi-memory no longer writes its /remember reminder 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 /remember becomes 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 (nightly or a release), so --version is ignored; --sku, --prefix and --out behave as before (issue #481)
  • grep and find fall back to an in-process walk when rg or fd is unavailable, instead of failing: NANOPI_OFFLINE=1, an unreachable GitHub Releases host, or a container without the binaries all leave ensureTool returning nothing, and the two read-only tools used to report an error. The fallback walks the tree with ignore and node:fs, matches lines with RegExp for grep and paths with minimatch for find, 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: remainingMs subtracted 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
  • /resume search matches a session ID as a literal substring instead of fuzzy-matching it: 1024 matched 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: resolveProjectTrusted returned early and trusted such a folder, and main.ts re-armed the reload auto-trust for an explicit rejection

Removed

  • llama.cpp support: the built-in module (/llama, the managed llama-server supervisor started through --internal-llama-supervisor, Hugging Face search and download, the llamaCpp settings 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.json names its /v1 URL 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 a models.json provider is