Skip to content

Tool Panels

Wijanarko Putra Rajeb edited this page Nov 17, 2026 · 7 revisions

Tool panels

The Bundled Command Runner Plugin (marketplace/plugins/command-runner)

  • A repository's commands, grouped by the FILE they come from, across 26 filenames and 14 toolchains. package.json, deno.jsonc, Makefile, justfile, Taskfile.yml, pyproject.toml (poe/pdm/taskipy/hatch), Pipfile, manage.py, docker-compose.yml+3 siblings, go.mod, Cargo.toml, .cargo/config.toml, composer.json, artisan, build.gradle(.kts), pom.xml, mix.exs — each group headed by its repo-relative path. Grouping is not decoration: make build in packages/api/ is a different command from the one at the root, and a script's relative path only resolves when the cwd is the script's own directory — so the file IS the command's identity. The walk is bounded (depth 4, 200 files) and skips node_modules, .git, dist, build, out, .next, coverage, target, vendor by hand: Bun.Glob's ignore does NOT exclude node_modules (measured on 1.4.2 — the same paths come back with it, without it, and with dot: false), and dist/ is not excluded either, so a glob that walked a 200 MB node_modules is exactly the failure the hand filter prevents. Hitting a cap sets truncated, which the panel PRINTS — a silently short list reads as "this repository has three commands", a wrong answer rather than a partial one.
  • A command file that declares NOTHING is not a group — and is named instead of claimed missing. A monorepo's library packages each carry a package.json with no scripts, and every one of them used to render as a header with no rows under it; measured on Kabmo's own tree, the listing showed four groups (25 commands) plus six empty package.json headers — marketplace/plugins/{command-runner,git-forge,session-info,stats}/package.json, packages/{kabmo-sdk,kabmo-ui}/package.json — which is enough to push the files that do have commands off a 320px panel. scanScope now drops any group whose commands is empty AND that carries no error (an unreadable file is a fact, not an empty list, so it stays listed with its reason) and reports the dropped paths in CommandListing.empty. The panel uses that list for its empty state: No commands declared by package.json, packages/sdk/package.json rather than "No command file found", which would be false — the file is right there.
  • A detector OWNS its argv, and its label is argv.join(' ') — so adding a source is one ROW. The table claimed "adding a source is adding a row" while needing three coordinated edits (the table, labelFor, argvFor), which is exactly the shape where two drift and a row says npm run dev while running something else. Detector.parse(text, ctx) returns {id:'', name, label, argv} from cmd(name, argv); scan.ts asks the detector needsRunner instead of testing kind === 'package', and kindRank is derived from the table's own order. The rows are split by family under src/server/detectors/ (js / make / python / native, assembled in table.ts) and package.json stays FIRST, where it has always been. A detector may read beyond its own file through DetectorContext: go.mod's commands are the cmd/<name> DIRECTORIES beside it, Laravel is recognised by the artisan next to a composer.json, and the Gradle/Maven WRAPPER (./gradlew, ./mvnw) is preferred over the machine's PATH because a committed wrapper pins the build's version. Directory listings are memoized per scan. paths matches a repo-relative SUFFIX for a file whose basename is too common to claim (.cargo/config.toml — a bare config.toml resolves to nothing). discovery.test.ts pins the table's two invariants: no filename is claimed twice, and every detector's label equals its argv joined (fed a MINIMAL VALID sample per source, so a new source has to add one and a sample that lists nothing fails).
  • A source whose command list is only knowable at runtime lists the toolchain's OWN verbs, and says so. Cargo, go, artisan, manage.py and Gradle have no task file; their real lists need the tool RUN, and the panel executes nothing to build a listing. standardVerbs(prefix, verbs) lists a deliberately short, stable set (cargo 8, artisan 11, gradle 7, maven 7, django 8) and each row's label names exactly what runs. A project's OWN names are read where the file states them ([[bin]], [alias], mix.exs's aliases, a task <name> declaration, [tool.*] tables). [project.scripts] in pyproject.toml is deliberately NOT read: those are console-script entry points, so a row would fail until the package was installed first.
  • A run is started by COMMAND ID, never a command line. The id is <file>#<kind>:<name> and the server re-resolves it against a FRESH scan to build the argv (src/server.ts → startRun), so a client-supplied shell string cannot reach the route: the RPC surface would otherwise be a remote-command-execution endpoint reachable by anything holding the session cookie. Do not add a "run this string" method. src/server/scan.ts also owns the only scope validation the plugin can do — root must be absolute and repo must resolve INSIDE it (the check that stops repo: '../../etc'); Kabmo's own root allow-list is deliberately NOT re-implemented, because it needs Kabmo's SQLite file and a plugin's server bundle cannot import Kabmo source (@/… does not resolve in it — measured).
  • The package runner is resolved in three steps and SHOWN on the row. The file's own packageManager field, then the nearest lockfile walking up to the scope root, then Bun — src/server/package-manager.ts holds the table, and LOCKFILES is the same table as pairs so a walk can ask "is any lockfile here". The resolved runner appears in the label (bun run dev vs npm run build), so the guess is visible rather than implied.
  • detached: true + process.kill(-pid, SIG) is the kill, and the exit shape is a SIGNAL. Measured: a sh -c 'echo one; sleep 0.2; echo two; sleep 5' spawned detached and killed after 600 ms yielded "one two " with exitCode: null and signalCode: 'SIGKILL'. So a killed child has NO exit code, and the run summary carries signal beside it — reading a null code as exit 0 would report a killed run as a success. A missing binary THROWS from Bun.spawn (Executable not found in $PATH: "…"), so the try/catch is the only path that reports it; a non-zero exitCode is a different failure (the tool ran and failed).
  • Kabmo's OWN environment never reaches a run, because this plugin's server half runs INSIDE Kabmo's process. Bun.env here is the server's, not the user's shell: PORT is the port KABMO listens on (the CLI sets it when it spawns the server) and NODE_ENV=production is how Kabmo itself was started. Inheriting them made bun run dev from this panel fail with Port 3001 is already served by Kabmo pid … while the identical command in a plain terminal — where PORT is unset — ran on 3000; a project's own dev script would also have come up in production mode. The spawn therefore passes stripKabmoHostEnv(Bun.env, process.platform), and the rule lives in the plugin SDK (packages/kabmo-sdk/src/env.ts) rather than in the plugin or the host, because a plugin's bundle cannot import chamber source (@/… does not resolve in it — measured) while the host's own child spawns (omp/rpc/process.ts, omp/config/mcp-test.ts, omp/session/goal-auditor.server.ts) need the SAME list; a second copy is how the two drift. HOST is on that list and was missing, which is the second half of the reported failure. The CLI sets it beside PORT (buildServeInvocation), so a panel run inherited the chamber's own bind address — measured through a live chamber started with HOST=127.0.0.1: a run reported HOST=127.0.0.1 while a plain terminal had it unset. bun run dev:lan masks it (its own HOST=0.0.0.0 prefix is a plain shell assignment and wins), but any script that reads HOST as a default bound to the chamber's address, and no project owns that variable. The terminal PTY is the third surface and it leaked identically (terminalEnv, lib/terminal/shell.ts): measured, a PTY under a chamber on 3001 reported PORT=3001 NODE_ENV=production, so bun run dev typed into the terminal panel hit the same "Port 3001 is already served" refusal — and NODE_ENV=production also makes bun install/npm install skip devDependencies. It now strips through the same rule before setting TERM/COLORTERM/COLORFGBG, and its shell.test.ts pins that PORT/NODE_ENV/NEXT_* are gone while PATH survives. NEXT_ is a PREFIX, not a name: it is Next.js's whole namespace of build-time-inlined values. The strip is a COPY (the chamber's own env must survive a spawn) and Bun.spawn's explicit env REPLACES the child's environment rather than merging into it — measured. Pinned by a real-spawn test in runner.test.ts (PORT=[] NODE_ENV=[] PATH_SET=[yes], which fails with the old { ...Bun.env } restored), and verified end to end through a live chamber: a run started over the plugin's own RPC under a server holding PORT=4599 NODE_ENV=production reported PORT=[] NODE_ENV=[] PATH_SET=[yes]. A fix to a bundled plugin only reaches an EXISTING install through a version bump — syncBundledPlugins is gated on the store's kabmo.version being strictly newer — so this shipped as 1.0.1; the 1.0.0 install would otherwise have kept the bug for good (verified against a copy of a real install: 1.0.0 → 1.0.1, rebuilt, rule present). And the bump alone was not enough, because the sync used to run AFTER the server halves loaded. loadPluginServer import()s the plugin's built bundle, so the copy on disk at that moment is the code the process runs until it restarts — measured on a real install whose boot log reads 2 server half(s) loaded (command-runner, stats) immediately followed by synced command-runner 1.0.0 → 1.0.1: that process ran the PRE-fix half for its whole life, and only the boot that followed a manual restart applied the fix (the log's own restarting on port 3001 line). src/server/index.ts now syncs BEFORE loadPluginServers, so the boot that installs a fix is the boot that runs it — verified on a stale 1.0.2 install against a 1.0.3 store: one boot logged synced 1.0.2 → 1.0.3 then 1 server half(s) loaded, and a run from that half reported PORT=[] HOST=[] NODE_ENV=[] PATH_SET=[yes], with bun run dev:lan listening on 3000 rather than the chamber's port.
  • A run starts with the PATH a terminal would have, because a GUI/launchd launch has almost none. Kabmo started by launchd (the desktop app, a LaunchAgent, --launch-mode=daemon) inherits /usr/bin:/bin:/usr/sbin:/sbin, so Bun.spawn answered Executable not found in $PATH: "bun" for every row in this panel — measured in ~/.kabmo/logs/kabmo-3001.log (five identical failures) and reproduced with env -i PATH=/usr/bin:/bin bun -e "Bun.spawn({cmd:['bun']})". The same command in the user's terminal ran fine, because the terminal panel launches a LOGIN shell (-i -l) that re-reads the profile while a plugin's Bun.spawn has no profile to read. So stripKabmoHostEnv is now followed by withToolchainPath (packages/kabmo-sdk/src/env.ts), which APPENDS $HOME/.bun/bin, $HOME/.local/bin, $HOME/.cargo/bin, /opt/homebrew/bin, /opt/homebrew/sbin, /usr/local/bin and the POSIX defaults to the inherited PATH — appended, never prepended, so a version manager's shim or a project's .bin keeps winning. The runner also resolves argv[0] to an absolute path through that same PATH before spawning, so the child does not depend on how Bun.spawn searches. Verified end to end under env -i PATH=/usr/bin:/bin:/usr/sbin:/sbin: list found package.json#package:hello, start answered a run id, and the run exited 0 with "$ echo hello-from-script\nhello-from-script\n"; the child's own $PATH starts /usr/bin:/bin and then names the repaired directories.
  • The list is TWO collapsible levels, and both use the same reveal. A group header per command FILE (collapsing its rows, carrying the count) and a row per command (collapsing its own output). Both are .section-reveal with a full-width <button aria-expanded aria-controls> and the body mounted + inert while closed — and the inert is the half that matters: without it Tab walks into rows inside a closed group and a screen reader announces them. The group flags are per FILE (commandRunner.collapsedGroups, keyed by repo-relative path) and absent means expanded, the same shape the todo panel uses for its phases — a workspace seen for the first time must show its commands rather than looking like a repository with none. A group's body CONTAINS its rows' bodies, so a flat .section-reveal query mixes the two levels: address each by its own aria-controls (which Groups.test.tsx does, and which is why its first version failed). Pinned by Groups.test.tsx — the group inert case fails when the attribute is dropped (verified).
  • The disclosure is DISABLED until the command has run, and the output toggle is GONE. A command with no run has nothing to expand, so its toggle is disabled with aria-label/title reading has not run yet and a dimmed ▸ (text-ink/20) — an expandable row that opens onto a placeholder teaches the reader the control is unreliable, and the state has to be readable rather than only hoverable (a disabled control's title is not what getByRole(name:) resolves, which is how the e2e spec caught it). Once a run exists the row opens ITSELF (an effect keyed on hasOutput), so a Run never looks like it did nothing. The output toggle was REMOVED: expanding the row already shows the output, so a flag that only decided the row's default was one decision with two controls — and a row that opened itself because a flag was on fought the reader who had just closed it. What remains is background, which is a real choice about how a run is TRACKED. A run EXISTS from the moment it starts (the topic carries it with status: 'running' and zero bytes), so the gate is run !== null and a live run's output streams into its own row — verified: FIRST-LINE present at t+1.8s mid-run, SECOND-LINE appended by t+5.8s.
  • The panel's type is a three-step hierarchy, and the log sits at the BOTTOM. Group text-xs font-semibold text-ink (12px/600), command text-[11px] font-normal text-ink/80 (11px/400), log text-[10px] leading-[1.35] (10px/400), meta strip text-[9px]. The log was text-xs — the code-block default, a full step LARGER than the label it belongs to — which put the reader's eye on a command's output instead of on the command; measured before/after at 12px → 10px against an 11px label. The same inversion existed one level up (the group was text-[11px] font-mono text-ink/70 under a text-xs text-ink command) and both are fixed, so group ≥ command > log holds.
  • A command's output is a CODE BLOCK that wraps. The Kabmo's own treatment — rounded-lg border border-ink/15 bg-canvas font-mono text-xs leading-4 on the <pre>, which is what .prose-content .code-block declares in tailwind.css; a plugin's DOM is not inside .prose-content, so the tokens are written inline rather than the host's stylesheet being imported. whitespace-pre-wrap break-all rather than a horizontal scroll: a build log's long line is usually the interesting one, and a 334px panel with a sideways scrollbar hides it.
  • A command is a ROW that expands into its own output. The shape is the git panel's StashSection: .section-reveal (grid-template-rows: 0fr → 1fr), a full-width <button> carrying aria-expanded/aria-controls, and the body left MOUNTED and inert while collapsed so the reveal animates without leaving a hidden control tabbable. Each row carries the disclosure, a background toggle ([⏱]) and Run/Stop ([▶]/[■]) — the last two icon-only, drawn as inline SVG because the kit has no icon dependency and a lucide-preact import would bundle a whole set for three shapes. Background was one of two panel-wide CHECKBOXES setting the defaults for every run; it is now a per-command <button aria-pressed> toggle, because dev wants a job and lint does not, and one pair of checkboxes cannot say both. The Output toggle is GONE: expanding the row already shows the output, so a flag that only decided the row's default was one decision with two controls — and a row that opened itself because a flag was on fought the reader who had just closed it. Three behaviours are load-bearing and each was a defect first: a Run OPENS the row (the first cut ran the command and left the expansion shut, so a successful run looked like nothing happened — verified in a browser); Run is never disabled (it was gated on the old enablement flag, which made a command you do not want to WATCH unrunnable); and the run's commandId is what a row matches on — never file+label, which collide for two commands of the same name in one file. Turning the background toggle OFF stops that command's runs (stop-all, session-scoped), because a toggle that says "not a job" while the job runs is a lie. Row.test.tsx pins all of it, and the open-on-run case fails with the fix reverted (verified).
  • The topic publishes on STATE immediately and on OUTPUT throttled. bytes has to move for an open log to re-read, so a growing buffer publishes at most once per 250 ms per run — the payload carries a byte COUNT and never the bytes. Two numbers travel, and they answer different questions: bytes is everything the process produced, ringBytes is what the 256 KB ring still holds, so the view can say "the last 64 KB of 3.1 MB" instead of presenting a window as the whole log (src/server/ring.ts is the pure half — the ring, ringText, stripAnsi).
  • The force-stop on a repo switch is three mechanisms, because each alone has a hole. (1) A contentScript watches the shared scope for as long as the plugin is enabled — a plugin PANEL is unmounted while another view is on screen (WorkspacePanels returns null for an inactive plugin), so a switch made from the Files panel would otherwise leave processes running with nothing to notice; the script renders nothing and uses the kit's SERVICES rather than hooks, because a content script is not a Preact component. (2) The panel sweeps on mount, which covers a reloaded Kabmo and a phone (which mounts no content script until the mobile layout mounts PluginBootstrap). (3) Every run records its scopeKey, so a sweep reaches runs started before a watcher existed. stop-others is defined by the scope it is HANDED — it kills this session's runs in any OTHER scope — so calling it twice is a no-op, which is why the watcher fires on every notification instead of tracking the previous scope. Session-scoped on purpose: two sessions legitimately hold two repos.
  • The SESSION travels with a run, and that is load-bearing. stop-others matches on sessionId, so a run recorded against null is never matched by a watcher sweeping a real session — measured as a background job that survived a repo switch while stop-others answered stopped: 0. The panel sends usePanelInfo().sessionId, and the mount sweep sends the same.
  • A callback that depends on an useRpc result loops. useRpc returns a fresh state object per render, so list.call is a new function every render; putting it in the scan callback's dependency list re-runs the scan on each render and the scan's own setState renders again. Measured: hundreds of list requests in seconds, which also starved the render so the command rows never appeared. The plugin holds the call in a ref and keys the effect on the SCOPE pair, which is the real trigger.
  • The registry is per load, and onDispose kills everything. A run is a detached child and a detached child outlives its parent by definition, so disposal is what keeps a Kabmo restart from orphaning a dev server — and Kabmo's shutdown path calls it (disposeAllPluginsOnShutdown, bounded so a hanging plugin cannot hold the port). stop also PUBLISHES immediately rather than leaving the state to follow: the reader clicked Stop and must see the row leave Running at that moment.
  • Its tests are *.test.ts under the plugin (bun test marketplace/plugins/command-runner/), and the runner's are driven against REAL processes: a fake Bun.spawn would prove nothing about group kills or exit codes. tests/e2e/specs/commands.e2e.ts is the assembled proof — install through the real route, list a fixture repo, run a command whose effect on DISK is the assertion, read its output, and switch repo to see a background job's process disappear.

Ask Tool — one HTML form walked field by field (omp 18.18.3), plus the grouped extension dialog

  • omp's ask tool takes ONE HTML <form> since 18.18.3 ({ html }), not questions[], and the RPC host has no formDialog. RpcExtensionUIContext omits it, so AskTool takes its field-by-field branch: one blocking select/input/editor per NAMED control, titled with the question omp derived. That derivation is fieldQuestions in pi-tui (html-form/data.ts): the control's own <label>, else the text block right before it, else its <fieldset><legend>, else a lone option's label, else the control name — and radio/checkbox groups of two or more gain an Other (type your own) row. shared/lib/chat/ask-form/ mirrors it because the browser cannot import pi-tui; it is what keeps every question on the card instead of falling back to raw text. A top-level <fieldset> starts its own section, so a paragraph above it does NOT caption the fields inside — the legend does. Measured against omp's own parseHtmlForm/fieldQuestions on the tool's example form (<p> context, then <fieldset><legend>Session store</legend>): borrowing the paragraph gave Sessions live in memory… where omp titles the dialog Session store, the title walk found no owner, and the first select fell through to the MODAL (which has no ask body) instead of the card. The parser now resets the caption at a top-level fieldset and was cross-checked field by field with omp's derivation on seven shapes.
  • The question TEXT is the claim key, so the mirror must match fieldQuestions exactly — measured drift is what put an ask in the modal. splitAskFrames claims a per-field select/input/editor by its title, and only method:"ask" frames are excluded from the modal outright. Scanning 1,725 real session files (7 ask calls) found 2 whose derived question text differed from omp's, and both rendered as a modal: a <label> wrapping a <select> leaked every <option> label into the question (textOf skipped the tag but not its content); an unclosed <span class="truncate"> written literally inside a code span made matchingClose answer end-of-document, so the rest of the form was walked twice and every field duplicated. Also fixed against omp: inline text before a control (<span>, <br>) now captions it (flush() runs before the field is built, not after), a <table> holding controls is walked as layout instead of dropped, and a lone checkbox with no value asks its NAME rather than the submitted on. ask-form.test.ts pins each shape. The routing also gained a second key: a select whose title matches nothing is claimed by its OPTION ROWS (exact set match, ≥2 labels, gate excluded), so a future parser drift degrades to the card instead of the modal.
  • The result is details.answers[] — { name, question, answer } — plus timedOut, and the same data is echoed as User answers:\n{json} in the tool text. answer is rendered as omp's formAnswers does: an option's LABEL, Other: <typed>, and ", "-joined labels for a checkbox group. Kabmo aligns by control name and reads the JSON out of the text when the live tool_execution_end frame drops details.
  • A select response must be a label omp OFFERED, or the whole ask is cancelled. askChoice resolves a picked row with labels.indexOf(outcome.value); a typed answer matches no index and answers undefined, which cancelAsk turns into a cancelled tool call. Kabmo used to hide the "Other (type your own)" row and send the typed text in its place — measured as broken on 18.18.3. The card now sends the row itself; omp opens a follow-up input titled with the SAME question, which lands in that question's group (askQuestionForTitle also tolerates the question (Enter a number) suffix of a rejected text answer).
  • The grouped dialog (method:"ask") is extension-only now. set_ask_dialog {enabled:true} (sent by configureChild) is unchanged and still answered by one {answers:[{id, selectedOptions, customInput}]} reply, but omp 18.18.3 no longer routes its OWN tool through it — extensions and the ratchet still do, and an older child still takes that path for the tool. GroupedAsk renders it with one Submit answers. Verified on 18.8.3: two questions including a multi:true one arrived in one frame.
  • A grouped frame carries NO title, so the title walk cannot place it. splitAskFrames claims it by the question IDS omp puts in both the frame and the tool call's arguments — the same key parseAskQuestions reads — and places the SAME frame on every question it names, because one dialog answers all of them. A grouped frame naming no open question is an inline orphan, never modal material.
  • A multi-question form is answered ONCE, even though the wire is per field. FormAsk draws every question with its own control and one Submit answers; the submit then walks omp's select/input/editor frames as they arrive, one answer per frame, so the agent still receives the per-field responses it expects. A multi-select is reconciled against the frame's own checkedIndices (a form may mark a row checked, and sending that label would toggle it OFF) and ends with the Done selecting row. A rejected typed answer gets three attempts before the card unlocks and says so.
  • A default-checked multi option is drawn as selected, not empty. parseAskForm now carries <input checked> into AskOption.checked; FormAsk seeds its picks from it and useAskDrafts seeds the old per-question display from the frame's checkedIndices. Without either, the first click SENT the label and omp toggled the default OFF while the card showed it selected.
  • No ask dialog is modal material, in any state. A per-field frame that names a question of a known ask but no OPEN card owns it (its call failed, was answered, or is outside the loaded window) is drawn as an inline LooseFieldAsk/orphan row. A frame that matches neither title nor rows is still owned by the only open ask when its title shares a content word with one of that ask's questions — the ask tool is exclusive, so nothing else can be asking — and FormAsk consumes it as the live field. A picker with no shared word keeps the modal. The modal has no ask body and can only produce an unanswerable panel.
  • Both halves must ship together. Enabling set_ask_dialog makes omp send a frame the client cannot otherwise answer, which would block the agent with nothing on screen to answer it; the opt-in, the questions field on ExtensionUiDialogRequest, the answers response variant, the split's id matching and GroupedAsk are one change.
  • omp's description for a choice is VISIBLE text on its row, and both shapes draw the row through one component (OptionRow). omp's own ask prompt puts the tradeoff there ("short labels, tradeoffs in description"), so it is half of what the user is deciding between. The grouped card rendered it as title={option.description} — a hover tooltip — while the per-question select loop (FrameControl) printed it, so the two shapes of ONE tool asked the user to pick blind vs. informed, and a phone could never hover at all. The row is now shared (OptionRow.tsx: mark, label, description, suggested badge, the multi-select "Done" emphasis), which is what makes the drift impossible rather than merely fixed; index.test.ts pins the description as visible text and the absence of the title attribute, and ask.e2e.ts asserts it on the real card.

Tool-Approval Gate (the modal omp blocks on)

  • Over RPC the approval gate is a select frame, NOT a confirm. omp's RPC UI context (RpcExtensionUIContext) has no approve member, so requestApproval falls back to its select branch (approval.ts: if (ui.approve) … else ui.select(full, approvalChoiceLabels(choices))). The gate therefore arrives as a select whose TITLE is omp's whole prompt, newline-separated, and whose OPTIONS are the choices — measured against 18.13.1: title "Allow tool: read\nReason: Restricted folder: /tmp/secret\nPath: …", options ["Approve", "Deny"]. shared/lib/chat/omp/approval-gate.ts owns that one reading (isApprovalGateFrame / parseApprovalPrompt), because the title prefix is the ONLY thing that separates a gate from an ask question's own select.
  • A gate is never claimed by an ask card. Both are select frames, and splitAskFrames claims a select by its title — but a gate's title names no question, so it fell through to the "last ask spoke" walk and landed on an unrelated QUESTION's card, where "Approve"/"Deny" rendered as that question's answer options and the answer was posted to the wrong tool call (reproduced: the card claimed ["f1", "g1"]). A gate is excluded from that fallback exactly like a confirm, and reaches the modal instead — ask-frames.test.ts pins it.
  • The thing being approved must be ON SCREEN. A title is a ONE-LINE field and the dialog's header rendered it with truncate, so the reason and the path were clipped out of the only element that could show them: the gate read "Allow tool: read" over a path the user never saw. parseApprovalPrompt splits the prompt into its tool, omp's reason line and the tool's own detail rows; ApprovalBody.tsx draws the reason and the details in full, and the header names the TOOL ("Allow read") instead of repeating the prompt. "Approve" without the thing being approved is not a decision.
  • A gate has NO free-text field. The dialog's "Other — type your own answer" is an ask question's escape hatch; on a gate omp's answer parser (approvalAnswerForChoice) reads any string that is not one of its labels as a DENY — measured: "Approve" → allow, "yes please" → deny. So the field was a way to REFUSE the call by typing near-miss text and never a way to approve it. A gate draws no field, and the submit path sends the chosen label rather than a typed answer.
  • tools.restrictedFolders (omp 18.13.1) is the gate's new trigger. Every read, write, edit, search or command on a listed folder asks in EVERY approval mode — yolo included — and no remembered grant, session approval or ACP "Always allow" covers it (measured against omp's own resolver: prompt with source restriction and override: true in all three modes, and no session-grant option). The composer's yolo copy says so ("Everything runs without asking — except a restricted folder, which always asks"), because a mode picker promising an unconditional bypass would be lying about the mode it names.

