Repository navigation
kb v0.54
kb v0.54 — web terminal 2
A minor release on v0.53. It turns the opt-in web terminal into a fuller
workspace: a Terminals hub with a launcher and switcher, a seven-tab right rail,
a command palette, file upload and download, and a much better phone view. It
also makes memory recall quieter when it has nothing new to say, fixes the
session chain walker across current Claude Code compactions, and widens the
terminal file deny list. There is no schema migration.
Before you upgrade
- Schema: unchanged, V0048. No migration changed since v0.53, so a v0.53
volume opens on v0.54 and the reverse. There is no new rollback boundary; the
only limit is the existing V0048 one (a v0.52.x daemon refuses a V0048
volume). - No breaking change and no config key changed default. The daemon side
is additive or opt-in.GET /api/identitygains one additive field,
state_instance. - One hook behaviour change (#306). After you update the plugin checkout,
kb-memoryrecall omits memories already served in the same session and
skips recall for trivial prompts. Both are on by default, with kill switches
KB_RECALL_DEDUP=0andKB_RECALL_SKIP_TRIVIAL=0. Context-aware recall
stays off unlessKB_RECALL_CONTEXT=1. - Token totals shift down (#382). Token usage is now deduped by message
id; Claude transcripts repeat usage per content block, so earlier totals
were over-counted by roughly two to three times. The session view header and
the cardstatslane show the corrected totals at once. The stored
per-sessiontoken_totalused by list rows and rollups keeps its old value
until that session is captured again or you runkb reindex. Nothing else
is rewritten. - kb-code stays at v9.2. No kb-code feature change; a new image is optional
and only picks up two small SPA fixes (see "kb-code"). - Update the plugin checkout. Recall dedup, the trivial skip, the epoch
marker and the detached spool drain live in thekb-memoryplugin scripts,
which run from the checkout, so fast-forward it. - Upgrade the kb-term runner with the daemon for runner-side features.
Suggested order: redeploy the daemon, re-run thekb-terminstaller and
systemctl --user restart kb-termd.service(restartkb-termdonly, never
thekb-term@*holder units; open terminals survive), then update the host
kbCLI and the plugin checkout.- An older runner answers the per-file diff with 200
{"state":"runner-too-old"}, and a Files request for an extra browse root
with 501urn:kb:errors:terminal-runner-too-old. The SPA says to update
the runner (#442, #443). Only the old runner's own "unknown field"
messages map to these; other runner validation errors stay 400 (#455). - A new daemon with an older runner does not break otherwise. The one-request
send (#353) needs the new runner. - An older daemon with the new plugin leaves the status chips empty; the
daemon needs the typed status beat (#379).
- An older runner answers the per-file diff with 200
- Opt-in host steps are in "Host steps for the web terminal 2 features" in
docs/kb-term-install.md. None changes a default:- Files corpus (upload, download, Keep in kb). Add a corpus on a
writable directory the daemon user owns (a read-write volume in the compose
layout), then set[terminal.files] kb = "<corpus>". Without it an upload
still reaches the terminal's own working area, and Keep in kb answers 409
terminal-files-not-configured(#368, #405). - Live capture. Set
KB_CAPTURE_LIVE=1in the harness environment
(optionallyKB_CAPTURE_MIN_INTERVAL_SECS). Off by default; each capture
re-embeds and reindexes that session, so keep the interval long on a slow
disk (#376). - Status chips. For Claude Code, wrap the user settings'
statusLine.commandwithkb-status-tee.sh. For omp, fast-forward the
plugin checkout and restart omp (#387). - Extra browse roots (optional):
[terminal.files] browse_roots, empty
by default (#443).
- Files corpus (upload, download, Keep in kb). Add a corpus on a
- PATH drop-in order (#366). The installer's
kb-termdPATH drop-in now
lists thekband harness directories in your shell's order, then
/usr/local/bin:/usr/bin. An earlier directory shadows a later one, so a
stale harness copy earlier in the path is what every pane launches.
kb-term doctorwarns when the runner and your shell resolve a harness to
different files. After moving or reinstalling a harness, re-run the installer
or reorder the PATH by hand.
All terminal features need [terminal] enabled = true and a caller the terminal
tier admits (terminal_admitted on GET /api/identity). With the tier off
there is no door, badge or route.
New: start, resume and manage terminals from the web (#333, #385, #375, #395)
- Start or resume from the SPA (#333). Launch a new kb-term session or
resume one without a shell on the host. - Terminals door and hub (#385). A new Terminals door in the top bar
carries a badge counting blocked terminals./terminalslists every terminal
in order: needs you (oldest block first), pinned, working, idle, then a
collapsed Ended group. Project, harness and needs-you filters live in the
URL./term/:idand the old/sessions?term=<id>redirect to
/terminals/:id. - Launcher (#375, #395).
- New session opens a dialog on desktop and a sheet on a phone, with a
working-directory field, harness chips (claude, codex, omp; opencode and
grok marked experimental) and a Resume tab that searches kb sessions. - A confirm step shows the exact directory and harness before the single
launch request. - An optional one-line first prompt is pasted without Enter once the
terminal is live. It never appears in a URL, request body or log (#406). - Continue in terminal on a session page or list row opens the launcher
prefilled and never launches by itself. Deep link:
/terminals?launch=1&resume=<sid>.
- New session opens a dialog on desktop and a sheet on a phone, with a
- Terminal limit (#391, #439). A launch over
[terminal] max_termsis
refused with 429terminal-cap. The check and the spawn run under one lock,
and each attempt writes one audit log line with no prompt text. The hub
header reads "N of M terminals" and the confirm step disables Launch at the
cap. A daemon without the new fields shows neither. - Row actions (#418). Pin, rename (a browser-local label), End or Remove,
Restart, Duplicate and Copy attach command. Clear ended removes every
ended row after one confirm. End asks first and names the harness and
directory. - Switcher (#408, #409). A header popover lists terminals grouped This
project and Everywhere, needs-you first, and marks an ask differently from a
finished turn. Alt+Down, Alt+Up and Alt+N move between terminals; on desktop
[]nNdo the same when focus is outside the pane. Wide windows get
a switcher column beside the page. - Phone hub (#417). One column with a fixed New session bar and a scrolling
filter strip.
New: the terminal page, header and grid ownership (#388, #394, #332, #337, #334, #347)
- One-row header (#388). Harness, project, state dot, the program's own
title, a More menu, the Commands button and the switcher. The status chips
(model, context %, cost, permission mode, branch) come only from the typed
status beat. - State overlays (#394). Calm cards cover first connect, reconnecting,
ended, expired and blocked, and never resize the pane. A needs-you banner
names the pending tool and question and links to the Conversation row (#407). - Fit and grid ownership (#332, #334). The panel fits the font, not the
grid, and shows "Cropped" when even the smallest font cannot hold the grid. A
chip shows the owner and size, for example201x48 · web,· local attach
or· free. Fit to window takes the grid and Release grid gives it
back. The web outranks a local attach. A grid change from another client no
longer leaves the panel cropped with a small font (#347). - Full screen (#337) never takes the grid, and adds a visible typing state,
copy and links. A picture can be pasted or dropped onto the panel (#350). - Fonts and colour. Real bold and italic JetBrains Mono plus terminal
symbol faces for box drawing and powerline (#454). The ANSI 16 colours are
derived from the theme with a minimum contrast ratio of 4.5 (#367). - Accessibility and visual passes (#401, #422, #441). The pane is a labelled
region, screen-reader mode is a browser-local switch, and rail tabs follow the
WAI-ARIA tabs pattern with one polite announce region. The second visual pass
fixed overflow and sizing problems.
New: the right rail (#371, #384, #413, #399, #404, #398, #400)
Seven tabs in fixed order: Now, Conversation, Changes, Files, Knowledge, Board,
Commands. The open state and selected tab are remembered in the browser. Each
section says how fresh it is.
- Conversation (#384). One row per human turn, with prompt, answer excerpt,
asks and commits. Resend pastes a prompt or answer back without Enter
(#416). The tab shows the newest 100 turns; Load earlier fetches more and
Load all stops at 2,000 (#428). Client-side search, a Mine-only view and
browser-local bookmarks (a star per turn, never leaving the browser), with a
compact two-row header (#449). A session the daemon has not yet bound shows a
presumed binding, captioned "Session linked by folder"; presumed sessions feed
reads only (#383, #427). - Now (#413, #414). Needs-you, current activity, status, the latest answer,
slate asks, sibling terminals and compact session stats. It also holds the
prompt queue, a per-project to-do list shared across devices. Send pastes
the prompt without Enter and marks it done. The daemon never sends a queued
prompt itself. - Changes (#399, #442). Files touched and commits. An edited file expands to
its working-tree diff against HEAD, fetched on demand, with a typed card for
each state (untracked, binary, too large, not a repository and so on). The
runner's deny list applies to diffs, and a diff answers for exactly one
path: any other set of paths isnot-a-file, a denied name isdenied. - Files (#404, #405, #425, #443, #450).
- Upload (any file type, 32 MiB per file) goes to the session's upload area,
and into the files corpus when[terminal.files] kbis set. - Browse, Download (always an attachment) and Keep in kb, which copies a
file only on your click and indexes content only if you tick "index
content". - Kept in kb lists kept files with download, Open in kb and Send to this
terminal. It shows the newest 1,000 only and says so. - Browse roots add a Location switcher for operator-allowed extra
directories, download-only. - Paste path is shell-quoted and sent without Enter.
- Upload (any file type, 32 MiB per file) goes to the session's upload area,
- Board (#398, #438). Open asks first, answerable in place. "This session's
posts" matches by exact session id when the post carries one, otherwise by
short id plus harness, captioned "probably yours". - Knowledge (#400, #434). Memories injected and written, a project memory
search, similar sessions and docs. Remember saves a memory from a
composer. Flag files a[kb-flag]comment through the existing routes;
neither adds a route.
New: command palette, catalogue and Settings editor (#378, #381, #389, #402, #396, #435)
- Catalogue. Per-harness commands, chords and quick replies
(kb-term-commands/1) for claude and omp, checked in Rust and TypeScript
against one shared golden. Operator edits are a small overlay stored by the
daemon, so every device sees one catalogue. - Provenance (#435). Each shipped command or chord is marked verified
(source and date) or "Not checked". - Palette. The header's Commands button and Alt+K open a searchable palette,
and the same list is the Commands tab. Paste entries go in as one line without
Enter. Run entries send Enter, which the server can still refuse while the
session is blocked. - Settings. A Terminal tab holds browser-local preferences; a Terminal
commands tab adds, edits and hides entries, saved with onePUT(#396).
New: notifications and the attention badge (#393, #352, #423)
- When another terminal asks or finishes a turn, one toast offers Go to it, and
bursts fold into one. - The tab title and installed-app badge count blocked sessions plus
finished-unseen terminals. - System notifications are opt-in, off by default, via Settings > Terminal.
They are disabled with an explanation where the browser cannot support them,
such as Android Chrome.
New: the web terminal on a phone
- Sheet and key bar (#403, #343). The key bar sends key names over the
terminal WebSocket from a closed vocabulary: Esc, Tab, Shift+Tab, arrows,
Enter, Backspace, Ctrl-C, Ctrl-D and Ctrl-U. Ctrl-C and Ctrl-D must be held
for 600 ms. A held/or the Cmds key opens the Commands sheet. The key row
scrolls sideways. - One-request send (#353). The composer's Send is one request and one tmux
process instead of four, which cost 0.7 to 1.3 s on a loaded host. The server
pastes, then presses Enter through the same 400 ms quiet guard. If the paste
lands but Enter does not, you see "Pasted, not sent". Enter is still refused
with 409 while the session is blocked on you. Needs the new runner; the
separateenterroute remains for older clients. - Quick replies and drafts (#343, #364). Up to six short replies kept in
your browser and editable. A reply starting with/or@is pasted, not
sent, and a blocked session gets a paste without Enter. The composer draft is
kept per terminal for a day and cleared by a successful send. Drafts are
plaintext in the browser's localStorage. - Links (#344).
httpandhttpstext in Read is tappable and opens in a
new tab. Copy all joins wrapped rows, so a long URL copies whole. - Landscape (#351, #356). A phone in landscape (coarse pointer, viewport
under 600 px high) gets the phone view; a landscape tablet keeps the desktop
panel. Quick replies join the key row and the composer is one line, so the
terminal keeps at least half the sheet. A floating Fit to phone sits over the
pane. Back closes the sheet on iOS through one history entry (not verified on
a real device). - Commands sheet (#411). The harness's catalogue above the key bar. Entries
are pasted without Enter, or sent with Enter for run entries (the server may
refuse it). Find lives in this sheet on a phone (#448). - Files on the phone (#412, #397, #404). A Files tab in the sheet: Browse,
Download, Recent and Kept in kb, plus shell-quoted paste of a path. - Upload from the phone (#440, #390). Any file can be uploaded into the
terminal's per-session upload area, from the capture sheet's "Upload a file"
entry or the/send-filepage. Images can also be pasted into the composer.
Sharing a non-text file from the OS share sheet is not supported. - Polish (#448, #415). 44 px touch targets, a one-line needs-you banner with
a per-ask Dismiss, and a paste that collapses the rail sheet. - Direct typing: experimental, default OFF (#372, #386, #403, #424). A
browser-local preference, not a daemon setting. Turn it on in Settings >
Terminal ("Type directly in the terminal on this phone"), in the dock, or
with a one-shot?direct=1|0. When on, typed input goes out as ordinary
WebSocket input under the same gate as desktop typing. The key bar adds
S-Enter, Home, End, PgUp, PgDn and Delete, plus sticky Ctrl. A paste is
bracketed if the pane enabled it, else flattened to one line. It still awaits
real-device acceptance (swipe typing, dictation, IME).
New: host, plugin and runner side
- Status beat (#379, #387). The daemon takes a typed
statusbeat (model,
context %, cost, mode, branch) into live-status. For Claude Code set
"command": "<plugin-dir>/hooks/kb-status-tee.sh -- <your current statusLine command>"; your status line keeps its output and exit code. The beat is sent
by a detached job, only on change, at most everyKB_STATUS_MIN_INTERVAL_SECS
(default 5;KB_STATUS_REFRESH_SECSalso applies). The omp extension sends
the same beat after you fast-forward the plugin checkout and restart omp.
KB_BEAT_STATUS=0turns status beats off. - Capture on a blocked beat (#376). With
KB_CAPTURE_LIVE=1, a blocked
session triggers one debounced capture (KB_CAPTURE_BLOCKED_DEBOUNCE_SECS)
that bypasses the interval, so the pending question reaches the Conversation
tab and the needs-you banner. omp gets mid-turn capture parity. - omp capture stats (#380). Cache read/write, cost, duration and context.
Cost is shown only when the harness reports it, never estimated. - Session stats (#382, #392, #413). Token usage deduped by message id (see
"Before you upgrade"); a time model that counts operator wait only for gaps
within the 300 s idle threshold and reports longer gaps separately; and a
statslane on the session card. kb doctor --hooks(#433, #444). Four status rows:status-tee-claude,
status-ext-omp,status-samples-claude,status-samples-omp. A harness you
never wired reads as SKIP, not WARN, so--strictdoes not exit 1 on a host
that never opted in.- Runner (
kb-term,kb-termd,kb-tap).- Chunked upload store and file ops,
fs lsandget, for listing and
downloading from a terminal's working area (#370, #397). Limits (see
docs/spike-findings.md): 8 MiB per chunk, 32 MiB per file, 128 MiB
per-session upload area, listings capped at 500 entries. - Read-only per-file diff against HEAD in the launch directory (#442).
[terminal.files] browse_roots: up to 8 operator-allowed extra
directories, read-only and download-only (#443).- Web outranks a local attach on the grid (#334, #342). A web take needs
no force. A local attach can never take the grid from the web, even forced
(refusedgrid-owned), and a local attach that lost the grid never types
into the session. Attach repaints on every re-join and shows notices on a
status line (#340). The tap learns a pane's real grid at attach, so a
terminal launched at a non-default size reaches the web at that size
(#339). A cursor move before a colour SGR is kept (#330).
- Chunked upload store and file ops,
New HTTP routes
All sit behind [terminal] and the terminal gate, and refuse bearer-token
callers by default (refuse_token_callers).
They are listed in docs/api-routes.md and docs/http-api.md.
GET/POST /api/term-prompts/{project}lists and appends to a project's prompt
queue (#377).PATCH/DELETE /api/term-prompts/{project}/{item}edits (If-Match required) or
removes an item (#377).GET/PUT/DELETE /api/terms/commandsreads, replaces (If-Match required) or
resets the command catalogue overlay (#381).GET /api/terms/{id}/lslists the working area (#397).GET /api/terms/{id}/filedownloads one file, attachment only (#397).POST /api/terms/{id}/filesuploads any file into the working area, and into
the files corpus when configured (#390).POST /api/terms/{id}/files/keepkeeps a working-area file in the files
corpus (#405).GET /api/terms/files/keptlists kept files, newest first (#425).GET /api/terms/{id}/kept/{artifact_id}downloads a kept original as an
attachment (#425).GET /api/terms/{id}/diffreturns one file's diff against HEAD with typed
states (#442).
Existing routes were extended without a new path: GET /api/terms gains
live_count and max_terms (#439); unbound terminal rows gain session_hint
(#383); session view and card gain ?fields=conversation and a stats lane
(#369, #413); live-status gains a status field (#379); slate who gains
session_id (#438).
New config keys (docs/configuration.md)
[terminal] max_terms(default 8; 0 refuses every launch) caps live
terminals (#391).[terminal.files]turns the Files corpus feature on; absent means off (#368).
kbnames the writable corpus for uploaded and kept files;browse_roots
lists up to 8 extra absolute directories the Files tab may browse and
download from (#443).- Plugin environment variables (set on the harness machine, not in
kb.toml):
KB_CAPTURE_LIVE,KB_CAPTURE_MIN_INTERVAL_SECS,
KB_CAPTURE_BLOCKED_DEBOUNCE_SECS,KB_STATUS_MIN_INTERVAL_SECS,
KB_STATUS_REFRESH_SECS,KB_BEAT_STATUS(#376, #387).
Recall: stays quiet when it has nothing to add (#306)
- Context-aware query.
kb recallandkb turngain--transcriptand
--turns. The CLI builds the query from the prompt plus the last few prose
turns of the live Claude Code transcript (newest first, capped at 1200
characters, a duplicate of the newest human turn dropped). Without the flags
nothing changes and there is no server change. A transcript is unscrubbed
mid-flight content, so a non-loopback daemon URL ignores--transcriptwith
one line on stderr. The hook passes it only whenKB_RECALL_CONTEXT=1and a
readabletranscript_pathexists. - Per-session dedup.
GET /api/memory/recallandGET /api/turnaccept
dedup_session=1(withsession=) andserved_after=<unix>. Memories
already served to the session are excluded after scoring and before
truncation, so surviving hits keep their score decomposition. The response
carries an additivededup_removed, omitted at zero. If the ledger is missing
or unreadable, nothing is deduped andrecall.dedupis listed in
degraded[]. CLI:--dedup-session,--served-after. - Reset on compact or clear. The hook dedups by default when a session id is
known, andkb-wake.shwrites a per-session epoch marker on SessionStart with
source compact or clear, so a memory can be served again after a reset. - Trivial-prompt skip. The hook skips only the recall lane for a real
/commandfirst token, or a prompt with fewer than two word tokens of 3 or
more characters, when no context transcript is passed. A prompt with two or more CJK
characters is never treated as trivial. kb bench recall. A policy bench for memory recall. It recomputes each
policy from one raw top-50 pool with a pinned clock, with and without context
composition, and publishes aggregates only; the report writer refuses to emit
fixture queries or memory text. The cross-encoder arm needs thekb-embedder
binary and is reported as skipped without it.- The session-pointer lane that #306 describes is a planned design ruling
(invariant #11 POINTER amendment), not built. No pointers are injected in this
release.
Sessions
- The chain walker crosses current Claude Code compactions (#328). Current
auto-compactions pointlogicalParentUuidat an attachment written after the
boundary, and the walker used to stop at a cycle note there, so a handoff lost
every pre-compaction turn. The walk now continues from the last non-sidechain
record before the boundary. Boundaries whose target precedes them are walked
as before. - Rewound prompts are marked (#326). One shared
parentUuidwalker serves
both the handoff and the view.session-view/1derivesrewoundper read,
and the HTML reader andkb sessions readcaption it. If the chain walk ends
before the first turn, no marks are made. Nothing is stored and the mark never
affects ranking. - A kb-term session is reachable before its first capture (#329).
GET /api/sessions/{sid}/cardfor an id with a live-registry row but no
capture answers 200 with a live-only card, markedcapture_pending: true. It
carries no more than live-status does under its scrub floor and persists
nothing. An unknown id still returns 404. The session page renders it, and
each Now-band row links to its session.
Doctor, hooks and slate
kb doctor --hooksbackup-age (#327). The daemon writes a per-state-dir
state-instancemarker at boot and serves it onGET /api/identity. The host
CLI no longer reports FAIL for a leftover state directory the daemon does not
use; it prints one SKIP pointing to running the doctor inside the daemon's
container. An older daemon without the marker is grandfathered with a
backup-age-originSKIP.--fixhelp (#327). Help anddocs/cli.mdlist all six session-marker
prefixes--fixremoves, and a test keeps them in step.- Large spooled captures drain (#327). After a good capture the Stop hook
replayed the spool with a hard 10 s cap, so a transcript of tens of MB stayed
spooled. The rest now goes to one detached, locked drainer bounded by
KB_SPOOL_DRAIN_SECS(default 600);KB_SPOOL_SYNC_SECSis the synchronous
slice (default 10). - Capture-scrub audit is bounded (#322). The
--hooksscrub audit has a 5 s
wall budget (KB_DOCTOR_SCRUB_BUDGET_SECS, 0 = none) and skips files over
2 MiB (KB_DOCTOR_SCRUB_MAX_FILE_MB, 0 = none). It could previously run for
about 25 minutes on a large corpus. Omitted work is counted and the line says
[PARTIAL: ...]. Exit codes are unchanged. - Slate (#321).
kb slate delta --kinds ...with no--sinceadvanced the
shared cursor and skipped found/idea/tried posts the per-prompt lane should
still serve. A kinds-filtered delta now keeps its own
slate-push-cursor-<sid>and never writes the shared cursor. Unfiltered
delta,openand--sinceare unchanged.
Smaller terminal fixes
- A failed terminal poll no longer clears the finished-unseen marks, and an
edited catalogue entry keeps its verified provenance until the command
itself changes (#444). - The runner's kill reply no longer includes tmux's stderr,
kb-termdsets up
logging before it parses its config, and XTVERSION reports the stamped
version (#319).
Indexer
- A file with an old mtime removed inside the debounce window no longer stays
indexed (#318). Files arriving with an old mtime (mv,cp -p, rsync -t) and
deleted inside the watcher's debounce window used to stay indexed. "Recent" is
now mtime or ctime within twice the configured debounce (the previous 3 s is a
floor). The recheck task ends when the kb shuts down or reloads.
Security
- Terminal file deny list widened (#455). The hard deny list for terminal
file reads and diffs now also covers.envrc, any basename starting with
.env(.env.examplestays denied, failing closed), any basename ending in
.env, any path component named.env, and git objects at any depth under a
.gitcomponent. A browse root whose real path has a.sshor.git
component is refused asdenied. - Per-file diff is exactly one path (#455). Found and fixed in review
before release; the diff route is new in this release, so no earlier version
is affected. The runner lists the paths a request covers first and answers
only when that is exactly the requested path, under one shared deadline. - Terminal read routes use the same-origin GET gate (#336). The browser's
own GET requests to terminal routes were refused because they carry no
Originheader. Mutations and the WebSocket upgrade still fail closed on an
absent Origin. - Dependency advisory (#365).
url2.5.8 to 2.5.9 for RUSTSEC-2026-0592
(lock file only), withform_urlencoded1.2.2 to 1.2.3.
kb-code
- No feature change. The server change keeps
kimias a legacy name in the
worktree lock-owner list so old kimi locks still read aslikely: kimi
(display only, #317).kb-code-cliandkb-lipare unchanged. - SPA: the top bar now fits 861 to 1280 px windows so no page scrolls sideways
(#335, shared UI, so it also affects kb's own SPA). - Rolling out a new kb-code image is optional.
Dependencies and CI
libsais-rs0.2.2 to 0.2.4, because the pinned version was yanked (#324).- Release builds restore the rust cache but no longer save it, so tag runs stop
evicting CI caches. Docs-only changes take a fast path that skips the
compile-heavy lanes (#307). - Test-count floors for code-e2e and code-nextest were raised (#323, #326). A
set of recurring CI flakes was root-caused and fixed (#320, #354, #445, #457).