feat(workbench): inline handoff composer with attachments, KaTeX math, cancelled-turn text preservation, and activity-bell reveal #9698
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.52) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #9698"
general
weight: 0.35
loopx-agent
Goal And Delivered Outcome
main(37 files underapps/workbench/).1. Cramped modal handoff dialog missing native composer controls & attachments: Triggering "Continue / Handoff" or "Fork" previously opened a narrow centered modal (
440px) over a backdrop scrim with custom<select>dropdowns, no image paste/upload, no effort/speed controls, and no@references — while the main thread composer already offered a full-width liquid-glass input bar with native pickers.2. Raw LaTeX formulas in Markdown replies and previews: Inline (
$...$,\(...\)) and block ($$...$$,\[...\]) mathematical expressions rendered as literal TeX source across chat messages, file previews, and skills docs.3. Cancelled turns hid already-streamed prose: Stopping an active turn mid-response folded the assistant's already-generated prose into the collapsed work block instead of keeping it readable in the conversation timeline and persisted history summary.
4. Turning off sidebar Activity Bell lost track of the active conversation: Leaving the activity filter returned to the project view without expanding collapsed project/section/done folders or folded branch drawers, leaving the currently viewed thread hidden or scrolled out of sight.
1. Handoff/fork composer: Replaces
ForkSubchatDialog.tsxwith inline bottomHandoffComposer.tsxreusing the New ThreadComposerwidth and nativeAgentPicker,WorkspacePicker, andModelPicker(effort + speed), with direct+image attach,Cmd/Ctrl+Vimage paste, image-only handoffs,@references, isolated handoff draft keys, and upfrontmodel/effort/speed/imagesvalidation inPOST /api/threads/:id/forkbefore worktree/thread creation (unitdaemonfork-subchat.test.ts+real_entrypointfork-subchat.spec.mjs,fork.spec.mjs,auto-handover.spec.mjs).2. LaTeX math rendering: Adds
remark-math,rehype-katex,katex, andremarkLatexMath(markdown-math.ts) acrossThreadView,FilesPanel, andSkillsPage, plus.woff2CSP/MIME serving inhttp.ts. Renders inline/display formulas cleanly while preserving currency ranges ($5-$10), shell variables ($HOME/$USER), code spans, and XSS guards (unitmarkdown-math.test.ts+real_entrypointChromium KaTeX &.woff2font verification).3. Cancelled-turn prose retention: Updates
timeline.ts(closeTurn(endedAt, keepNotes)+mergeWorkEntries), webhistory.ts,ThreadView.tsx, and daemonhistory.tsso trailing prose produced before a cancellation stays visible as the turn summary while earlier intermediate notes remain in the work block (unitdaemonhistory.test.ts+ webhistory.test.ts&timeline.test.ts+real_entrypointinterrupted-work.spec.mjs).4. Activity Bell reveal & centering: Adds
locateThreadInSidebar(sidebar.ts) andSidebar.tsxlayout reveal so toggling the Activity Bell off auto-expands any collapsed project/section/done group and folded branch drawer containing the active thread and centers it inside.sidebar-scroll(unitsidebar.test.ts+real_entrypointsidebar.spec.mjs).main.Author Declaration
model_agent(Antigravity / Gemini) directed and reviewed byhuman_operator(maxliux5).Implemented against
origin/main(1bdf851e9).| Criterion | Disposition | Symbol / path | Test or command |
| --- | --- | --- | --- |
| Inline handoff/fork composer matching New Thread geometry with native pickers, images, references, and backend validation | implemented |
apps/workbench/packages/web/src/components/HandoffComposer.tsx,Composer.tsx,ThreadActions.tsx,App.tsx,fork-subchat.css,apps/workbench/packages/daemon/src/{http,threads}.ts|fork-subchat.test.ts,fork-subchat.spec.mjs,fork.spec.mjs,auto-handover.spec.mjs|| LaTeX math rendering with currency/shell guards, CSP font delivery, and XSS safety | implemented |
apps/workbench/packages/web/src/markdown-math.ts,markdown-html.{ts,css},ThreadView.tsx,FilesPanel.tsx,SkillsPage.tsx,apps/workbench/packages/daemon/src/http.ts|markdown-math.test.ts, Chromium built-bundle KaTeX check || Keep trailing prose visible on cancelled turns across live timeline and persisted summaries | implemented |
apps/workbench/packages/web/src/{timeline,history}.ts,ThreadView.tsx,apps/workbench/packages/daemon/src/history.ts| daemonhistory.test.ts, web{history,timeline}.test.ts,interrupted-work.spec.mjs|| Auto-expand collapsed group/branch and center active thread when turning off Activity Bell | implemented |
apps/workbench/packages/web/src/sidebar.ts,Sidebar.tsx| websidebar.test.ts,sidebar.spec.mjs|typecheck, full web unit test suite (688/688), targeted daemon unit suites (20/20), full Workbench productionbuild, 7 Playwright E2E specs (26passed,1pre-existing legacy-assistant skip), and headless Chromium KaTeX/font + desktop/phone light/dark visual inspection against the built bundle. Deliberately left unrelated sidebar badge/date work out of scope (tracked separately in#9635).Scope And Continuation
apps/workbench/. No core Python control-plane, RFC, or protocol files touched. Does not modify existing sidebar branch badge styling to stay conflict-free with#9635.apps/workbench/.Validation
dfdce35864d9838ef6cd78f3dbc329c1ac4d868afinishedsynthetic,public_fixture| Check kind | Result | Public-safe evidence / limitation |
| --- | --- | --- |
|
static|passed|cd apps/workbench && npm run typecheck— passed across all 6 Workbench workspaces (0errors). ||
unit|passed|cd apps/workbench && npm test -w @loopx/loochat-web—688/688passed (markdown-math.test.ts,history.test.ts,timeline.test.ts,sidebar.test.ts,i18n.test.ts, etc.). ||
unit|passed|cd apps/workbench && npx --prefix packages/daemon tsx --import ./packages/daemon/test/home-env.mjs --test packages/daemon/test/fork-subchat.test.ts packages/daemon/test/history.test.ts—20/20passed (including image/effort/non-image-model fork validation and cancelled-turn summary parity). ||
static|passed|cd apps/workbench && npm run build— production daemon, Vite web bundle (with KaTeX CSS/woff2 assets), and extension checks passed. ||
real_entrypoint|passed|cd apps/workbench && node --test packages/e2e/test/fork-subchat.spec.mjs packages/e2e/test/fork.spec.mjs packages/e2e/test/auto-handover.spec.mjs packages/e2e/test/sidebar.spec.mjsagainst the packaged build —23/23passed (1pre-existing skipped test for the unshipped legacy assistant page). ||
real_entrypoint|passed|cd apps/workbench && node --test packages/e2e/test/interrupted-work.spec.mjs packages/e2e/test/markdown-links.spec.mjs packages/e2e/test/composer-layout.spec.mjsagainst the packaged build —3/3passed. ||
real_entrypoint|passed| Headless Chromium verification against the built Workbench daemon with synthetic fixtures confirmed inline & display KaTeX rendering (3.katex,1.katex-display,0.katex-error), literal preservation of$5-$10and$HOME/$USER, and3/3KaTeX.woff2font responses with HTTP200. |apps/workbench/.Frontend / Visual Evidence
changed- Handoff/fork rendered as a
440pxcentered modal over a dark backdrop scrim with custom<select>controls and no image attachment or effort/speed UI.- LaTeX expressions in Markdown rendered as raw
$...$/$$...$$text.- Turning off the sidebar Activity Bell left collapsed groups/branches closed and did not scroll to the active thread.
- Inline bottom handoff composer matches the main composer's exact width (
652pxon1440×900desktop, asserted within≤4px), preserves the native liquid-glass surface in light and dark modes with zero backdrop scrim, exposes nativeAgentPicker+ optionalWorkspacePicker+ subtle mode indicator +×exit on top, spacious textarea in the middle, and direct+image attach,@references, nativeModelPicker(with effort/speed dial), and circular send button on the bottom.- Phone (
390×844) light and dark layouts compact cleanly into single-row pickers and icon-only mode badge with zero horizontal overflow.- Inline (
$\Delta S$,$T=30\text{–}100$) and display ($$\Delta C = \sum_{t=1}^{T} \Delta S_t$$) KaTeX math renders cleanly in both light and dark themes with bundled.woff2fonts while leaving$5-$10and$HOME/$USERuntouched.dfdce35864d9838ef6cd78f3dbc329c1ac4d868aagainst the packaged production Workbench build (npm run build) served by the real Workbench daemon in headless Chromium. Captures retained locally in git-ignoredoutput/playwright/workbench-handoff-math-timeline-bell/(desktop-card-{light,dark}.png,phone-card-{light,dark}.png,desktop-drawer-{light,dark}.png,phone-drawer-{light,dark}.png,desktop-math-{light,dark}.png).1440×900&1280×800) and phone (390×844), light and dark themes, inline handoff composer, topic drawer, and KaTeX math rendering.syntheticComposerpattern, hiding non-applicable project/machine/permission pickers so only decision-relevant handoff controls remain visible while keeping Escape/cancel and model capability errors one step away.icons.tsx),Popoverpickers, and theme danger tokens (var(--danger)for KaTeX parse errors) with zero new raw hex values, zero native form controls, and zero layout overlap on phone or desktop.Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
N/A — changes are scoped strictly to
apps/workbench/.Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).python3 scripts/check_rfc_bilingual.py --base origin/main --head HEADpasses, or no paired RFC changed.none.Signed-off-bytrailer (git commit -s).