The host's session list hides every subagent-origin row in ALL archive filters (sessionVisible() returns false before the filter), and its unarchive control only lives on those rows. Archiving a side conversation is therefore a one-way door with no entry left to recover it, so the composer-bar action is disabled for any bound session the list cannot show again, with a hover tip (all 21 dictionaries) explaining why and pointing at Save as new session. The handler keeps the same guard.
The archive-and-rebind path stays covered for a host-visible binding.
The gate read an absent settings row (the host only lists entries whose fiber is ACTIVE) as the schema default false and unregistered a live tool mid-session. Read the switch tri-state instead: only an explicit boolean is a decision, so an absent row or a thrown read keeps the current registration.
Also re-evaluate right after a settings write and after the loader settles, so enabling the feature registers the tool for the first turn instead of waiting for an unrelated settings.get.
Hidden tab types (the built-in diff page, dsh-remote's dsh-remote:file)
have no + menu row and no native guide entry, yet the side-card inventory
still gave them an enable switch. Turning one off changed nothing in the
sidebar and only made openTab silently refuse that type - which the
reporter saw as "remote:file cannot be turned off / git:diff does
nothing", and dsh-remote saw as "remote files stop opening".
- SideCardSection: the inventory skips hidden types (the count badge
follows); tabOrder becomes the order-only tabInventory.
- service.isTabEnabled: a hidden type is always enabled, so a
tabsEnabled[id] = false written by an older build cannot keep refusing
its programmatic opens.
- docs/external-plugin-guide.md and CHANGELOG describe the contract; the
two new specs fail on the previous code.
The More Actions menu's repo/worktree rows open nested submenus, but this button-anchored entry never called useSubmenuFlip — the body attribute layout.css consumes was absent, so even with #955's unclosed media query fixed the submenus still opened past the right edge of the docked sidebar.
Keep the trigger's measured corner in the menu state (a boolean cannot feed the coordinate-based hook, and a keyboard activation has no cursor point) and hand it to the same hook the file-tree row menu uses. The new test opens the real menu on a mocked right-edge trigger and pins the 'down left' tokens plus their removal on close.
The ci-windows lane failed in archive.spec.ts's afterEach with ENOTEMPTY after the test had passed. The same cleanup flaked on 2026-10-15; the existing 10x50 ms retry budget is too short on a loaded runner. Raise it to 30x100 ms; POSIX still succeeds on the first attempt.
The merged editor mode rewrites the current tab's path, which remounts the viewer and drops a draft that lives only in that instance. Ask the same unsaved-edit guard the tab close uses; re-opening the current path and native-claimed files do not switch this tab and stay prompt-free.
Review findings on #1040:
- A bad fence no longer poisons the document. `renderMermaidDiagram` used to
treat every `renderInFrame` rejection as a frame failure, so a mermaid
syntax error (a normal `mermaid-error` answer) was retried and then flipped
`frameUnavailable` — every later diagram failed until the page reloaded.
Frame answers are now classified: `MermaidDiagramError` is final for that
one diagram (its block shows the message + source), while
`MermaidFrameError` (load/handshake/timeout/protocol) gets the single retry
and then the page-level fast-fail breaker.
- Both directions of postMessage are validated. Parent side binds
`event.source` to the frame's `contentWindow` plus an opaque-origin
allowlist and validates id/svg/message; the inlined frame script binds
`event.source` to `window.parent` and validates id/code/theme/length before
rendering.
- Visibility gating now flushes on return: the 80ms inline-HTML pass remembers
a skipped pass and replays it on `visibilitychange`, and the preview handle
also pauses/resumes on document visibility (not just IntersectionObserver).
- Tests: new `tests/mermaid-frame.spec.ts` covers the error classes
(diagram error does not break later renders; transport retry; breaker after
two failures) and the message validator (wrong window/origin, malformed
payloads); the asset spec pins the frame-side sender/payload checks.
A failed render used to show only a generic "Mermaid render failed" label
plus the fence source, with the actual reason hidden in the hover title —
which makes a bad fence hard to find. Print the first two lines of
mermaid's own message under the label (the full text stays on the title)
and cover it in the fallback spec.
This was triggered by a real document whose diagram used "A 与 B" instead
of mermaid's "A & B" multi-target syntax: the error strip now names the
parse error and the source block points at the broken lines.
Mermaid measures every label with SVGElement.getBBox() against a node
appended to document.body, so each measurement flushes the whole host
document's layout. Measured in the live DSH window (15,418 DOM nodes):
59-75 ms per measurement, versus 1 ms in an empty iframe document. One
diagram therefore took 1.5-7.3 s, and a 31-diagram markdown document kept
the renderer main thread blocked for >20 s - long enough for the desktop
shell's surface watchdog to kill the renderer, with tab restoration
turning it into a crash loop. CSS containment on the app root does not
help (59-62 ms); only an independent layout tree does.
Render diagrams inside a hidden sandboxed iframe instead: a self-contained
blob: document (mermaid UMD bundle + a small postMessage protocol, both
inlined by scripts/build-mermaid-frame-asset.mjs) renders each diagram;
the parent only sends/receives and sanitizes the SVG. Diagrams now take
30-104 ms each and 31 diagrams complete in ~5 s in the background, while
the client mermaid chunk shrinks from 7.04 MB to 3.69 MB (minified UMD
replaces the unminified inline bundle).
Also add a shared render queue: visible/near-viewport diagrams first, the
rest filled in on requestIdleCallback with 16 ms main-thread yields between
renders, so every diagram is still rendered (none degrades to a code
block). Fence-line-sized placeholder skeletons reserve height while a
diagram waits. No host-half route changes are needed.
resolveAddressPath() re-spells an address path in the base's separator
style. Folding every separator run into one '\' also folded the UNC share
marker of a \\wsl.localhost\<distro>\... path, turning an absolute network
path into a drive-root-relative one. On Windows the host's requireAbsolute()
then path.resolve()d it onto the host process drive (C:\wsl.localhost\...),
so every file opened from a WSL workspace failed with ENOENT.
Keep exactly the two leading separators of a UNC path and fold only the
rest. Drive paths, POSIX bases and unknown bases are unchanged.
tests/worktree-address.spec.ts pins the UNC absolute, workspace-relative and
forward-slash spellings; the case fails on the previous source and passes
with the fix.
pathUnderOf(base, target) answers "is target under base", so the
effectiveBase guard has to be called as (canonicalTop, base). It was
called as (base, canonicalTop), which asks the opposite question and
always fell back to the repository toplevel — every workspace-relative
path opened through the sidebar then resolved one level too high
(deliverable cards reported cannot read ... ENOENT).
Also adds the regression case the suite was missing: a workspace
registered at a plain SUBDIRECTORY of the repository (base != top).
cwdOf() resolves the cwd for every file/Git route, and a cold (detached)
session paid one host observation per call: sessionQuery.observeSession({
projectionMode: 'all' }) decodes the whole zstd artifact and hydrates every
projection to answer with one workingDirectory string. The 0.28.1
single-flight only covered /sidebar/api, while the real startup fan-out
never goes through it: the fs-watch socket sends one frame PER WATCHED
DIRECTORY (server resolves cwd before it even reads the op), /sidebar/file
and /sidebar/html resolve per resource, upload/write per call. A 39 MB
session was therefore decoded dozens of times in parallel — the 44-read
OOM on 0.28.0 and the 36 reads reported against 0.28.1 are the same path,
not a broken dedupe.
A detached session now resolves through sessionPersistence.stat(), which
reads the first zstd frame only (header-only, never the log), memoized per
session id (headers are immutable) and shared in-flight across concurrent
asks. activeWorktreeRootOf() answers a detached session with that address
and no longer folds the stored log. Once the host attaches the session the
committed working_directory and linked-worktree following resume as before.
Trade-off (documented): until attach, the sidebar roots at the original
project rather than the agent's last directory/worktree.
tests/smoke.spec.ts rewrites the cwd group (header ahead of a stale hint,
one header read per session, 12 concurrent asks share one, stat absent or
failing falls back to the hint, live committed directory wins, relative
header cwd still refused) and tests/active-worktree.spec.ts pins that a
detached session performs no persistence read and no git probe.
cwdOf() resolves the session cwd for all twelve /sidebar routes. On a
detached session every call runs one host observation — the whole log read
plus decode — and the host's cold cache only helps AFTER a read completes,
so a session-switch burst decoded the same multi-MB log N times in parallel
(0.28.0: 39 MB × 44 requests ≈ 1.7 GB, OOM). Concurrent asks for the same
session + client cwd hint now share ONE resolution; there is no TTL (the
host already caches completed cold reads by persistence revision), and the
hint stays in the key so different fallbacks never leak across each other.
tests/smoke.spec.ts pins 12 concurrent calls → 1 observeSession (red before
this change: expected 12 to be 1) and the per-hint key. The dock-fallback
reserve test now clears localStorage per case — a previous case persisted
bottomOpen and made the new click toggle it closed.