Todo Panel (right-panel Todo view)

  • The list is oh-my-pi's, and its only durable home is the session transcript. There is no todo file and no chamber-side copy — a second copy would drift from the one the agent rehydrates, and a plan panel that disagrees with the agent is worse than no panel. todo calls commit a full snapshot to the entry they append (message.details.phases on the toolResult, or data.phases on a user_todo_edit custom entry), and every branch rehydration — resume, rewind, fork, /btw — reads the DEEPEST such snapshot off the ACTIVE BRANCH back out of it (omp's getLatestTodoPhasesFromEntries → syncTodoPhasesFromBranch). src/shared/lib/chat/todo/snapshot.ts performs that same read: branch walk by parentId from the last entry, newest-first, skipping op:"view" results (they echo the list without committing it) and errored ones.
  • Read path is readSessionTodos behind a realtime topic, and no omp process. The todos topic resolver (src/server/lib/realtime/topics/session-data.server.ts) calls readSessionTodos (src/server/lib/omp/session/todos.ts) → findSessionFileById → full JSONL parse, cached by (size, mtime) on globalThis. Measured on real sessions (7.2 MB / 1905 entries): ~15 ms parse, 0.02 s cached round trip. A full parse is deliberate — the todos may sit megabytes from EOF (measured: 2.7 MB from the end of a live session, and None in another), so a bounded tail window would report "no todos" for exactly the sessions that have the most. The panel never spawns an omp child: that would fight the chat's own session wrapper for the same session file.
  • The read rides the session's own todos realtime topic, so there is no poll. session-data.server.ts's todosDescriptor resolves readSessionTodos on demand and the server republishes the topic on the session-data-dirty signal, which the chat emits at every turn boundary — i.e. right after each todo call. TodoPanel subscribes through useRealtimeTopic(sessionTodosTopic(sessionId)); the panel's own Refresh calls the topic's refresh. The session-todos.ts client hook and its omp:session-updated / TODO_REFRESH_EVENT_THROTTLE_MS hand-rolled event path are gone with it.
  • Follows a live agent from outside Kabmo (verified): with another omp -p process driving a session, the panel went 0/3 done · 1 in progress → 1/3 done · 2 blocked and rendered the blocker notes, purely off the topic republish. Within Kabmo the same path makes it immediate.
  • Five statuses, not three. omp's vocabulary is pending | in_progress | completed | abandoned | blocked; the chat timeline's older tool card only ever drew three, so a blocked task rendered as an ordinary pending one. progress.ts owns the status → presentation table (icon, tone, active/closed) and todoProgress counts closed = completed + abandoned — the pair omp's own HUD hides as settled, because leaving an abandoned task in the denominator makes a list read as permanently stuck. A blocked task's blocker note is rendered under its content; it is the only place omp records WHY it waits.
  • The chat's todo tool card is a different thing and stays separate. src/shared/lib/chat/todo/parser.ts (moved from chat/todo-parser.ts) parses what ONE call did from its text output for the timeline card. Merging them would attribute every other call's work to whichever card was on screen; the two files are documented as the distinction.
  • Empty states are distinguished because they mean different things: no sessionId ("No session selected"), a transcript with no snapshot at all (the agent never planned here), and a list whose every task is closed (renders normally, 100% bar). Collapse state per phase is persisted under todo.collapsedPhases (verified surviving a reload).
  • enabled is deliberately NOT the workspace gate the other panels take. That flag means "the active session's cwd resolves to a registered workspace folder", which files/search/git/terminal genuinely need. A todo list lives in the session's own transcript, so a session running outside every registered workspace still has one — gating on it showed "No session selected" over a full list (measured, both desktop and mobile). The desktop view therefore takes only active; the phone's drawer keeps its whole-drawer gate for the workspace views but exempts the todo tab. TodoPanel itself answers "No session selected" when there is no sessionId.
  • Mock mode returns a deterministic six-task list covering every status (including a blocked with a blocker note and an abandoned) so all render shapes are exercised under MOCK=true. The demo lives in src/server/lib/omp/session/data-mock.ts, called by the todos topic resolver — NOT in an HTTP route, because the panel reads the topic and a demo reachable only over HTTP would leave the view empty under MOCK.

