Repository navigation
v20261114
·
453 commits
to main
since this release
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) - 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/branchboth go through that path._rewriteFile()and the compaction write now sharewriteEntriesAtomically(), 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.
-pand--output jsonnow exit 1 on that path, and text mode still prints the answer (issue #613) - Offline mode no longer refuses the sidecar download outright: a
fullbuild embeds neither the photon wasm nor the TUI native prebuilds, so skipping the fetch underNANOPI_OFFLINEleft a machine that sets the flag (a container, CI, an NPC session) without the image backend and without the native clipboard, permanently.ensureSidecarsnow 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-unavailabledropped the attachment and the model got[Image omitted: …]instead of base64 — which is every image in an offline install, becauseensureSidecarsskips the download whenNANOPI_OFFLINEis 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 /loginin 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 losesrc/**/*.tsmatches for files directly insrc/, 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-pathalso applies: a path pattern matches from any depth, not only under the search root (issue #669)findloads 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)findno 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 aslimitended withN results limit reachedanddetails.resultLimitReachedeven though nothing was dropped. Both search paths now fetch one result past the limit and cut it informatFindResult, which makes the cut an observed fact instead of an inference from a count (issue #669)lsandfindtreat alimitbelow 1 as 1:limit: 0broke the entry loop on its first iteration and passed--max-results 0to fd, so both tools reported(empty directory)orNo files found matching patternfor 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/v1instead of the China host, matching the built-inmoonshotaicatalog. One catalog serves both endpoints; a China key overridesbaseUrl(issue #597) /loginsays what a Qoder check-in still needs before the user finishes logging in:OAuthAuthcarries an optionalnoticethat the dialog shows under its title andnanopi auth loginprints 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
Markdownper 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:
getProviderAttributionHeadersleftx-opencode-session/x-opencode-clientungated while the other half of the header set checked the setting, so a user who opted out still sent a session identifier.isProviderAttributionEnabledis now the single answer for both halves (#692) - OpenCode's
x-opencode-session/x-opencode-clientreach the request again: the attribution block lived only on the per-call request options, so whichever ofmodel.headers/options.headerswas assigned last won and the session headers disappeared.prepareRequestnow 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/stopaborted whatever was running, and/chat/activecould only answer "something is running". A session that is not the process's own is opened throughopenRuntimeAt, because oneAgentSessionserves one run (#601) - The webui's dead endpoints are gone,
/cdreally changes directory, and/mcp/statusstops claiming a build has no MCP servers:/live,/tunnel/status,/fs/searchand/model-profilesanswered with a fake rather than an error and nothing inpackages/webuicalled them,/cdreported acwdthat is fixed for the process, and/mcp/statusanswered{ 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 intomodels.json'sapifield, while the runtime registers its streams underopenai-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/activebeside the turns (#609) readwithoffset/limitstreams 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\rin 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-rewindkeeps its checkpoint state whengetRepoRootreturns null: the null return only happens outside a work tree, whichisGitRepoalready 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.unregisterProviderremoves a built-in provider for real: it only dropped the entry and the nextrefresh()rebuilt it from the built-ins, so the login and logout paths kept seeing a provider they had just removed (#687)