Skip to content

v20261114

Choose a tag to compare

@github-actions github-actions released this 13 Nov 16:33
· 453 commits to main since this release

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)
  • Session rewrites are one rename instead of an in-place truncate: _rewriteFile() opened the session file with "w" and wrote entries one at a time, so a process killed mid-loop (SIGKILL, power loss) left a file that had already lost its tail. Version migration on open and /branch both go through that path. _rewriteFile() and the compaction write now share writeEntriesAtomically(), which writes a sibling temporary file and renames it over the original (issue #617)
  • Print mode reads the exit code from the last assistant message instead of the last message: a turn that an extension or hook cut short after a tool call ends on a tool result, and comparing only the tail reported a provider or abort failure as success. -p and --output json now exit 1 on that path, and text mode still prints the answer (issue #613)
  • Offline mode no longer refuses the sidecar download outright: a full build embeds neither the photon wasm nor the TUI native prebuilds, so skipping the fetch under NANOPI_OFFLINE left a machine that sets the flag (a container, CI, an NPC session) without the image backend and without the native clipboard, permanently. ensureSidecars now probes each tarball host with one short attempt (4 s) and downloads when a host answers; only an unreachable host keeps the old warning and the degraded image path (issue #586)
  • Images survive a missing photon sidecar: the resize stage was the only thing in the pipeline that could re-encode an image, so photon-unavailable dropped the attachment and the model got [Image omitted: …] instead of base64 — which is every image in an offline install, because ensureSidecars skips the download when NANOPI_OFFLINE is set. An image that already fits both limits the resize stage enforces (the base64 payload budget and the 2000x2000 pixel bound) is now sent as-is with a hint saying it was not resized; only an image that still needs shrinking is omitted. EXIF orientation goes unapplied on that path, which is a rotation the model can see through rather than an image it cannot see at all (issue #586)
  • The webui can sign in to a subscription provider: the settings page lists every provider with an OAuth flow, runs the flow in the browser (auth url, device code, and the questions OpenAI and Anthropic ask — which login method, then a pasted code), and signs out. The server keeps the outstanding prompt on the flow instead of throwing "run nanopi /login in the CLI instead", so a flow that asks a question can finish without a terminal (issue #609)
  • find's in-process walker keeps the **/ prefix it puts in front of a path pattern, and its doc comment no longer nests a glob example that would close the comment block early: the prefix was reported as making ** swallow a directory level and lose src/**/*.ts matches for files directly in src/, but ** matches zero segments at the start of a relative path, so adding and removing the prefix accept exactly the same files. The rewrite changed no behavior and its regression test passed against the code it was meant to guard, so both are reverted. The prefix carries the anchoring fd's --full-path also applies: a path pattern matches from any depth, not only under the search root (issue #669)
  • find loads again: a doc comment described a glob by writing it, and the */ inside closed the comment early, so the file failed to parse and the whole find tool was broken (issue #669)
  • find no longer reports a result limit it did not hit: the notice was built from a hit count that was at or above the limit, so a search that returned exactly as many files as limit ended with N results limit reached and details.resultLimitReached even though nothing was dropped. Both search paths now fetch one result past the limit and cut it in formatFindResult, which makes the cut an observed fact instead of an inference from a count (issue #669)
  • ls and find treat a limit below 1 as 1: limit: 0 broke the entry loop on its first iteration and passed --max-results 0 to fd, so both tools reported (empty directory) or No files found matching pattern for a directory that has files. A model had no way to suspect the answer, which makes a silent false fact worse than an error. Non-integer limits floor to 1 at the same bound, and the schema descriptions say so (issue #669)
  • The webui Moonshot AI account preset defaults to https://api.moonshot.ai/v1 instead of the China host, matching the built-in moonshotai catalog. One catalog serves both endpoints; a China key overrides baseUrl (issue #597)
  • /login says what a Qoder check-in still needs before the user finishes logging in: OAuthAuth carries an optional notice that the dialog shows under its title and nanopi auth login prints before the first question. It is not a login prompt on purpose — the captured identity is not at hand during login, so requiring it there only invites a made-up value (#710)
  • A transcript keeps one Markdown per message body and hands it the new theme on a switch instead of building a fresh one per rebuild, and a streamed delta reuses the block components it already built, so streaming no longer re-renders every settled block per token (#624, #656)

Fixed

  • Turning install telemetry off also stops OpenCode's routing headers: getProviderAttributionHeaders left x-opencode-session / x-opencode-client ungated while the other half of the header set checked the setting, so a user who opted out still sent a session identifier. isProviderAttributionEnabled is now the single answer for both halves (#692)
  • OpenCode's x-opencode-session / x-opencode-client reach the request again: the attribution block lived only on the per-call request options, so whichever of model.headers / options.headers was assigned last won and the session headers disappeared. prepareRequest now merges them per (model, settings, sessionId) and puts them under the caller's headers (#682)
  • The webui turn lock is per session instead of one process-wide flag: a turn in one tab refused a turn in another tab even on a different session, /chat/stop aborted whatever was running, and /chat/active could only answer "something is running". A session that is not the process's own is opened through openRuntimeAt, because one AgentSession serves one run (#601)
  • The webui's dead endpoints are gone, /cd really changes directory, and /mcp/status stops claiming a build has no MCP servers: /live, /tunnel/status, /fs/search and /model-profiles answered with a fake rather than an error and nothing in packages/webui called them, /cd reported a cwd that is fixed for the process, and /mcp/status answered { servers: [], trusted: true } even with mcp-lite stripped (#595)
  • An account added from the webui settings page can hold a turn: the preset's type (the listing protocol) was written into models.json's api field, while the runtime registers its streams under openai-completions / anthropic-messages, so the account listed and looked available and every turn failed with "No API provider registered for api: openai". The add form gained an account id too, without which a second account of the same protocol always collided (#609)
  • A webui questionnaire is announced outside a running turn: the request was only published from inside a streaming turn, so a question raised with no turn running had no reader and hung, and a tab that reloaded mid-turn never saw the event. The open request is process state, listed by /chat/active beside the turns (#609)
  • read with offset/limit streams the page it was asked for instead of reading the whole file: the page is cut as the file arrives, the line count stays exact so the "of N lines" hint is unchanged, and a file whose last line has no terminator keeps that shape instead of gaining one (#669)
  • The questionnaire tool can no longer report a blank answer: Enter on an untouched "Type something." row sent kind: "custom", answer: null, which reached the model as (no input) and read as "answered but empty". A bare \r in model-supplied text is dropped as well, because it broke the row and made the duplicate and reserved-label guards compare unequal strings (#635)
  • Switching back to an answered question in a questionnaire lands on the row the answer came from instead of the first row, so a stray Enter no longer replaces the stored answer with option 1 (#635)
  • pi-rewind keeps its checkpoint state when getRepoRoot returns null: the null return only happens outside a work tree, which isGitRepo already ruled out, and returning early left the extension without a repo root for the rest of the session (#635)
  • The edit tool refuses a file it cannot decode as UTF-8 instead of writing it back full of U+FFFD and reporting success, which is how UTF-16, Windows-1252 and GBK files were silently destroyed
  • The subagent merge gate validates the child's code: it ran in the main checkout, so it passed every branch, broken or not. It now runs in the job's worktree, and a conflicted merge is aborted instead of leaving the checkout in MERGE_HEAD (#620)
  • ModelRuntime.unregisterProvider removes a built-in provider for real: it only dropped the entry and the next refresh() rebuilt it from the built-ins, so the login and logout paths kept seeing a provider they had just removed (#687)