Wiki Panel (right-panel Wiki view)

  • The view sits beside Source Control in the activity bar, on both layouts, because a wiki is read off the same remote through the same repo pick — one pair in the bar rather than one at each end. The position is not restated in the two components: they render the merged panel catalog, whose built-in half is ordered by RIGHT_PANEL_TYPES (the desktop bar, the desktop panel stack and the phone's tab bar all read it), so moving one row moves every surface.
  • A wiki is read over git, not over an API, and that is why one panel covers GitHub, GitLab and a self-hosted GitLab. Both hosts publish a project's wiki as a SEPARATE repository at <origin>.wiki.git, so src/server/lib/wiki/remote.ts appends the suffix to the checkout's own remote and the fetch authenticates exactly the way the checkout does — no token scope, no API version, no per-host branch. Verified end to end on github.com/jgraph/drawio (19 paths, [[Embed Diagrams]] gollum links, images) and on git-rbi.jatismobile.com/jns6_5/drrealhandler (7 paths, 0.7 s cold, _sidebar.md and .gitlab/redirects.yml correctly kept out of the nav). The provider name the header shows is a LABEL: it picks the "open on the host" URL (/wiki/Page vs /-/wikis/Page) and is decided by name for github.com/gitlab.com, otherwise by probing /api/v4/version only after a wiki fetch has already succeeded (so the common failure path never pays for it).
  • The mirror is one bare, shallow clone per wiki, cached on disk under <data>/wiki/<host>__<slug>, TTL'd 60 s in memory (mirror.server.ts). HEAD:refs/wiki/latest is fetched directly, so there is no working tree to keep in sync; --depth 1 keeps a changelog wiki's history out of the cache. Two details are load-bearing: --no-write-fetch-head plus a refspec (rather than a named remote) keeps the credential-carrying URL out of .git/config and FETCH_HEAD — verified, neither file mentions the remote the fetch used — and the cache key is host+slug rather than the URL, so an https and an ssh spelling of one remote share a mirror. The cache itself hangs off globalThis (__kabmoWikiCache) for the same reason the database handle does: bun --hot re-evaluates the module while the mirrors on disk stay.
  • Every git call is an argv spawn, never a shell string (src/server/lib/wiki/git.ts). A wiki path is author-chosen and does hold spaces (Setting-up-a-OneDrive-project-to-use-with-diagrams.net.md), and a checkout path is user-chosen; there is no shell to escape them against. GIT_TERMINAL_PROMPT=0 rides on every call, because without it a private wiki blocks on a credential prompt with no terminal to answer it and the read hangs to its timeout instead of reporting that the wiki is not readable.
  • A missing wiki is an ANSWER, not an error. Git says "Repository not found" / "Authentication failed" / "could not read Username" for a wiki that does not exist and one Kabmo cannot read, and both mean the same thing to a reader — so they map to reason: 'no-wiki' and the panel words it, rather than reporting a failure. The other three reasons are distinct and separately worded: no-remote (the checkout has no origin), unsupported-remote (a local path, a bare host — anything the suffix cannot hang off), unreachable (timeout, network, git missing). All four verified against the API.
  • A page is read at the ref, never off a path — git show <ref>:<path> can only name a blob in the wiki's own tree, so a crafted ../../../../etc/passwd returns "Page not found" (verified) rather than reaching the filesystem. Pages travel as markdown SOURCE (/api/wiki/page); the panel renders them through the app's own pipeline, which is what gives a wiki page the same sanitizing, Shiki highlighting, KaTeX and mermaid hydration the chat timeline has — verified live on a real wiki whose Home carries a ```mermaid diagram and four fenced blocks.
  • A wiki's images are in the wiki's repository, so the panel serves them itself (/api/wiki/asset, bytes read with Bun.spawn — the text runner would turn a PNG into replacement characters). The response carries nosniff and a sandbox CSP, which is what keeps an SVG in that author-controlled tree from running script if a reader opens the asset URL directly; verified: a 455×349 PNG and its SVG twin both render inline on the page. getImageMimeType deliberately excludes SVG (the editor's viewers treat it as text), so the route names image/svg+xml itself.
  • The nav is the wiki's OWN _Sidebar.md, not a tree derived from the file layout (src/shared/lib/wiki/sidebar.ts). Both hosts serve that file as the navigation around every page, so it carries the author's grouping, order and labels: the GitLab wikis here group ### 📚 Navigation / ### 📋 Changelogs / ### 📊 Info with labels like 🏠 Home and a **Version**: 1.6.0 note block, all of which a folder-derived list turns into NAVIGATION/CHANGE_LOGS in a different order. The parser is deliberately tolerant — a rule instead of a heading, a nested bullet, a link with a "title", and a prose block are all in real files. A page the sidebar omits is appended under Other pages rather than hidden (withRemainingPages): the sidebar is the author's navigation, not an index, and the panel has no address bar — measured on jns6_5/personalschedulertrigger, whose sidebar lists 12 of its 26 pages, the panel renders all 26. A wiki with no sidebar at all (github.com/jgraph/drawio) falls back to sectionsFromEntries, which groups by folder so the panel is never un-navigable. Verified in the browser: the sidebar's own groups and labels render, clicking 🧪 Testing Guide opens that page in-panel with aria-current on the item, and no tab opens.
  • Three provider conventions are encoded in src/shared/lib/wiki/pages.ts, because each is invisible in the raw markdown and each was wrong in the first cut. (1) Chrome fragments — _Sidebar/_Footer/_Header, any case — are not pages; listing them puts a nav fragment in the middle of the nav. _Sidebar is the one read back as navigation (above); _Footer/_Header are simply dropped. (2) References are case- and space-insensitive: [[Embed Diagrams]] targets Embed-Diagrams.md (gollum's space→dash rule), GitLab's [v1.6.0](change_logs/v1.6.0) omits the extension, and GitHub's own wiki resolves /wiki/eMbEd-Diagrams — so resolution tries the written path, the extension form, the dash form of both, and matches case-insensitively. (3) Assets are entries too, or a page's ![](images/schema.png) has nothing to match.
  • A bare path is resolved from the wiki ROOT first, then from the page's own folder — and only .//../ means "beside this page". That order is not a coin flip: it is what both hosts do, and it is the difference between a working link and an inert one on a nested wiki. A real GitLab wiki writes [TRD v1.3.3](trd/v1.3.3/home) from trd/v1.3.2/home.md — rooted at the wiki, while page-relative resolution looked for trd/v1.3.2/trd/v1.3.3/home and found nothing. Measured on jns6_5/personalschedulertrigger: 25 of its 41 links failed to resolve, and every one of them then opened a browser tab (the click handler classified them from link.href, which the DOM always absolutises, so a relative path read as external). After the fix the same census is 41/41, and jns6_5/drrealhandler is 34/34.
  • Gollum's [[Page]] is expanded BEFORE the markdown parse, and its destination is percent-encoded. [[x]] is invisible to a markdown parser (it renders as literal brackets), so expandGollumLinks rewrites it — leaving fenced blocks and inline code alone, or a page documenting the syntax gets its example rewritten. The encoding is the second half of the same bug: a bare [Embed Diagrams](Embed Diagrams) is not a link at all (a markdown destination cannot contain a space), so marked emitted the brackets as text and the whole Home page of a real wiki rendered unlinked; measured in the browser before and after (links: [Deploying, Translations] → [Deploying, Translations, Embed Diagrams, Getting Support]).
  • The panel renders the chat's MarkdownRenderer, in a third mode (wikiScope). document mode was already the "the source IS the document" contract; wiki mode adds gollum expansion and resolves references against the wiki's tree — a LINK to a page becomes in-panel navigation (data-wiki-path → onWikiNavigate), an IMAGE goes to /api/wiki/asset, and a link to any OTHER file in the wiki keeps that asset URL with no marker (copyable, middle-clickable, inert on a plain click — the panel is a reader, not a file browser). A reference that resolves to nothing is left exactly as written.
  • The click handler classifies a wiki link from the RAW attribute, never link.href. href is always absolutised by the DOM (/trd/v1.3.3/home reads as http://127.0.0.1:7799/trd/…), so a relative path that named no page was indistinguishable from an external URL and opened a tab. Only an http(s): raw href leaves the console; a bare #anchor is left to the browser, because the heading it names carries the id the wiki's own table of contents wrote (see below); anything else is inert.
  • Headings are given the id the page's own anchors name (wikiHeadingSlug, applied by rewriteHeadingIds). Both hosts slug a heading by lowercasing it and dropping everything that is not a letter, digit, combining mark, space, hyphen or underscore, then turning spaces into hyphens — so ## 🎯 Overview is #overview while ## ⚠️ Migration Queries is #%EF%B8%8F-migration-queries, the symbol dropped and the U+FE0F mark after it kept. The renderer's own id keeps the emoji, so every TOC entry pointed at an element that did not exist and clicking one did nothing. Verified over all three cached wikis: 9/9 anchors resolve (7 of them emoji-headed), and a live click scrolled the page from 858px to 0 with no new tab.
  • wiki.selectedPage is stored WITH its scope ({ scope, path }, scope = root�repo), the same rule workspace.activeRepo follows: a page path from another repository names a page this wiki does not have, so restoring it would open a 404. The stored path is used only while it still exists in the current wiki, else Home, else the first page — a wiki whose Home was renamed still opens on something readable.
  • The nav sits on the RIGHT and the page keeps the panel's leading edge (@[520px]:flex-row-reverse), so the wiki reads as a menu beside the document rather than a sidebar before it. The reverse is visual only — DOM order stays list → page, and the divider moves to the list's leading edge (border-l).
  • Layout is two columns above 520px of PANEL width; below it the DESKTOP column keeps its drill-down and the PHONE gets a floating button plus a modal (@container for the column break, but the phone/desktop split comes from the layout field on PanelBodyProps — the two shells can be the same width, so neither a container nor a media query can tell them apart). Measured in the browser after the move: at 575px the nav is 208px at left 1348 beside a 367px page at left 981; the default right panel resolves to 420px, so the desktop's narrow state is the list replacing the page, and selecting one gives the page a back arrow (@[520px]:hidden, so the two-column layout never shows it). On the phone the page is the ONLY screen — instead of the drill-down, an outlined circular trigger floats over its bottom-right corner and opens the same WikiNav in the shared Modal shell; the backdrop or Escape closes it, choosing a page closes it, and a wiki with no links has no trigger. Measured at a 500×757 phone viewport: the trigger sits 36×36 at left 452, top 709, the modal 384×282 centered at left 58, top 238, and choosing Getting-Started closed it and moved the header to Getting-Started.md. The page list is grouped Home → root pages → one group per folder, and filtered by a search box.
  • MOCK=true answers a deterministic demo wiki — a page with a table, a mermaid fence, a TS fence and an internal link, plus a tree that exercises the folder grouping and the chrome/metadata filters — so every render shape works without an omp install.

Clone this wiki locally