Repository navigation
Conversation
This was referenced Aug 18, 2026
Fixes get-bb#1647. Independent repro/root-cause report: https://get-bb.github.io/reports/issues/1647.html (review verdict: fixes root cause; leader-first SIGTERM ordering and ownership call-out added on review).
… (get-bb#1793) ## Summary Fixes get-bb#1773. Opening a Markdown file with the Docs plugin showed `Couldn't sync tabs - unrecognized code: [fileOpenerOwner]`. The file opened and edits saved, but thread-tab persistence was broken for the whole thread. Plugin file-opener tabs attach a `fileOpenerOwner` note recording the native preview they diverted, so the tab can restore `Original`. That field lived in the app's localStorage schema but was never added to the strict `plugin-panel` branch of `threadTabSchema`, so every sync carrying such a tab was rejected outright — the rejection kills the entire save, not just the offending tab, which is why everything else looked fine. Rather than add the field to the contract and leave two schemas to keep in sync, this deletes the app's parallel definition and points it at the contract's. That duplication *was* the bug, so collapsing it is the part that prevents a recurrence. ## The sibling gap The `terminal` branch had the identical defect: nav-panel right panels record the target a terminal was opened against, but the contract's terminal branch didn't model `target`. That one isn't reachable today — the plugin right-panel host that sets `target` passes `syncThreadId: null`, so those tabs stay in localStorage. But it's close: in `useThreadTerminalController`, `fixedPanelSyncThreadId` becomes non-null whenever `target.kind === "thread"`, and `hasThreadId(panelStateId)` only tests for a non-empty string, which a plugin-page panel id satisfies. It's one wiring change from firing, so it's fixed here. The target is already modelled in the contract as `terminalCreateTargetSchema` — and it's literally the same value the app hands to `createTerminal` — so the tab branch reuses it instead of adding a third copy. ## Why nothing caught either one TypeScript checks the two schemas independently and neither was wrong on its own. Excess-property checks only apply to object literals, so assigning a typed `TerminalFixedPanelTab` to a `ThreadTab` compiles cleanly while failing at runtime against a strict Zod parse. Nothing compared producer to contract — which is what the new tests do. ## Tests Both sets were verified to fail without their fix, reproducing the reported `unrecognized_keys` error, then pass with it. - `packages/server-contract/test/thread-tabs.test.ts` — all three `fileOpenerOwner` kinds and all four terminal targets; round-trip through the server's JSON storage path; negative cases (unknown keys still rejected, mismatched owner/target payloads still rejected). The negatives pass in *both* states, confirming they guard strictness rather than restating the fix. - `apps/app/src/components/plugin/file-opener-tabs.test.ts` — the producer→contract link: tabs from `createFileOpenerTabForRequest` fed to `threadTabsSchema`, covering all three request kinds plus the projectless-workspace variant. - `apps/app/src/lib/fixed-panel-tabs-state.test.ts` — a targeted terminal tab survives a storage round trip and stays contract-valid. ## Validation Typecheck, lint, and tests green across `@bb/app` (2848), `@bb/server-contract` (57), `@bb/server` (1730), `@bb/templates` (44). Lint: 0 errors; the 147 warnings are pre-existing and byte-identical to base. `plugin-service.test.ts > reports one anonymous plugin_installed event per user install` timed out once under parallel load and passes in isolation (1547ms) — a flake in plugin-install analytics, unrelated to this change. No `HOST_DAEMON_PROTOCOL_VERSION` bump: thread tabs don't appear anywhere in `packages/host-daemon-contract`, so nothing here crosses the daemon wire. Generated artifacts (`bb-plugin-sdk.d.ts`, `plugin-sdk-dts.generated.ts`) were regenerated mechanically via the package build. The surrounding enum-key reordering is dts-bundler non-determinism, the same churn carried by recent main commits; the file is left unformatted to stay byte-stable with the generator. > AGENT GENERATED: by Claude Opus 5 --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
## Problem Keep Awake's `experimental_onWorkerExit` handler called `requestReconcile()`, which forces an immediate pass and skips the retry backoff. When a host worker crashes on start (see get-bb#1790 for the packaging cause), the server loops every ~80ms: ``` Keep Awake host worker exited unexpectedly on host host_...; retrying Could not reconcile Keep Awake on host host_...: host plugin worker exited (1) ``` One log file collected 60k+ of these lines. ## Change - `plugins/keep-awake/server.ts`: worker exits now request a *retry*, which waits for the exponential backoff (1s → 2s → … → 30s cap). Configuration changes and host connects still reconcile immediately. - `plugins/keep-awake/server.test.ts`: fake-timer tests for the delayed retry and the crash-loop backoff. The crash-loop test spins forever on the old code. This is the plugin-side half of get-bb#1790, split out so it can land now. The packaging fix (ship `bb-plugin-host-worker.mjs`) stays in get-bb#1790. ## Verification `turbo run test typecheck --filter=bb-plugin-keep-awake` passes. > AGENT GENERATED: by Claude Opus 5 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
## What was wrong The Cursor tab of the model picker (and \`bb provider models acp-cursor\`) showed "Cursor Grok 4.5" but not "Cursor Grok 4.6", even though Cursor already lists Grok 4.6 (low/medium/high/xhigh, plus fast variants). Grok 4.6 only appeared under "More models". The built-in policy \`BUILT_IN_ACP_LAUNCH_SPECS["acp-cursor"].modelCli.primaryModels\` in \`packages/agent-runtime/src/acp-launch-specs.ts\` still named \`cursor-grok-4.5-medium\`. \`splitPrimaryModels\` matches by exact family id, so the newer family could not become primary until the string changed. This is a stale-constant bug, not a parsing or discovery bug. Report: https://get-bb.github.io/reports/issues/1688.html ## What changed - \`packages/agent-runtime/src/acp-launch-specs.ts\`: replace \`cursor-grok-4.5-medium\` with \`cursor-grok-4.6-medium\` in the Cursor \`primaryModels\` list. Grok 4.5 stays selectable under "More models". - \`plugins/provider-acp/src/bridge/issue-1688-grok-4.6-primary.test.ts\` + \`issue-1688-cursor-list-models.txt\`: fixture-driven vitest that runs the captured \`cursor-agent --list-models\` output (Cursor CLI 2026.08.11) through \`parseAgentModelLines -> buildAgentModelCatalog -> splitPrimaryModels\` against the built-in policy. It asserts the Grok 4.6 family id and that the family lands in the primary list. No \`HOST_DAEMON_PROTOCOL_VERSION\` bump: \`primaryModels\` is already \`string[]\` on the wire and only a value changes. Scope is the immediate one-line fix; the picker policy is not redesigned. ## How I verified - \`pnpm exec turbo run test --filter=bb-plugin-provider-acp --force\` before the fix: the new test fails (\`cursor-grok-4.6-medium\` is in \`selectedOnlyModels\`), 1 failed | 145 passed. - After the fix: \`pnpm exec turbo run test typecheck --filter=bb-plugin-provider-acp --filter=@bb/agent-runtime --force\`: 5 tasks successful; provider-acp 8 test files passed, agent-runtime 30 test files passed; typecheck clean. - \`prettier --check\` on the new test passes. Fixes get-bb#1688 > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
## Problem Packaged `bb-app` daemons fail every host plugin call with `host plugin worker exited (1)`. Their stderr reports that neither the compiled worker nor its TypeScript development fallback exists in the installed package. `defaultWorkerEntryPath()` looked for `plugin-host-worker.js` beside `daemon-bundle.mjs` and fell back to the `.ts` source. The published package contained neither: the bundle manifest had no worker target, and the `bb-app` package whitelist only shipped the `.mjs` bundles. The Keep Awake-specific retry mitigation was split out and merged in get-bb#1792. This PR now contains only the general packaging fix and its release-level coverage. ## Changes - Add a self-contained `bb-plugin-host-worker.mjs` bundle. - Resolve the packaged `.mjs` worker first while retaining compiled-development and source-development fallbacks. - Ship the worker in `bb-app` and require it during launcher artifact validation. - Assert that the npm package whitelist includes the worker. - Exercise the packed worker directly with the packed Keep Awake host artifact. - Verify worker startup in the full packaged stack and on two independently enrolled packaged daemons. No daemon wire contract changed, so no `HOST_DAEMON_PROTOCOL_VERSION` bump is needed. ## Verification - `turbo run typecheck --filter=@bb/host-daemon --filter=bb-app` - `turbo run test --filter=@bb/host-daemon --filter=bb-app --force` (583 host-daemon tests and 65 bb-app tests) - `turbo run smoke:tarball --filter=bb-app --force` (direct packed worker, full stack, and two-daemon enrollment) - Prettier, JavaScript syntax check, and `git diff --check` > AGENT GENERATED: by GPT-5 --------- Co-authored-by: Michael Yong <[email protected]>
npm rejects provenance bundles from self-hosted runners with E422 (`Unsupported GitHub Actions runner environment: "self-hosted"`). This broke the `@get-bb/plugin-sdk` publish. This change moves the three npm publish jobs in `publish-bb-app.yml` (`publish`, `publish-nightly`, `publish-plugin-sdk`) from Blacksmith to `ubuntu-latest`. The desktop build jobs stay on Blacksmith. > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
## What was wrong `bb thread list` printed exactly three columns: `ID`, `Project`, and `Status`. The server response for `GET /api/v1/threads` (and `bb thread list --json`) carries `title` and `titleFallback` for every thread, and the desktop sidebar and `bb thread show` display them. The table renderer `printThreadTable` in `apps/cli/src/commands/thread/list.ts` never put the title in the table, so a user had to shell out to `--json` to learn which thread was which. Root cause and repro: https://get-bb.github.io/reports/issues/1648.html ## What changed - `apps/cli/src/commands/thread/list.ts`: add a `Title` column resolved as `title` -> `titleFallback` -> `-`, collapsed to one line and cut at 60 characters with an ellipsis. Column order is `ID`, `Title`, `Project`, `Status`; `ID` stays first for scripts. - Same file: the `Project` column now shows the project name. The command fetches `projects.list` once for the table view only (`--json` output does not fetch projects). Unknown project IDs fall back to the raw ID; the personal project still shows `-`. - `apps/cli/src/__tests__/command-output/thread-list.test.ts`: new test that asserts the `Title` header, the title, the fallback title, single-line collapse, 60-char truncation, project name resolution, and the unknown-project fallback; a test that `--json` skips the project fetch; the two exact-string layout tests updated for the new columns. - `packages/templates/src/templates/bb-guide-threads.md` (+ regenerated `templates.generated.ts`): document the table columns for `bb thread list`. ## Deviation from the report The report proposed only the `Title` column. Per the scope note (and get-bb#1760), this PR also resolves `projectId` to the project name in the same change. ## Verification - New test `bb thread list prints the thread title, fallback, and project name (get-bb#1648)` fails on the base commit (3 failed / 7 passed with the old `list.ts`) and passes after the change. - `pnpm exec turbo run typecheck test --filter=@bb/templates --filter=@bb/cli`: 6 tasks successful, `@bb/cli` 452 tests passed, `@bb/templates` 44 tests passed. Fixes get-bb#1648 > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
## Summary - separate terminal execution targets from thread-tab sync ownership - keep plugin-page and root-compose terminal tabs local while thread views continue syncing to their thread - add restored thread-target coverage that verifies plugin pages make no thread-tab reads or writes - tighten the file-opener fixture and make its projectless case truly projectless ## Why A restored plugin-page terminal can legitimately target a thread, but that does not make the thread the owner of the plugin page tab state. Deriving both concepts from the terminal target could replace plugin tabs with thread tabs and later persist plugin tabs into the thread. ## Verification - `pnpm exec turbo run test --filter=@bb/app --force -- --run src/components/plugin/PluginPanelRightPanelHost.test.tsx src/components/plugin/file-opener-tabs.test.ts` - `pnpm exec turbo run typecheck --filter=@bb/app` - `pnpm exec turbo run lint --filter=@bb/app --force` (0 errors; 147 existing warnings) - `git diff --check origin/main...HEAD` Follow-up to get-bb#1793. > AGENT GENERATED: by GPT-5
get-bb#1805) ## What was wrong bb ships as the `bb-app` npm package. Three of its dependencies are native add-ons: `better-sqlite3`, `node-pty`, and `@parcel/watcher`. npm install scripts download or build their binaries. npm 12 (12.0.2 is `npm@latest`) enforces the new `allowScripts` policy: for `npm install -g` and `npx`, npm blocks dependency install scripts unless `--allow-scripts`, `npm_config_allow_scripts`, or a user/global `.npmrc` names them. npm does not read the installed package's own `package.json#allowScripts` for global installs, so `bb-app` cannot fix this from inside the package. npm still exits 0, prints only a warning, and bb then dies at startup with `Could not locate the bindings file` (server) or `Failed to load native module: pty.node` (host daemon). The report reproduced this on all three install paths (`npm install -g bb-app`, `npx bb-app@latest`, and the "Add machine" installer). On npm 11 the policy is only advisory: npm warns and runs the scripts. The installer, the daemon self-updater, and the docs passed no allow-list, and the installer printed `✓ Installed` before it failed 30 s later at the join step with a raw stack trace. Independent investigation report: https://get-bb.github.io/reports/issues/1120.html ## What changed - `apps/server/src/assets/install-machine.sh`: both `npm install -g` lines pass `--allow-scripts=better-sqlite3,node-pty,@parcel/watcher`. After the install, the script requires `better-sqlite3` and `node-pty` from the installed `bb-app`. If they do not load, it fails with `npm installed bb-app, but its native add-ons (better-sqlite3, node-pty) did not load.` and points to `npm_config_allow_scripts=... npm_config_ignore_scripts=false`. - `apps/host-daemon/src/protocol-self-update.ts`: the self-updater passes the same `--allow-scripts` argument to `npm install -g`. - `apps/server/test/app/install-machine-script.test.ts`: the fake npm now lays out `lib/node_modules/bb-app/node_modules/{better-sqlite3,node-pty}` like a real install; the argv assertions include the flag; a new test `fails loudly when npm skipped the native add-on install scripts` sets `FAKE_NPM_SKIP_NATIVE_MODULES=1` and asserts exit 1, the message, and that no daemon starts. - `apps/host-daemon/src/protocol-self-update.test.ts`: argv assertions include the flag. - `README.md` and `packages/bb-app/README.md`: document `npx --allow-scripts=better-sqlite3,node-pty,@parcel/watcher bb-app@latest` and `npm config set allow-scripts=... --location=user` in the quick start and troubleshooting sections. npm 10 ignores the unknown flag and npm 11 accepts it (verified: `npm 11.16.0 install -g --allow-scripts=... --dry-run` runs with no warning). No wire changes; no `HOST_DAEMON_PROTOCOL_VERSION` bump. Deviation from the report: none in substance. The loud-failure check is the report's diff with the message wording adjusted and the module list stored in one shell variable. ## How I verified - Before the change (installer script stashed), the three installer tests failed: `installs the server tarball even when a same-version bb-app is on PATH`, `falls back to npm only when the server artifact returns 404`, `fails loudly when npm skipped the native add-on install scripts`. - `pnpm exec turbo run typecheck --filter=@bb/server --filter=@bb/host-daemon` → pass. - `pnpm exec turbo run test --filter=@bb/host-daemon` → 583 passed. - `pnpm exec turbo run test --filter=@bb/server` → 1729 passed, 2 failed. Both failures are unrelated to this change: `internal-skill-trees.test.ts` expects file mode 420 and gets 436 (local umask), and `plugin-service.test.ts` hit the 5 s timeout under full-suite load; both pass on rerun / are environmental. `install-machine-script.test.ts` (17 tests) passes. Fixes get-bb#1120 > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
## Summary
- keep provider rate-limit detection, retry classification, timing,
scheduling, cancellation, continuation wording, and manual recovery
inside the `provider-retry` plugin
- remove the rate-limit-specific server recovery service, HTTP routes,
public SDK methods, and core `bb thread retry` command
- use ordinary SDK surfaces to read the thread, environment, and
relevant event history, then send an ordinary hidden continuation turn
- extend the existing generic `threads.events.list` query with typed
event filters, newest-first ordering, and an exclusive backward cursor
- keep filtered event reads on the existing `(thread_id, type,
sequence)` index with bounded per-type reads and a global ordered merge
- prevent late Claude background, sidechain, and bridge-error drain
events from manufacturing an unaccepted provider-only turn after a
terminal failure
## Ownership boundary
The server has no provider-rate-limit recovery policy and exposes no
special failed-turn continuation API. It continues to own the ordinary
thread/event/send contracts that every SDK consumer can use.
The `provider-retry` plugin reconstructs the latest accepted failed
request from the public event stream, classifies normalized provider
events, preserves the original execution settings, schedules automatic
retries, and exposes `bb provider-retry retry`. Before release it
re-inspects the event history and then uses the existing `threads.send({
mode: "start" })` API with an agent-only `Please continue.` turn.
The plugin now fetches the latest request directly, searches only
rate-limit observations for the current provider state, and pages
forward through the six relevant lifecycle/provider types beginning at
that request. Ordinary failures therefore do not read prior request
history. Failure classification uses one-pass
request/acceptance/completion indexes instead of rescanning the event
array for every request.
The generic event reader handles multi-type filters as one bounded
index-backed read per type, then merges those already-sorted pages to
preserve global `asc`/`desc`, cursor, and limit semantics.
The Claude provider plugin owns the provider translation fix. After a
terminal failure it suppresses provider-only turn starts while late
background or bridge events drain, and clears that suppression when a
new accepted request begins.
## Contract and data changes
- no recovery-specific plugin API
- extends the existing generic `threads.events.list` SDK/server contract
with `beforeSeq`, `order`, and typed `types`
- preserves the existing default ascending behavior and `afterSeq`
pagination
- keeps `@get-bb/plugin-sdk` at 0.4.8 and regenerates its bundled
declarations/templates
- no database schema, migration, or persisted-data change; filtering and
ordering use the existing event indexes
- removes the old provider-specific server/SDK/CLI recovery contract
- bumps the host-daemon protocol because Claude event translation
semantics changed across that boundary
## Root cause
The retry plugin correctly scheduled the original accepted rate-limited
failure. While Claude background output drained, the Claude translator
opened a synthetic turn with no client request or accepted input. That
transition cancelled the scheduled retry and made recovery observe the
wrong turn.
## Validation
- reproduced the original accepted-request -> terminal 429 -> late
background-drain sequence on a new isolated dev-server thread; the
reported thread was not modified
- rebased onto `origin/main` (`bf3d67ae5`); PR head is `2fbf9fdf3`
- post-rebase Turbo typechecks passed for all eight affected packages:
`@bb/domain`, `@bb/server-contract`, `@bb/sdk`, `@bb/db`,
`@get-bb/plugin-sdk`, `@bb/templates`, `@bb/server`, and
`bb-plugin-provider-retry`
- post-rebase targeted tests passed (663 total): database 391/391,
plugin SDK 99/99, SDK 91/91, server contract 57/57, and provider-retry
25/25
- the npm package-content/version guard passes with `@get-bb/plugin-sdk`
at 0.4.8 because that version has not been published
- full GitHub CI passed: checks/lint, packages, server, integration,
app, and Linux/macOS package smoke
- `git diff --check` passed
> AGENT GENERATED: by GPT-5
## Summary - unblock provider-scoped picker requests as soon as the requested provider plugin registers - reuse one initialized Codex app-server for model catalog refreshes - invalidate provider and execution-option caches when plugin state changes - keep full provider listings gated until plugin startup settles ## Testing - `pnpm exec turbo run test --filter=@bb/server -- --run test/providers/provider-registry.test.ts test/system/execution-options.test.ts` - `pnpm exec turbo run test --filter=bb-plugin-provider-codex --force` - `pnpm exec turbo run test --filter=@bb/app -- --run src/hooks/realtime-cache-effects.test.ts` - `pnpm exec turbo run typecheck --filter=@bb/server --filter=@bb/app --filter=bb-plugin-provider-codex` - `pnpm exec turbo run lint --filter=@bb/app` (0 errors; existing warnings remain) > AGENT GENERATED: by GPT-5
## Summary - add `navPanel.experimental_fixedTabs` with validation, persistence, and host-owned rendering - route thread, new-thread, and plugin-page fixed views through the shared secondary-panel tab path - migrate the Tasks and Docs navigation sidebars to host-owned fixed tabs ## Behavior - fixed tabs are ordered, non-closable, and scoped to their plugin page - only the active fixed-tab component mounts, and it unmounts while the panel is closed - closing the final closable content tab falls back to a remaining fixed tab - the first fixed tab opens on first use, while a later user close remains closed across navigation - plugin-page fixed tabs remain local and never enter thread tab synchronization ## Validation - `pnpm exec turbo run typecheck --filter=@bb/app --filter=@get-bb/plugin-sdk --filter=bb-plugin-tasks --filter=bb-plugin-simple-notes` - focused `@bb/app` fixed-tab, panel-host, and thread-tab-sync tests - `@get-bb/plugin-sdk` app harness tests - Tasks app and shell tests - Docs app tests - Tasks and Docs production builds > AGENT GENERATED: by GPT-5 --------- Co-authored-by: Bersabel Tadesse <[email protected]>
…#1813) ## Summary - add a cached runtime-only build task for `@get-bb/plugin-sdk` - make `@bb/server#dev` depend on the runtime task instead of the full SDK package build - preserve the full declaration-generating build for packaging and validation ## Why A clean `pnpm dev` only needs the SDK runtime in `dist` before the server builds first-party provider artifacts. The previous dependency ran all 11 portable declaration bundles first, adding roughly 15 seconds to the server startup critical path. The forced runtime-only task completes in about 400 ms inside Turbo, while the full SDK build remains unchanged. ## Testing - `pnpm exec turbo run dev --filter=@bb/app --filter=@bb/server --filter=@bb/host-daemon --dry=json` - `pnpm exec turbo run build:runtime --filter=@get-bb/plugin-sdk --force` - `pnpm exec turbo run build --filter=@get-bb/plugin-sdk --force` - `git diff --check origin/main...HEAD` > AGENT GENERATED: by GPT-5
…-bb#1796) ## What was wrong When an assistant message contains a shell-style home path such as `~/.config/example.md` (inline code that ends in `.md`, or an explicit `[text](~/…)` link), the app renders it as a local-file link. `resolveRelativeLocalFileHref` in `apps/app/src/components/ui/markdown-local-file-link.ts` rejects absolute paths, fragments, queries, and URI schemes, and then treats every other href as workspace-relative. The path became `<workspace>/~/.config/example.md`, which passed the containment checks. A click opened a workspace file tab that said `Failed to load file`, and `Open in editor` failed with `Open target path does not exist: <workspace>/~/.config/example.md`. ## What changed - `apps/app/src/components/ui/markdown-local-file-link.ts`: add `isHomeRelativePath` with the pattern `/^~(?:[^/]*\/|$)/u` and include it in the early-return guard of `resolveRelativeLocalFileHref`, next to the `startsWith("/")` check. The check runs on the decoded href, so `%7E/…` is covered. It matches `~`, `~/…`, and `~user/…`. Names that only start with `~` (`~notes.md`, `~$report.docx`, `docs/~draft.md`) stay relative files. - `apps/app/src/components/ui/markdown-local-file-link.test.ts`: add 6 home-relative cases that must resolve to `null` and 4 positive cases that must still resolve as relative files. The fix follows the report's proposal with no deviation. Home-directory expansion (option 2 in the report) needs a host payload field and a protocol version bump. That is a separate change. ## How I verified - `pnpm exec vitest run src/components/ui/markdown-local-file-link.test.ts` on the base commit with only the test change: 6 failed / 15 passed. With the fix: 21 passed. - `pnpm exec turbo run typecheck --filter=@bb/app`: clean. - `pnpm exec turbo run test --filter=@bb/app`: 360 files, 2852 tests passed. Fixes get-bb#1182 Report: https://get-bb.github.io/reports/issues/1182.html > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
…bb#1809) ## What was wrong Two separate defects produced the symptoms in get-bb#1621 (see the [investigation report](https://get-bb.github.io/reports/issues/1621.html)). The `TypeError: Cannot convert argument to a ByteString … 8212` log lines came from the bundled **tasks** plugin: `GET /api/v1/plugins/tasks/http/attachments/download` wrote the raw attachment file name into the legacy `filename=` parameter of `Content-Disposition`. `sanitizeFileName` keeps non-Latin-1 characters, so an em dash (or CJK, emoji, curly quotes) made the `Response` constructor throw and every download or inline preview of that attachment returned 500. The `bb secret request … fetch failed` symptom had a different cause: the CLI proxies plugin commands with one bare `fetch()` to `POST /api/v1/plugins/:id/cli`, and the server sends nothing (not even headers) until the command returns. A human who takes more than 5 minutes to fill the secrets form hits Node's default undici `headersTimeout` (300 s); the fetch rejects with `fetch failed`, the server sees the abort, and the pending interaction disappears. The secrets path never puts free text into headers. ## What changed - `plugins/tasks/attachments/index.ts`: new `buildContentDisposition()` follows RFC 6266. `filename=` carries an ASCII fallback (`fileName.replace(/[^\x20-\x7e]/g, "-").replace(/["\\]/g, "_")`); the real name travels percent-encoded in `filename*=UTF-8''…`. Stored file names do not change. - `apps/cli/src/plugin-cli-proxy.ts`: `runPluginCliCommand` dispatches through a lazily created undici `Agent({ headersTimeout: 0 })`. The server's interaction timeout (10 min default, 1 h max) and a closed socket still bound the wait. `undici` is imported lazily so built-in `bb` commands do not pay its startup cost (measured: no change to `bb --version` time; bundle grows ~1 MB). - `apps/cli/src/client.ts`: `cliFetch` accepts the Node `dispatcher` fetch extension (`CliRequestInit`). - `apps/cli/package.json` / `pnpm-lock.yaml`: add `undici@^7.28.0` (already in the lockfile as a transitive dependency). ## Tests - `plugins/tasks/attachments/attachments.test.ts`: "downloads a non-Latin-1 file name with an ASCII fallback in filename= (issue get-bb#1621)" — adapted from the report's repro. Before: `expected 500 to be 200`. After: passes. - `apps/cli/src/__tests__/plugin-cli-proxy.test.ts`: "outlives the global fetch headers timeout while a plugin command waits on a human" — real `node:http` server that answers after 1.5 s; the global dispatcher is set to `headersTimeout: 200` to scale the 300 s ceiling down. Bare `fetch` rejects with `UND_ERR_HEADERS_TIMEOUT` (sanity), `runPluginCliCommand` must still return exit 0. Before: `TypeError: fetch failed / HeadersTimeoutError`. After: passes. ## Verification ``` pnpm exec turbo run build typecheck test --filter=@bb/cli --filter=bb-plugin-tasks --force # @bb/cli: 49 files, 451 tests passed; bb-plugin-tasks: 36 files, 339 tests passed pnpm exec prettier --check <changed files> # clean pnpm exec eslint <changed files> # clean ``` ## Deviation from the report The report's preferred fix for the CLI (NDJSON heartbeat streaming for `POST /plugins/:id/cli`) is out of scope for this PR; this uses the report's cheaper alternative (undici `Agent` dispatcher). The fix applies to all plugin CLI commands, not only secrets, because the CLI has one shared dispatch path. No server/host-daemon wire change, so no `HOST_DAEMON_PROTOCOL_VERSION` bump. Fixes get-bb#1621 Report: https://get-bb.github.io/reports/issues/1621.html > AGENT GENERATED: by Claude Opus 5 --------- Co-authored-by: Claude <[email protected]>
## Summary - keep the embedded timeline's add-to-chat callbacks stable across composer draft writes so typing does not invalidate visible timeline rows - stop `ThreadDetailViewInternal` from subscribing to per-keystroke draft writes when it only needs imperative `addQuote` and `storageKey` actions - memoize local/remote workspace-open context structurally so equal context objects do not churn the timeline-wide local-file context menu provider - skip the prompt's custom `coordsAtPos` caret measurement for ordinary native typing while retaining it for selection-only, clipboard, and drop updates - preserve custom text-paste caret reveal by tagging composer-handled paste transactions with the same `uiEvent` metadata as ProseMirror's default paste path Fixes get-bb#1304. ## Root cause The original PR addressed two genuine local costs, but issue get-bb#1304's broader scaling path remained: `ThreadDetailViewInternal` subscribed to `usePromptDraftStorage` only for stable draft actions. Every keystroke therefore re-rendered the whole thread view. Each render also rebuilt an equal `OpenInTargetContext`; identity-keyed memoization recreated `openPathInFileTarget`, then the `MarkdownLocalFileContextMenuContext.Provider` value around the mounted timeline, forcing React to scan that subtree for consumers. The thread view now uses the non-subscribing draft accessor, whose quote action shares the hook's existing implementation. `useLocalOpenTargets` keys its context memo on `kind`, `hostId`, and `serverOrigin`, preserving callback identity for semantically equal contexts without keeping stale remote context fields. ## Verification - focused prompt/editor, embedded-chat, draft-accessor, and open-context tests: 4 files / 122 tests passed - `pnpm exec turbo run typecheck --filter=@bb/app` - `pnpm exec turbo run lint --filter=@bb/app` (0 errors; repository baseline of 147 warnings) - `pnpm exec turbo run test --filter=@bb/app --force`: 363 files / 2,870 tests passed - Prettier and `git diff --check` > AGENT GENERATED: by GPT-5 --------- Co-authored-by: Michael Yong <[email protected]>
## Summary - retire the reusable Codex model-list child after request or catalog validation failures - force the next picker refresh to initialize a fresh app-server process - cover failure recovery while preserving successful child reuse Addresses the reliability finding from get-bb#1810 (comment). ## Testing - `pnpm exec turbo run test --filter=bb-plugin-provider-codex --force` - `pnpm exec turbo run typecheck --filter=bb-plugin-provider-codex` - `pnpm exec prettier --check plugins/provider-codex/src/bridge/bridge.ts plugins/provider-codex/src/bridge/bridge.model-list.test.ts plugins/provider-codex/src/bridge/fake-codex-app-server.mjs` > AGENT GENERATED: by GPT-5
## Summary - add a provider-registration-specific realtime change kind - coalesce registry mutations at plugin lifecycle boundaries using a monotonic registration revision - keep provider and execution-option caches intact for unrelated plugin changes - invalidate picker caches when a provider is installed, removed, enabled, disabled, or reloaded Addresses the performance finding from get-bb#1810 (comment). ## Testing - `pnpm exec turbo run test --filter=@bb/server -- --run test/services/plugins/plugin-service.test.ts test/services/plugins/plugin-provider-registration.test.ts -t "broadcasts plugins-changed|adds the provider"` - `pnpm exec turbo run test --filter=@bb/app -- --run src/hooks/realtime-cache-effects.test.ts` - `pnpm exec turbo run typecheck --filter=@bb/domain --filter=@bb/server --filter=@bb/app` - `pnpm exec turbo run typecheck --filter=@get-bb/plugin-sdk` - `pnpm exec turbo run lint --filter=@bb/app --filter=@bb/server --filter=@bb/domain` (0 errors; existing warnings remain) This changes only the server-to-app realtime event contract; the host-daemon protocol is unchanged. > AGENT GENERATED: by GPT-5
## Summary - give the Memory catalog budget test an explicit loaded-CI timeout for its 30 sequential CLI/database writes - replace a Linux-only `setsid` process-tree fixture with a portable detached Node process ## Investigation I sampled 500 PR CI runs from August 13–18. The dominant cluster was 15 concurrent plugin-host staging failures; that race has already been fixed on main by get-bb#1741. The remaining rerun-only test failure was the Memory catalog test exceeding Vitest's 5-second default under the fully parallel packages shard. Running that shard locally also exposed the process-tree fixture's dependency on Linux `setsid` even though the suite runs on macOS. The replacement preserves the independent-process-group behavior on both POSIX platforms. ## Testing - Memory suite passed 10 consecutive forced runs - process-utils suite passed 20 consecutive forced runs - `pnpm exec turbo run typecheck --filter=bb-plugin-memory` - `pnpm exec turbo run typecheck --filter=@bb/process-utils` - full 66-package packages shard passed: 57/57 tasks - Prettier and `git diff --check` > AGENT GENERATED: by GPT-5
) ## What was wrong `codex app-server` replays the rollout's last-turn token usage right after `thread/resume` and `thread/fork`, scoped to the **previous** turn's Codex turn id, before any new turn starts. The Codex bridge stamps every turn scope with a per-session id prefix (`bt<entropy>-<serial>-`), so that replayed snapshot went out under a bb turn id the server had never seen a `turn/started` for (resume: same Codex turn, different prefix; fork: the parent's turn). The server correctly classifies that as an orphan thread-state snapshot and drops it, and logs `Dropped orphan thread-state snapshot with no stored turn/started` twice on every Codex resume (unarchive, daemon restart, idle reap) and on the first turn of every fork. Investigation report: https://get-bb.github.io/reports/issues/1727.html ## What changed - `plugins/provider-codex/src/bridge/bridge.ts`: each session tracks the Codex turn ids it has emitted `turn/started` for. When a `thread/tokenUsage/updated` or `thread/contextWindowUsage/updated` names any other turn (only resume/fork replays do that), the bridge emits the context-window usage thread-scoped (`{kind:"thread"}`, allowed by the domain scope policy and what the ACP bridge already does) and drops the token usage (turn-only by policy; on resume it duplicates the persisted snapshot, on fork it is the parent's cumulative total). - `plugins/provider-codex/src/bridge/fake-codex-app-server.mjs`: `thread/resume` for a `usage-replay-*` provider thread id replays last-turn usage like the real app-server (opt-in fixture behavior). - `plugins/provider-codex/src/bridge/bridge.resume-usage-replay.test.ts`: new regression test that drives two bridge sessions (resume, turn, release, resume) and asserts the replayed token usage is dropped and the replayed context-window usage is thread-scoped. The server-side orphan drop is unchanged; it stays as the safety net. No wire changes, so no `HOST_DAEMON_PROTOCOL_VERSION` bump. No deviation from the report's proposed fix. ## Verification - `pnpm exec vitest run src/bridge/bridge.resume-usage-replay.test.ts` (in `plugins/provider-codex`) with `bridge.ts` reset to `origin/main`: 2 failed (resume: `expected 3 to be 2`; fork: replayed token usage `to have a length of +0 but got 1`). With the change: 2 passed. - `pnpm exec turbo run typecheck test --filter=bb-plugin-provider-codex --filter=@bb/host-daemon-contract --filter=@bb/host-daemon --force`: all pass (codex plugin 15 files / 167 tests; host-daemon-contract 52 tests; host-daemon 47 files). Fixes get-bb#1727 > AGENT GENERATED: by Claude Opus 5 --------- Co-authored-by: Claude <[email protected]>
…guration (get-bb#1797) ## What was wrong The github plugin ran `gh auth status` once at load and treated every failure as `NeedsConfigurationError`. `gh auth status` calls the GitHub API, so it also fails when the network is down, the keychain is locked, or a slow host exceeds the 10 s timeout. The load-time probe called `bb.status.needsConfiguration`, and the first pass of the `sync` background service threw the same error, which the plugin runtime treats as "stop this service until reload". After that nothing ran `gh auth status` again. `bb plugin list` showed `needs-configuration (GitHub CLI is not authenticated … run gh auth login …)` for hours while `gh auth status` succeeded in every terminal, and only `bb plugin reload github` recovered. Report: https://get-bb.github.io/reports/issues/1758.html ## What changed `plugins/github/server.ts`: - `checkAuth()` throws `NeedsConfigurationError` only when gh is missing or holds no credentials at all. It uses the network-free `gh auth token` to tell "not logged in" from "logged in but the API probe failed". Every other failure is a typed `GhUnavailableError` that carries gh's stderr. Both commands are scoped to the active `github.com` account (`--hostname github.com --active`), so a broken secondary account cannot block a valid one. - Concurrent callers share one in-flight probe promise, so the panel header and body do not spawn duplicate `gh` processes. - The `sync` service catches only `GhUnavailableError` inside its loop and retries with backoff (30 s, doubling up to the 5-min interval). Any other error surfaces to the plugin host as before. The plugin-level retry is needed because the host stops a service that crashes during activation instead of restarting it. - A sync pass where every repo failed throws `GhUnavailableError`: the sync time does not advance and the short retry applies. Partial success is still a pass. - The `status` RPC re-runs `checkAuth()` when the last probe was not `ready` and returns a typed `ghState` (`ready` | `needs_configuration` | `unavailable`). - Load time calls `bb.status.needsConfiguration` only for the two genuine configuration cases and logs a transient failure. `plugins/github/app.tsx`: the panel shows "GitHub CLI unavailable — retrying" / "GitHub CLI could not reach GitHub …" for `unavailable` instead of the `gh auth login` remedy. Deviation from the report: `--hostname github.com --active` scoping, the typed `ghState`, the in-flight probe dedupe, and the all-repos-failed rule come from the SlopCop review. Follow-ups still out of scope: make `resolveGh()` distinguish ENOENT from a timeout, and a degraded/clear status API in the plugin runtime. ## Tests `plugins/github/server.auth-latch.test.ts` drives the real plugin entry through `createFakePluginHost` with a fake `gh` on PATH: - re-probes gh after a transient auth-status failure instead of latching — fails on main - does not report needs-configuration for a transient probe failure — fails on main - still reports needs-configuration when gh has no credentials at all - control: gh working from the start never reports needs-configuration - probes only the active github.com account, so a broken secondary account does not block sync — fails before the review fixes - shares one in-flight probe between concurrent status calls — fails before the review fixes - treats a pass where every repo failed as a failure and keeps the old sync time — fails before the review fixes ## How I verified - `pnpm exec turbo run typecheck test --filter=bb-plugin-github --force` → 3 tasks successful, 14 tests passed Fixes get-bb#1758 > AGENT GENERATED: by Claude Opus 5 --------- Co-authored-by: Claude <[email protected]>
…#1695) Fixes get-bb#1690 ## Problem A fresh desktop install listens on `http://127.0.0.1:38886`. When bb connect is not paired, the Add machine dialog silently falls back to that direct URL and prints a `curl` command that no other machine can reach. ## Change - `AddMachineDialog` now detects the unpaired + loopback case (`isLocalOnlyUrl`) and shows a notice with a link to Settings → Remote access instead of an unusable command. The "Waiting for the machine to connect…" box is hidden in that state. - Disabled Connect plugin: the rpc dispatcher answers 503 for a disabled plugin and for one that is still starting. On a 503 the dialog now asks `sdk.plugins.list()` for the connect plugin status. If the plugin is disabled, the dialog shows the same notice with an "Enable the Connect plugin" link to the plugin page (`/extensions/plugins/connect`, where the enable switch lives). It does not show "Try again" or the waiting spinner in that state. Other 503s keep the transient "Remote access isn't ready yet." + Try again path. - Non-loopback direct URLs (Tailscale Serve, `BB_APP_URL`, wildcard bind) keep the existing direct command. - Tests added for the loopback, transient 503, and disabled-plugin cases; existing tests wrapped in `MemoryRouter`. - `docs/multiple-devices.md` mentions the new behavior. ## Test plan - `pnpm exec turbo run test --filter=@bb/app` - `pnpm exec turbo run typecheck --filter=@bb/app` > AGENT GENERATED: by Claude Opus 5 --------- Co-authored-by: Claude <[email protected]>
) ## What was wrong `bb plugin install <path>` builds its request through `@bb/sdk`. Since fc34548 (get-bb#1579, first shipped in bb-app 0.38.0) the SDK sent `selection: { kind: "root" }` on every install, even a plain root install where the server defaults the selection to root anyway. Servers released before that commit (bb-app <= 0.37.x) validate `POST /api/v1/plugins/install` with a strict `{ source }`-only schema, so a >= 0.38.0 CLI against a <= 0.37.x server got `HTTP 422: expected { "source": string }`, while a hand-written `curl -d '{"source": ...}'` succeeded against the same server. The SDK filled a server-owned default on the client, which broke forward compatibility with strict schemas. ## What changed - `packages/sdk/src/areas/plugins.ts`: `pluginSourceSelection` returns `undefined` for a root install. The SDK sends `selection` only when the caller sets `--plugin` or `--subdirectory`. The body still passes through `pluginInstallSourceRequestSchema.parse` for validation, but the SDK sends the caller-set keys, not the parsed output with the filled default. - `packages/server-contract/src/api/plugins.ts`: `installedPluginSchema.publisherLabel` defaults to `null` when a response omits it. A 0.37.x server installs the plugin and then answers with the 0.37.x plugin shape, which has no `publisherLabel`; the SDK used to throw on that response after the server had already applied the change. Same pattern as the existing `capabilities` default in that schema. - `packages/sdk/test/plugin-install-body.test.ts`: new repro test. It mimics a 0.37.x server (strict `{ source }` request, 0.37.x plugin response) and requires the root install round trip to resolve, and asserts the request body. It fails before the change and passes after. - Body assertions updated in `packages/sdk/test/sdk.test.ts`, `apps/cli/src/__tests__/command-output/plugin-catalog.test.ts`, `apps/app/src/hooks/queries/plugin-catalog-queries.test.ts`, and `apps/app/src/components/plugin/management/AddPluginDialog.test.tsx`. No route or request fields change; the only contract change is the response-side `publisherLabel` default. No server/daemon wire change, so `HOST_DAEMON_PROTOCOL_VERSION` stays the same. No CLI flags change. ## Verification - Repro test before the fix: `pnpm exec turbo run test --filter=@bb/sdk -- plugin-install-body` -> 1 failed (`a plain root install sends only { source }`), 1 passed. - Repro test with only the request fix (no `publisherLabel` default): 1 failed (`Invalid input: expected string, received undefined` at `plugin.publisherLabel`). - After both fixes: `pnpm exec turbo run typecheck test --filter=@bb/server-contract --filter=@bb/sdk --filter=@bb/cli --force` -> typecheck clean, server-contract 57/57, sdk 93/93, cli 450/450 passed. `@bb/server` and `@bb/app` typecheck clean. - `pnpm exec turbo run typecheck test --filter=@bb/cli --force` -> typecheck clean, 49 files / 450 tests passed. - `pnpm exec turbo run typecheck --filter=@bb/app --force` -> clean; `pnpm exec turbo run test --filter=@bb/app -- plugin-catalog-queries AddPluginDialog` -> 2 files / 20 tests passed. ## Scope This PR fixes the reported failure: a >= 0.38.0 CLI can now install a plugin on a <= 0.37.x server, and the response parses. The report also proposes a general CLI-side version-skew warning (compare `GET /api/v1/system/version` with the CLI version). That is a separate change and is not in this PR; other newer-CLI-vs-older-server paths are not covered here. Fixes get-bb#1662 Report: https://get-bb.github.io/reports/issues/1662.html > AGENT GENERATED: by Claude Opus 5 --------- Co-authored-by: Claude <[email protected]>
…ailed turn (get-bb#1807) ## What was wrong Pi has a `keepRecentTokens` floor (20k tokens by default). When a session has nothing before that floor, `/compact` refuses before it calls the model with `Compaction failed: Nothing to compact (session too small)`. Pi reports that refusal through the same `compaction_end.errorMessage` field as a real failure. The pi event translator (`packages/agent-runtime/src/pi/event-translation.ts`) turned every manual `compaction_end` error into `turn/completed status=failed`. The server maps a failed root turn to `run.failed`, so the thread moved to `error`, the composer showed "Retry by sending a follow-up message", and `bb thread tell` (steer mode) answered `HTTP 409: Thread is not active`. Nothing was wrong with the session. Report: https://get-bb.github.io/reports/issues/1721.html ## What changed - `packages/agent-runtime/src/pi/event-translation.ts`: a manual `compaction_end` with pi's pre-flight refusal messages (`Nothing to compact (session too small)`, `Already compacted`) is a no-op. The translator emits `provider/warning { summary: "Context compaction skipped", details: <pi message> }` and a normal `turn/completed status=completed`. Real failures (for example `Summarization failed: ...`) still emit `status=failed`. Manual compaction still owns its maintenance turn. - `packages/thread-view/src/build-event-projection.ts`, `operation-projection.ts`: a `provider/warning` inside a compaction turn settles the pending compaction row as `Context compaction skipped` with the warning detail. The row was otherwise pending forever, because no `thread/compacted` or `item/completed` follows a refusal. The warning is not rendered a second time as a standalone row. - Tests: `event-translation.test.ts` gets the no-op case for both refusal messages and the pinned failure case now uses a real failure message. `timeline-interruption.test.ts` gets the projection case (with a `providerWarning` factory in the harness). ## Deviation from the report The report suggested `provider/error{message:"Context compaction skipped"}` as the cheapest way to close the compaction row. That renders a red "Provider error" row and an error-status compaction row, which is not informational. This PR uses `provider/warning` instead and settles the row with a `completed` status. No wire contract changed, so `HOST_DAEMON_PROTOCOL_VERSION` is unchanged. ## Update after SlopCop review - Added the `compaction-skipped` provider warning category (`packages/domain`). The pi translator emits it for a refused manual compaction, and the thread view settles the pending compaction row **only** for that category. An unrelated warning inside a compaction turn keeps its own row and leaves the compaction pending (new test `keeps a pending compaction and renders an unrelated warning in the same turn`, fails before / passes after). - Bumped `HOST_DAEMON_PROTOCOL_VERSION` to 135 (134 was taken by get-bb#1804) (plus the contract test), because the daemon event stream and the warning category enum changed. - Regenerated `packages/plugin-sdk/bundled-types` for the new enum member. - Verified: `turbo typecheck` for domain, agent-runtime, thread-view, host-daemon-contract, plugin-sdk, server, app — 7 successful; `turbo test` for domain (145), host-daemon-contract (52), thread-view (378), agent-runtime (320) — all pass. ## How I verified - Before the change: the two new translator tests failed (`status: "failed"` with the pi error), and the new thread-view test failed (row stayed `pending`). - `pnpm exec turbo run typecheck --filter=@bb/agent-runtime --filter=@bb/thread-view` — 2 successful. - `pnpm exec turbo run test --filter=@bb/agent-runtime --filter=@bb/thread-view` — agent-runtime 320 passed, thread-view 377 passed. Fixes get-bb#1721 > AGENT GENERATED: by Claude Opus 5 --------- Co-authored-by: Claude <[email protected]>
) ## Problem Submitting a new thread makes the option strip under the prompt box jump left, then snap back when the request settles. `NewThreadComposer` disables the project picker for the length of a submission (and while attachments upload). `ProjectSelector` rendered its `ChevronDown` only when enabled, so the trigger lost the 14px icon plus its 4px flex gap. The selector is the first item in the left flex row of the strip, so the environment/branch pickers beside it shift ~18px for the whole create request. ## Fix - `ProjectSelector` gains `showChevronWhenDisabled`, matching the existing `OptionPicker` prop. - The composer passes `showChevronWhenDisabled: !locks.project`, so transient busy states keep the trigger geometry. A real lock still renders as a plain label, so the side-chat / plugin read-only look is unchanged. - New `ProjectSelector.test.tsx` covers both cases. Typecheck, lint, and tests pass for `@bb/app`. > AGENT GENERATED: by Claude Opus 5 --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
## Summary - Change \`MARKETPLACE_REFRESH_INTERVAL_MS\` from 6 hours to 2 hours in the plugin catalog service. - Update the plugins guide and the bb-cli skill text that named the six-hour interval. - Regenerate \`templates.generated.ts\`. ## Tests - \`pnpm exec turbo run test --filter=@bb/server -- test/services/plugin-catalog\`: 8 files, 109 tests pass. > AGENT GENERATED: by Claude Opus 5 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <[email protected]>
) ## What was wrong When an ACP agent (observed with OpenCode) asked permission to write a file, bb rendered the request as a **command** approval whose "command" was a bare directory path, and the timeline showed the item as `commandExecution`. The ACP bridge only forwarded the tool call's title/kind into the interaction payload and dropped `toolCall.locations[].path`, so `buildAcpPermissionInteractionPayload` had no file information and fell back to the command shape for every non-shell request. Report: https://get-bb.github.io/reports/issues/1719.html ## What changed All changes are in `plugins/provider-acp`; no server/daemon wire shape changed (no `HOST_DAEMON_PROTOCOL_VERSION` bump). - `src/tool-call-operation.ts` (new): one classifier, `classifyAcpToolCall`, that yields `command` / `file_change` (with the named paths) / `generic`. Both the timeline translator and the permission mapping use it, so an approval row and its timeline item can never disagree. `move` and location-free `edit` stay `generic` in both. `resolveAcpFileChangeWriteScope` normalizes paths, drops blank ones, and returns the one named path that contains all the others (linear scan) or `null` — so `..` segments, cross-directory sets, and lookalike prefixes never produce a false write root. - `src/bridge/bridge.ts`: `handlePermissionRequest` forwards `toolCall.locations[].path` into the normalized permission tool call, and passes the in-flight `edit` tool call with the same id (from `translator.resolveState().toolCallEventsByCallId`) as the positive write signal for OpenCode's `external_directory` request, whose own kind is the generic `other`. - `src/interactions.ts`: `AcpPermissionToolCall` gains `locations`; `buildAcpPermissionInteractionPayload` returns a `file_change` subject (`itemId` = tool-call id, `writeScope` from the resolver, `sessionGrant: null`) when the shared classifier says file change; a request with a shell command, or an `other`-kind tool without a write signal, keeps the command fallback. - `src/event-translation.ts`: `translateAcpToolCallItem` uses the shared classifier (same behavior as before for existing shapes). - `src/bridge/fake-acp-agent.mjs`: fixture support for the `external_directory` permission shape. Deviation from the report: the report proposed classifying `edit`/`delete`/`move`, or `other`+locations, as file changes. SlopCop's review showed that rule diverges from the timeline classifier and treats read-only `other` tools as writes, so it was replaced by the shared classifier above (findings addressed on the inline threads). ## Tests - `src/tool-call-operation.test.ts` (new): classifier and write-scope cases — `move`, location-free `edit`, generic `other`+locations, `..` / cross-directory / lookalike-prefix paths, blank paths. - `src/interactions.test.ts`: OpenCode `edit`-kind write → `file_change`; OpenCode `external_directory` (`other` kind, bare directory title) with the in-flight edit → `file_change` with `writeScope: "/tmp/qa-1719"`; `edit` without locations → `writeScope: null`; a shell-command request stays `command`. The three file-change cases failed before the change (`subject.kind === "command"`). - `src/bridge/bridge.test.ts`: end-to-end bridge test for the OpenCode `external_directory` shape — asserts the `file_change` subject and that Allow settles the ACP request. ## How I verified `pnpm exec turbo run lint typecheck test --filter=bb-plugin-provider-acp --force` → 9 files / 161 tests pass, lint/typecheck/prettier clean. CI green. Fixes get-bb#1719 > AGENT GENERATED: by Claude Opus 5 --------- Co-authored-by: Claude <[email protected]>
get-bb#1825) ## Summary - Replace \`MAX_SERVERS_PER_ACCOUNT\` (10) and \`MAX_MACHINES_PER_ACCOUNT\` (5) with one \`MAX_PER_ACCOUNT = 20\` in \`@bb/connect-db\`. - The server-claim gate, machine-code gate, and machine-redeem gate in \`apps/web\` all read the new constant. Servers and machines still count separately. - Dashboard copy and \`maxServers\` state now show 20. ## Tests - \`pnpm exec turbo run typecheck test --filter=@bb/connect-db --filter=@bb/web --force\` — 5/5 tasks green. > AGENT GENERATED: by Claude Opus 5 --------- Co-authored-by: Claude <[email protected]>
## What was wrong When a Claude Code Stop hook blocks a stop, Claude Code injects the hook's reason as a synthetic user message and the model answers again. That synthetic message never becomes a bb thread event (`provider-claude-code` only forwards `tool_result` user messages), so one bb turn ends with two `agentMessage` items back to back: the real answer, then a one-line reply to the hook. Completed-turn grouping in `@bb/thread-view` keeps exactly one terminal message per segment (`findLastTerminalTimelineMessage`) and slices everything before it into the collapsed `Worked for` summary. The real answer, including any question for the user, disappears behind a row that reads like a duration stat, in the app and in `bb thread log`. Issue: get-bb#1355. Report: https://get-bb.github.io/reports/issues/1355.html (reproduced live on a fresh instance from 16ceb3a; the code at the root cause is unchanged on current main). ## What changed `packages/thread-view/src/completed-turn-grouping.ts`: an assistant text that is directly followed by more assistant text, with no work in between, is a complete response, not narration about upcoming tool activity. `groupCompletedTurnSummaryMessages` now promotes such messages to `ungrouped-message` items (the terminal message counts as the follower of the last summary message). The existing collapse is unchanged for text followed by tool activity, so ordinary `text -> tool -> text` turns still render as `user -> Worked for -> last answer`. Behavior for the issue's shape (`answer, hook reply`): both assistant rows are visible at rest and no summary row is emitted. For `narration, command, answer, hook reply`: `Worked for` holds the narration and the command, then the answer and the hook reply are both visible. Deviation from the report's primary proposal: the report suggests surfacing every top-level assistant text. That changes every agentic turn (interim narration such as "Let me check X" would leave the summary), which get-bb#320 deliberately collapses, and get-bb#1508's review measured a 1,500-event page producing ~1,500 rows (past the 200-row completed-timeline cache limit). This change is scoped to the shape that loses the answer. Remaining gap: a hook that makes the model call a tool before answering (`answer, [hook], tool, reply`) still folds the answer, because nothing in the event stream marks the boundary; fixing that needs `provider-claude-code` to surface the synthetic hook message through the bridge protocol, which is a contract change and a separate PR. No wire change. The app and `bb thread log` share this row builder, so both pick it up. ## How you verified New tests, which fail on origin/main and pass with this change: - `packages/thread-view/test/completed-turn-grouping.test.ts`: `keeps an assistant response visible when more assistant text follows it directly`, `folds narration that precedes work and keeps the response that precedes the terminal text`, `keeps every response in a run of adjacent assistant texts`. Two existing tests that encoded the old behavior with two adjacent assistant texts now use a command message as the folded work. - `packages/thread-view/test/completed-turn-summary-rendering.test.ts`: `keeps an assistant answer visible when the provider re-queries and the model answers again`, `folds narration before work but keeps the answer that precedes a hook reply`. With `completed-turn-grouping.ts` checked out from origin/main the rendering test fails with: ``` - Expected + Received [ "conversation:user", - "conversation:assistant", + "turn:4-4", "conversation:assistant", ] ``` Commands: - `pnpm exec turbo run typecheck --filter=@bb/thread-view --filter=@bb/server --filter=@bb/app --filter=@bb/cli --filter=@bb/client-core`: 8/8 pass. - `pnpm exec turbo run test --filter=@bb/thread-view --filter=@bb/server --filter=@bb/cli --filter=@bb/client-core`: thread-view 21/21 files, cli 48/48, client-core 20/20, server 194/195 (the one failure is `internal-skill-trees.test.ts` mode 0644 vs 0664, a pre-existing local umask difference unrelated to this change). - `apps/app` `vitest run src/components/thread/timeline`: 28/28 files. Manual: on a dev instance built from this branch, a `claude-code` thread in a scratch repo with a blocking Stop hook (the report's 4a repro) produced events `agentMessage, agentMessage, turn/completed`. `bb thread log` now prints the three-bullet answer with its closing question as an `Assistant` row, followed by the hook reply as a second `Assistant` row, with no `Worked for` row; the app shows the same two rows at rest. Fixes get-bb#1355 > AGENT GENERATED: by Claude Opus 5 ## Independent verification Verified by a second agent on a fresh checkout of this branch (`40224ee60`, origin/main is an ancestor; no conflicts) in its own worktree and dev instance. Commands: - `pnpm install --frozen-lockfile --prefer-offline && pnpm exec turbo run build` - Fail-before: `git checkout origin/main -- packages/thread-view/src/completed-turn-grouping.ts`, then `pnpm exec vitest run test/completed-turn-grouping.test.ts test/completed-turn-summary-rendering.test.ts` in `packages/thread-view`: 5 failed / 19 passed. The five new tests are exactly the ones that fail. Rendering test assertion: ``` - Expected + Received [ "conversation:user", - "conversation:assistant", + "turn:4-4", "conversation:assistant", ] ``` Grouping test: `expected [ { kind: 'summary', …(5) } ] to deeply equal [ { kind: 'ungrouped-message', …(1) } ]`. - Pass-after: restored the PR file, same command: 24/24 pass. - `pnpm exec turbo run typecheck --filter=@bb/thread-view --filter=@bb/server --filter=@bb/cli --filter=@bb/client-core --filter=@bb/app --filter=@bb/mobile`: 9/9 successful. - `pnpm exec turbo run test --filter=@bb/thread-view --filter=@bb/server --filter=@bb/cli --filter=@bb/client-core`: thread-view 21/21 files (385 tests), cli 48/48 (453), client-core 20/20 (238). See the server result note below. - Ad-hoc probes through `renderTimelineFixture` (not committed): `reasoning, text, reasoning, text` (extended thinking between the answer and the hook reply) still renders both assistant rows at rest; `text, tool, text` still collapses to `user -> Worked for -> assistant` (the deliberate get-bb#320 behavior); a steer between two answers keeps the existing per-segment preservation; `text, text, text, tool, text` shows the first two, folds the third with the tool. Repro on the fixed branch (report section 4a, real `claude-code` turn with a blocking Stop hook on a scratch repo, own dev instance): persisted events were `item/completed agentMessage` (seq 22), `item/completed agentMessage` (seq 29), `turn/completed` (seq 32) with no hook event between, the same shape as the report. `bb thread log` (default minimal format) printed `User`, `Provisioned thread`, then the full three-bullet answer with its closing question as an `Assistant` row, then the hook reply as a second `Assistant` row, with no `Worked for` row. `GET /api/v1/threads/:id/timeline` (what the app renders) returned `conversation:user, system:operation, conversation:assistant, conversation:assistant` and no `turn` row. The bug no longer reproduces. The provider still drops the synthetic hook message (`plugins/provider-claude-code/src/delta-translation.ts` `translateUserMessage` returns `[]` when there are no tool results), so the fix is entirely in the shared row builder, as described. CI: all required checks green on the PR head (Checks, Tests server/packages/integration/app-1..3, Package Smoke ubuntu+macos, version check). Residual risks (agreed with the PR body): `answer, [hook], tool, reply` still folds the answer because no event marks the hook boundary; that needs `provider-claude-code` to surface the synthetic user message (wire change, separate PR). Any provider that emits two adjacent assistant items for one response now shows both rows. `answer, answer2, error` shows `answer` at rest but still folds `answer2` before the error row (pre-existing behavior for error terminals, not made worse). Textual merge overlap with get-bb#2071 in the same loop of `completed-turn-grouping.ts`. > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
## What was wrong
The follow-up composer keeps its model / reasoning / permission-mode
picker editable while a turn runs, but the steer gesture (Cmd+Enter on
web, long-press on mobile, Cmd+Enter in the side chat) posted only
`{input, mode: "steer-if-active"}`. `buildSteerFollowUpRequest` in
`packages/client-core/src/prompt/threadDetailPromptSubmission.ts` was
the only follow-up builder that did not spread
`buildSharedThreadExecutionRequestFields(execution)`; its siblings
`buildAutoFollowUpRequest` and `buildCreateQueuedFollowUpRequest` do.
With `model`/`reasoningLevel` omitted, the server's
`buildExecutionOptions` resolves them from the thread's last execution,
which is the active turn's tuple, so the steer was stored in
`client/turn/requested` and dispatched with the previous selection while
the picker showed the new one. Issue: get-bb#1860. Report:
https://get-bb.github.io/reports/issues/1860.html
## What changed
- `packages/client-core/src/prompt/threadDetailPromptSubmission.ts`:
`buildSteerFollowUpRequest` and `buildFollowUpShortcutRequest` take the
same `execution: FollowUpExecutionSelection` argument as the other
builders and spread it into the `steer-if-active` request.
- `apps/app/src/views/thread-detail/ThreadDetailPromptArea.tsx`:
`handleModifierSubmit` passes `followUpExecutionSelection` (already
computed for `handleSend`).
- `apps/app/src/components/thread/embedded-chat/EmbeddedThreadChat.tsx`:
the side-chat steer spreads `executionRequestFields` like its normal
send/queue requests.
- `apps/mobile/src/screens/thread/prompt-area/follow-up-submission.ts`:
the steer intent passes the `execution` it already receives.
No server, host daemon, or wire change: `SendMessageRequest` already
accepts these fields for every mode (the queued "Send now" path and `bb
thread tell --mode steer --model ...` already send them), so no
`HOST_DAEMON_PROTOCOL_VERSION` bump. No CLI or doc surface changes.
Provider note (from the report): Claude Code applies model/reasoning
changes to a live session on steer. Codex cannot change model inside a
running turn, so for Codex the steer is now recorded with the selected
tuple and the running turn keeps its model; the selection takes effect
at the next `turn/start`. Making the picker read-only for such providers
is a separate product decision.
## How you verified
New test `steers with the selected execution options` in
`packages/client-core/test/threadDetailPromptSubmission.test.ts`. On
origin/main source it fails:
```
AssertionError: expected { kind: 'draft', request: { …(3) } } to deeply equal { kind: 'draft', request: { …(7) } }
- "executionInputSources": { "model": "explicit", "permissionMode": "explicit", "reasoningLevel": "explicit" },
- "model": "gpt-5.6-luna",
- "permissionMode": "full",
- "reasoningLevel": "low",
```
With the fix it passes. The mobile `buildFollowUpSubmission` steer test
now also asserts the tuple is present.
Commands (run from the committed tree, `git status --porcelain` empty):
```
pnpm exec turbo run typecheck test --filter=@bb/client-core --filter=@bb/mobile --filter=@bb/app
Tasks: 9 successful, 9 total
@bb/client-core:test: Tests 239 passed (239)
@bb/mobile:test: Tests 827 passed (827)
@bb/app:test: Tests 3156 passed | 3 skipped (3159)
```
Manual end-to-end on an isolated dev instance (`scripts/bb-dev-app
current`, real Codex): spawned a thread with `gpt-5.6-terra` / `high`
running `sleep 120`, switched the picker to `5.6-Luna · Low` mid-turn in
headless Chromium, typed a steer and pressed Meta+Enter. A
`window.fetch` hook captured the body:
```
POST /api/v1/threads/thr_mkjycvscnv/send
{"input":[…],"mode":"steer-if-active","model":"gpt-5.6-luna","permissionMode":"full","reasoningLevel":"low","serviceTier":"default","executionInputSources":{…all "explicit"}}
```
Stored `client/turn/requested` rows for the thread:
```
1 | thread-start | gpt-5.6-terra | high
21 | steer | gpt-5.6-luna | low
```
The steer joined the running turn (`turn/input/accepted`), the agent
replied `steered`, and the turn completed without error.
Fixes get-bb#1860
> AGENT GENERATED: by Claude Opus 5
## Independent verification
Verified by a separate agent in its own worktree (branch checked out
from `bb/fix-1860-steer-model-change` at 725c36f; `origin/main`
f6fb434 is an ancestor, `mergeable: MERGEABLE`).
**Fail-before / pass-after.** Restored the four non-test source files to
`origin/main` (`git checkout origin/main --
apps/app/.../EmbeddedThreadChat.tsx
apps/app/.../ThreadDetailPromptArea.tsx
apps/mobile/.../follow-up-submission.ts
packages/client-core/src/prompt/threadDetailPromptSubmission.ts`) and
ran the PR's tests:
- `packages/client-core`: `pnpm exec vitest run
test/threadDetailPromptSubmission.test.ts` -> `1 failed | 14 passed`.
Failing assertion: `steers with the selected execution options` —
received `{ id, input, mode: "steer-if-active" }`, missing `model:
"gpt-5.6-luna"`, `reasoningLevel: "low"`, `permissionMode: "full"`,
`executionInputSources`.
- `apps/mobile`: `pnpm exec vitest run
src/screens/thread/prompt-area/follow-up-submission.test.ts` -> `1
failed | 8 passed`, same missing fields on the `kind: "steer"` request.
Restored the PR source (`git checkout HEAD -- <same files>`, `git status
--porcelain` empty) and re-ran: `15 passed` and `9 passed`.
**Turbo (cache bypassed).** `pnpm exec turbo run typecheck test
--filter=@bb/client-core --filter=@bb/mobile --filter=@bb/app --force`
-> `Tasks: 9 successful, 9 total`, `Cached: 0 cached`. client-core 20
test files, mobile 123, app 409, all passed.
**Live repro on the fixed branch (own isolated dev instance, real Codex
0.149.0).** Spawned a Codex thread and started a turn with
`gpt-5.6-terra`/`high` running `sleep 240`. In headless Chromium
(doobie) with a `window.fetch` hook, switched the composer picker to
`5.6-Luna · Low` while the turn was running, typed a steer, pressed
Meta+Enter. Captured body of `POST /api/v1/threads/thr_cywmjkjaxg/send`:
```
{"input":[...],"mode":"steer-if-active","model":"gpt-5.6-luna","permissionMode":"full","reasoningLevel":"low","serviceTier":"default","executionInputSources":{"model":"explicit","serviceTier":"explicit","reasoningLevel":"explicit","permissionMode":"explicit"}}
```
Stored `client/turn/requested` rows: seq 63 `new-turn` terra/high, seq
73 `steer` **luna/low** (on main the report shows the steer stored with
the previous turn's tuple). Steer was accepted (`turn/input/accepted`),
agent replied `steered`, `turn/completed` with no error or
session-replaced event. The bug no longer reproduces.
**Hostile review.** Client-only; fixes the root cause (the steer builder
omitted the selection while its sibling send/queue builders spread it).
Server already reads `payload.model` for every mode
(`recoverThreadModelOverride` + `buildExecutionOptions` in
`thread-send.ts`), so no server/daemon/wire change and no
`HOST_DAEMON_PROTOCOL_VERSION` bump needed. All three callers of
`buildFollowUpShortcutRequest` (web, mobile) and the side-chat steer now
pass the selection; remaining `steer-if-active` senders are
plugin-programmatic (workflows/automations/tasks) and out of scope.
Checked that the steer path's `reconfigureThreadIfNeeded` cannot replace
a session mid-turn: the single `bridge-protocol-adapter` always
classifies settings changes as `"live"`. No casts, no ignored fields, no
CLI/doc surface change.
**CI.** All checks pass (Checks, Tests app-1/2/3, integration, packages,
server, Package Smoke ubuntu + macOS, version checks); iOS simulator and
Node compat smoke skipped as usual.
**Residual risk.** As the report notes, Codex cannot retarget a running
turn, so for Codex the recorded tuple applies at the next turn/start;
Claude Code applies it live. Making the picker read-only for such
providers is a separate product decision.
> AGENT GENERATED: by Claude Opus 5
Co-authored-by: Claude <[email protected]>
## What was wrong Task thread attachments in the Tasks plugin were append-only. `upsertTaskThread` inserts one row per `(task_id, thread_id)` and the store's `deleteTaskThread` was dead code: no RPC in `delegationRpcContract`, no CLI command, and no UI control reached it. An orchestrator that respawns a worker and attaches each replacement therefore accumulates every dead predecessor on the task, and a thread that moves on to another task keeps its row on the old one. On top of that, `listTaskThreads` ordered rows `ORDER BY attached_at, id` (oldest first), so the first row in `bb tasks threads`, `bb tasks show`, `--json`, and the task page's "Agent threads" section was the dead predecessor. Issue: get-bb#1761. Report: https://get-bb.github.io/reports/issues/1761.html ## What changed - `plugins/tasks/db/store.ts`: `listTaskThreads` now orders live threads (`starting`/`working`/`idle`) before terminal ones (`completed`/`failed`), newest first within each group (`attached_at DESC, id DESC`). This is the single read path, so the CLI table, `--json`, `bb tasks show`, the detail page cards, the PR-pill ordering, and task mentions all follow. - `plugins/tasks/delegate/contract.ts`, `plugins/tasks/delegate/index.ts`: new `taskThreadsDetach` RPC, the inverse of `taskThreadsAttach`. It deletes the `(task, thread)` row via the existing `getTaskThreadByThreadId` + `deleteTaskThread`, publishes `threads:changed` and `tasks:changed` like attach, and fails with `Thread <id> is not attached to <KEY>` when there is no row. Detaching from one task leaves the same thread's rows on other tasks alone. The reconcile service reads `task_threads`, so a detached thread is no longer tracked. - `plugins/tasks/cli/index.ts`: `bb tasks detach <key> [--thread <thread-id>] [--json]`. Thread resolution is shared with `attach` (`--thread`, then `BB_THREAD_ID`, then the CLI context thread) through a small `resolveInvokingThreadId` helper. Root help and the registered command list include `detach`. - `plugins/tasks/views/detail/threads.tsx`, `plugins/tasks/views/detail/index.tsx`: each thread card gets an X "Detach <title>" control that opens the plugin's `ConfirmDialog` and then calls `taskThreadsDetach`; the detail view refreshes the thread and PR queries. Errors surface through the existing detail toasts. - Docs: `plugins/tasks/README.md` (command table + delegation section), `plugins/tasks/skills/tasks/SKILL.md` (step 6 tells agents to detach on hand-off/respawn), `packages/templates/src/templates/bb-guide-plugins.md`, and `apps/server/src/services/skills/builtin-skills/bb-cli/SKILL.md`. Plugin-internal only: nothing on the server/host-daemon wire changes, so no `HOST_DAEMON_PROTOCOL_VERSION` bump. `attached_at` is left untouched on re-attach (it still means "first attached"); a revived thread moves to the live group because the upsert refreshes `live_status`. ## How you verified New tests (all fail on origin/main, pass on this branch): - `plugins/tasks/db.test.ts` "lists live task threads before terminal ones, newest first" — before: `AssertionError: expected [ 'thr_dead_first', …(3) ] to deeply equal [ Array(4) ]`. - `plugins/tasks/delegate/delegate.test.ts` "detaches an attached thread through taskThreadsDetach and invalidates" — before: `plugin "tasks" has no rpc method "taskThreadsDetach"`. - `plugins/tasks/cli/cli.test.ts` "detaches a thread with `bb tasks detach` and lists live threads first" — before: `expected 'Usage: bb tasks <command> [options]\n…' to contain 'detach …'`. - `plugins/tasks/views/detail/threads.test.tsx` "detaches a thread from its card after confirmation and refetches the list" — before: `Unable to find role="button" and name "Detach Worker"`. Fail-before was produced by checking out the six source files from `origin/main` with the new tests in place (`4 failed | 1 passed`), then restoring the branch (`4 passed`). From the committed tree (`git status --porcelain` empty): - `pnpm exec turbo run typecheck --filter=bb-plugin-tasks --filter=@bb/templates --filter=@bb/server --filter=@bb/cli` → `Tasks: 8 successful, 8 total` - `pnpm exec turbo run test --filter=bb-plugin-tasks --filter=@bb/cli --force` → `Tasks: 7 successful, 7 total` (tasks: 35 test files passed; cli: 48 passed) Manual repro on my own dev instance with the builtin tasks plugin installed from this branch, mirroring the issue's transcript (one codex thread forced into `error` with a bogus model, one real idle thread, both attached to SC-1 in that order): ``` $ bb tasks threads SC-1 THREAD STATUS PRESET TITLE thr_tjd3ztqcgd idle Attached Resuming SC-1 after predecessor died thr_hxiffdtdpf failed Attached SC-1 worker (phase 1) $ bb tasks detach SC-1 --thread thr_hxiffdtdpf Detached thr_hxiffdtdpf from SC-1 $ bb tasks detach SC-1 --thread thr_hxiffdtdpf Thread thr_hxiffdtdpf is not attached to SC-1 (exit 1) $ bb tasks attach SC-2 --thread thr_tjd3ztqcgd && bb tasks detach SC-1 --thread thr_tjd3ztqcgd $ bb tasks threads SC-1 No attached threads. ``` In the app (headless Chrome via doobie), the SC-2 page listed the Idle thread above the Failed one, the X control opened "Detach thread?", and confirming removed the card; `bb tasks threads SC-2` then showed only the live thread. Fixes get-bb#1761 > AGENT GENERATED: by Claude Opus 5 ## Independent verification Verified on a fresh worktree at `4db9a918b` (branch is directly on top of `origin/main` `f6fb434ab`; `git merge-base --is-ancestor origin/main HEAD` exit 0). Commands: - `pnpm install --frozen-lockfile --prefer-offline && pnpm exec turbo run build` -> `Tasks: 18 successful, 18 total` - Fail-before: `git checkout origin/main -- plugins/tasks/cli/index.ts plugins/tasks/db/store.ts plugins/tasks/delegate/contract.ts plugins/tasks/delegate/index.ts plugins/tasks/views/detail/index.tsx plugins/tasks/views/detail/threads.tsx`, then from `plugins/tasks`: `pnpm exec vitest run db.test.ts delegate/delegate.test.ts cli/cli.test.ts views/detail/threads.test.tsx -t "live task threads before terminal|taskThreadsDetach|bb tasks detach|detaches a thread from its card"` -> `4 failed`: - `AssertionError: expected [ 'thr_dead_first', …(3) ] to deeply equal [ Array(4) ]` (received `thr_dead_first` first, expected `thr_live_new`) - `Error: plugin "tasks" has no rpc method "taskThreadsDetach"` (`code: 'unknown_method'`) - `AssertionError: expected 'Usage: bb tasks <command> [options]\n…' to contain 'detach …'` - `TestingLibraryElementError: Unable to find role="button" and name "Detach Worker"` - Pass-after: `git checkout HEAD -- <same files>` (tree clean), same vitest command -> `4 passed`. - `pnpm exec turbo run typecheck --filter=bb-plugin-tasks --filter=@bb/templates --filter=@bb/server --filter=@bb/cli` -> `Tasks: 8 successful, 8 total` - `pnpm exec turbo run test --filter=bb-plugin-tasks --filter=@bb/cli --force` -> `Tasks: 7 successful, 7 total` (tasks 35 files / 363 tests, cli 48 files / 453 tests) Repro of the issue on the fixed branch (own dev instance, `builtin:tasks` installed from this branch, codex thread with a bogus model -> `error`, then a real idle thread; both attached to SC-1 dead-first): ``` $ bb tasks threads SC-1 THREAD STATUS PRESET TITLE thr_pty8zbfby4 idle Attached Resuming SC-1 after a machine crash killed your predecessor thr_ymbbpzywuq failed Attached SC-1 · OSS divergence audit (phase 1) $ bb tasks attach SC-2 --thread thr_ymbbpzywuq $ bb tasks detach SC-1 --thread thr_ymbbpzywuq Detached thr_ymbbpzywuq from SC-1 $ bb tasks detach SC-1 --thread thr_ymbbpzywuq # exit 1 Thread thr_ymbbpzywuq is not attached to SC-1 $ bb tasks threads SC-1 -> only thr_pty8zbfby4 (idle) $ bb tasks threads SC-2 -> thr_ymbbpzywuq still attached (cross-task row untouched) ``` Headless Chrome (doobie) on the SC-2 task page: the Idle card renders above the Failed card although it was attached later; each card has an `aria-label="Detach <title>"` X control; clicking it opens the "Detach thread?" ConfirmDialog; confirming calls `taskThreadsDetach` and the Failed card disappears, confirmed by `bb tasks threads SC-2` afterwards. Review notes: fixes the root cause (ordering query plus the missing inverse at RPC/CLI/UI), plugin-internal so no `HOST_DAEMON_PROTOCOL_VERSION` change is needed, no casts, no accepted-but-ignored fields, doc surfaces per `docs/cli-guide-and-skill.md` updated. No consumer of `listTaskThreads` depends on chronological order (PR resolution dedupes by URL; board/list meta filter by status; mentions just format). Reuses the plugin's existing `ConfirmDialog` and `useRpc<DelegationRpcContract>` patterns. CI: all checks green (`gh pr checks 2167`: Checks, Package Smoke x2, Tests app-1/2/3, integration, packages, server all pass). Residual risks: a row reconciled into `completed`/`failed` moves down the list on the next refetch (cosmetic; lists are short). Re-attaching does not refresh `attached_at`. A reconcile tick in flight when a row is detached throws `Task thread not found` inside `transitionThread`; it is caught and logged as a warning and creates no comment. No in-app undo for detach; the dialog points at `bb tasks attach`. > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
## What was wrong `POST /api/v1/projects/:id/attachments` stored and served a pasted or dropped `.heic` file verbatim and classified it as a `localImage` because its MIME type starts with `image/`. Nothing downstream can decode HEIC/HEIF: Chromium (the web app and the Electron shell) ships no HEVC decoder, so the composer thumbnail and the timeline `<img>` showed the broken-image glyph, and no provider image input accepts HEIC either (Codex replaced it with "image content omitted because it could not be processed"). The user saw a broken picture and the model silently received nothing. Issue: get-bb#1670. Report: https://get-bb.github.io/reports/issues/1670.html **This PR is a stopgap, not the rendering fix the issue asks for.** Rendering HEIC requires an HEVC decoder that bb does not have. The only portable option is libheif/libde265 compiled to WASM (`libheif-js`, LGPL-3.0, ~1.4 MB, a patent-encumbered codec that Chromium itself declines to ship), run either in the browser before upload or in the server process (where a 12 MP photo blocks the event loop for about two seconds unless it moves to a worker; measured 0.1 s decode + 0.1 s encode for a 1.4 MP sample). That dependency and placement decision belongs to the maintainers, so this PR does the safe part: it turns the silent failure into an immediate, explained refusal. The issue stays open for the transcoding work (`Refs`, not `Fixes`). ## What changed - `apps/server/src/services/projects/attachments.ts`: `storeAttachment` refuses uploads whose MIME type is `image/heic`, `image/heif`, or their `-sequence` variants with `400 invalid_request` and the message `HEIC images are not supported. Convert the image to JPEG or PNG before attaching it.` This is exactly the set of uploads that used to become a broken `localImage`: Chromium labels a pasted or dropped `.heic` `image/heic`, and `bb project attachment upload` infers the same from the extension. The same bytes sent with a non-image MIME type (for example `--mime-type application/octet-stream`) still store as a plain `localFile`, as on main, so a user can hand the raw file to an agent that converts it on the host. Every client (web, desktop, mobile document picker, CLI, SDK) gets the same answer. No wire change between server and daemon. - `apps/app/src/components/thread/embedded-chat/useComposerAttachmentUploads.ts`: the follow-up and queued-message composers now show the server's reason (`Failed to attach IMG_0001.heic: HEIC images are not supported. ...`) instead of a bare `Failed to attach: IMG_0001.heic`. The new-thread composer already did this through `getMutationErrorMessage`; this brings the other composers in line. Transport errors keep the old generic text. - CLI guide template (`packages/templates/src/templates/bb-guide-projects.md`) and the bb-cli skill (`apps/server/src/services/skills/builtin-skills/bb-cli/SKILL.md`) mention that `image/heic` and `image/heif` uploads are rejected. Revision after review: the first version also rejected by `.heic`/`.heif` extension alone, which blocked the explicit non-image upload path that main handled correctly as a `localFile`. The rejection is now MIME-only and the test pins the `localFile` path. Not included: an `onError` fallback tile in `AttachmentPreview`/`ConversationAttachments` for threads that already hold HEIC `localImage` attachments. That is a general broken-image UI concern, independent of HEIC, and is left for a follow-up. Deviation from the report's proposed fix: it proposed transcoding HEIC to JPEG at upload with a WASM decoder. Not done here for the reasons above. If the maintainers want HEIC to just work, the smallest follow-up is a browser-side conversion before upload (decode with `libheif-js`, encode with `OffscreenCanvas.convertToBlob("image/jpeg")`), mirroring the mobile app, which already asks the iOS picker for JPEG instead of HEIC. The server check then stays as the backstop for programmatic uploads. ## How you verified New tests, both fail on `origin/main` and pass here: - `apps/server/test/public/public-project-attachments.test.ts` > `rejects HEIC/HEIF image uploads instead of storing an image nothing can render`. With `attachments.ts` reverted to `origin/main`: `AssertionError: expected 201 to be 400` (the HEIC was stored as a `localImage`). It also asserts that `image/heif; charset=binary` is rejected and that the same bytes as `application/octet-stream` return `201 {"type":"localFile"}`. - `apps/app/src/components/thread/embedded-chat/useComposerAttachmentUploads.test.tsx` > `shows the server's reason when it refuses an upload`. On main: `Expected: "Failed to attach IMG_0001.heic, shot.png: HEIC images are not supported. ..."`, `Received: "Failed to attach: IMG_0001.heic, shot.png"`. Run from the committed tree at `d28f3fc34` (`git status --porcelain` empty, `origin/main` at `f6fb434ab`): - `pnpm exec turbo run typecheck --filter=@bb/server --filter=@bb/app --filter=@bb/templates --filter=@bb/cli`: `Tasks: 7 successful, 7 total`. - `pnpm exec turbo run test --filter=@bb/server --filter=@bb/templates --filter=@bb/cli`: cli 48/48 files; templates 6/6 files; server 193/195 files. The two server failures are unrelated to this change: `internal-skill-trees.test.ts` asserts file mode 0644 and gets 0664 on this workstation's umask 0002 (fails identically on clean main, passes in CI), and `plugin-update.test.ts > waits one full interval when no plugins are eligible for update checks` hit its 5 s timeout under a load average of 35; it passes alone with `--testTimeout=60000` (test body 1.9 s). - `pnpm exec turbo run test --filter=@bb/app`: `409 passed (409)` files, `3157 passed | 3 skipped`; vitest also reported one unhandled post-teardown timer from `ThreadTimelineRows.windowing.test.tsx` (`document is not defined` in `useScrollToSearchedMessage.ts`), a file this PR does not touch; that file and the composer test pass cleanly when re-run together. Manual, on a dev instance of this branch, re-running the report's repro: - `curl -F "[email protected];type=image/heic" .../attachments` (nokia `autumn_1440x960.heic`) returns `400 {"code":"invalid_request","message":"HEIC images are not supported. Convert the image to JPEG or PNG before attaching it."}`; `type=image/heif` with an `IMG.HEIF` filename is also rejected; `type=application/octet-stream` returns `201 {"type":"localFile",...}`; a PNG returns `201 {"type":"localImage",...}`. - `bb project attachment upload <project> --client-file sample.heic` (MIME inferred from the extension) prints `Error: HTTP 400: HEIC images are not supported. ...`; with `--mime-type application/octet-stream` it prints `Attachment uploaded: sample-...heic`. - Headless Chromium paste of the real HEIC `File` into the new-thread composer and into a thread's follow-up composer (first revision; the app code and the `image/heic` server response are unchanged since): no `<img>` is created, and the composer shows the reason inline. Refs get-bb#1670 > AGENT GENERATED: by Claude Opus 5 ## Independent verification Verified round 2 on `d28f3fc34` (merge-base with `origin/main` `f6fb434ab`; `origin/main` has since gained only the unrelated `c942421a4`), in a separate worktree with its own dev instance. Commands and results: - `git checkout origin/main -- apps/app/src/components/thread/embedded-chat/useComposerAttachmentUploads.ts apps/server/src/services/projects/attachments.ts`, then `pnpm exec vitest run test/public/public-project-attachments.test.ts` (apps/server): `AssertionError: expected 201 to be 400` in `rejects HEIC/HEIF image uploads instead of storing an image nothing can render` (1 failed | 3 passed). `pnpm exec vitest run src/components/thread/embedded-chat/useComposerAttachmentUploads.test.tsx` (apps/app): `Expected: "Failed to attach IMG_0001.heic, shot.png: HEIC images are not supported. ..."`, `Received: "Failed to attach: IMG_0001.heic, shot.png"` (1 failed | 3 passed). - `git checkout HEAD -- <same files>`: both files 4/4 pass. - `pnpm exec turbo run typecheck --filter=@bb/server --filter=@bb/app --filter=@bb/templates --filter=@bb/cli`: `Tasks: 7 successful, 7 total`. - `pnpm exec turbo run test --filter=@bb/server --filter=@bb/templates --filter=@bb/cli --filter=@bb/app --force`: app 409/409 files, cli 48/48, templates 6/6, server 194/195 files (1823/1824 tests). The one failure is `internal-skill-trees.test.ts` (0644 vs 0664 file mode under umask 0002), a known local-only failure unrelated to this PR. - Repro on the fixed branch (own dev instance, nokia `autumn_1440x960.heic`): `curl -F "[email protected];type=image/heic"` -> `400 {"code":"invalid_request","message":"HEIC images are not supported. ..."}`; `type=image/heif` -> 400; `type="Image/HEIC; charset=binary"` -> 400; `type=application/octet-stream` -> `201 {"type":"localFile",...}`; no explicit type (curl default octet-stream) -> 201 localFile; PNG -> `201 {"type":"localImage",...}`. `bb project attachment upload <proj> --client-file sample.heic` -> `Error: HTTP 400: HEIC images are not supported...`; with `--mime-type application/octet-stream` -> `Attachment uploaded: sample-...heic`. - Headless Chromium paste of a real `image/heic` `File` into the new-thread composer and into a thread's follow-up composer: no `<img>` pointing at `/attachments/content` is created; the new-thread composer shows `HEIC images are not supported. Convert the image to JPEG or PNG before attaching it.` inline and the follow-up composer shows `Failed to attach IMG_0001.heic: HEIC images are not supported. ...`. The original broken-thumbnail symptom no longer reproduces. - Checked that `storeAttachment` has a single caller (the upload route), that the mobile document picker surfaces the 400 through its `BbHttpError` toast, and that the mobile photo picker already requests JPEG for HEIC assets, so the new server policy matches the existing mobile stance. - CI: all checks green (Checks, Package Smoke ubuntu/macos, Tests app-1/2/3, integration, packages, server). Residual risks (acknowledged by the PR): HEIC still cannot be attached as an image until a transcoder lands (issue stays open via `Refs`); existing threads with stored HEIC `localImage` attachments still render the broken-image glyph; HEIC bytes uploaded with a misleading non-HEIC image MIME type are not sniffed. Minor doc gap: the bb-plugin-authoring skill's SDK attachment paragraph mentions the size caps but not the HEIC rejection. > AGENT GENERATED: by Claude Opus 5 --------- Co-authored-by: Claude <[email protected]>
## What was wrong `applyServerTarget()` in `apps/desktop/src/main.ts` awaited `loadWindowUrl()` for `custom` and `connect` targets with no handler. `BrowserWindow.loadURL` rejects for every network-level failure (`ERR_CONNECTION_REFUSED`, `ERR_CONNECTION_TIMED_OUT`, `ERR_FAILED`, ...). At launch that rejection unwound to `runDesktopApp().catch(...)`, which rendered `error.stack` into the static, script-less error view: "Could not open bb" plus Electron internals and nothing to click. From Window > Server the same rejection was unhandled (`void setActiveServerTarget(...)`), so the window went blank and `bbAppLoaded` stayed `true`. `bbAppLoaded` was also set before the load was known to have succeeded. Issue: get-bb#1494. Report: https://get-bb.github.io/reports/issues/1494.html ## What changed - `apps/desktop/src/remote-server-load.ts` (new): `loadRemoteServerPage()` loads the remote URL and, on rejection, logs only the Electron error code plus the server origin and renders the shared startup error view: "Could not reach this bb server. The bb server at `<origin>` did not answer. Check that the machine is awake and reachable, then choose Window > Server to retry this server or switch to This Mac." `describeServerUrl()` prints only the origin, because a saved custom URL can carry a credential or a query token. A load the user already superseded (generation check) shows nothing. - `apps/desktop/src/main.ts`: both remote branches of `applyServerTarget()` go through a small `loadRemoteServerTarget()` wrapper around that helper. `bbAppLoaded` flips and the remote system-config sync starts only after the page loaded. A failed `connect` load stops the session renewal it had just started. `refreshApplicationMenu()` now runs on the failure path too. Deviation from the issue's proposal: this PR does not add Retry / Use This Mac buttons. The `data:` error view runs under `default-src 'none'` with no preload, so buttons need a new main-process IPC surface (that is what the closed get-bb#1519 built, +768 lines). This PR fixes the root cause (an unhandled rejection) and gives the user the server name and the existing menu route; the error view now has parity with the builtin and Connect-authentication failures. Actionable buttons can follow as a separate UI change. No wire, CLI, or doc changes. ## How you verified Live repro on origin/main with the built desktop shell under Xvfb (Electron, Linux), saved `custom` target `http://127.0.0.1:47771` with nothing listening: ``` BODY TEXT: Could not open bb Error: ERR_CONNECTION_REFUSED (-102) loading 'http://127.0.0.1:47771/' at rejectAndCleanup (node:electron/js2c/browser_init:2:89743) ... interactive controls on page: 0 ``` Re-selecting the same target from Window > Server on main: `URL: chrome-error://chromewebdata/`, empty body, 2x `UnhandledPromiseRejectionWarning` on stderr. Same two steps on this branch: ``` BODY TEXT: Could not reach this bb server The bb server at http://127.0.0.1:47771 did not answer. Check that the machine is awake and reachable, then choose Window ▸ Server to retry this server or switch to This Mac. Logs are under .../logs/. ``` stderr: `[desktop] could not load the bb server at http://127.0.0.1:47771: ERR_CONNECTION_REFUSED (-102)`, 0 unhandled rejections. Menu re-select shows the same named error instead of a blank window. Starting a server on 47771 and re-selecting the target from the menu then loads the page (`URL: http://127.0.0.1:47771/`). Tests: `apps/desktop/test/remote-server-load.test.ts` (6 tests) covers the error view copy and title, that the stack never reaches the screen, credential/query redaction on screen and in the log, the superseded-load path, and the success path. With origin/main's `main.ts` and without the new module the file fails with `Error: Cannot find module '../src/remote-server-load.js'` (the code path under test did not exist; `main.ts` runs on import and is not unit-testable). `apps/desktop/src/main.ts` is exercised by the live repro above. `pnpm exec turbo run typecheck test --filter=@bb/desktop --force` on the committed tree: `Tasks: 5 successful, 5 total`, `Test Files 35 passed (35)`, `Tests 228 passed (228)`. Fixes get-bb#1494 > AGENT GENERATED: by Claude Opus 5 ## Independent verification Verified by a second agent on a fresh worktree (`git fetch origin bb/fix-1494-remote-target-dead-end && git checkout -b verify-1494-r1 FETCH_HEAD`, HEAD `2bb375108`, `origin/main` is an ancestor, PR reports `MERGEABLE`). Commands run: - `pnpm install --frozen-lockfile --prefer-offline && pnpm exec turbo run build` - Fail-before: `git checkout origin/main -- apps/desktop/src/main.ts && rm apps/desktop/src/remote-server-load.ts`, then `pnpm exec vitest run test/remote-server-load.test.ts` from `apps/desktop` -> `FAIL ... Error: Cannot find module '../src/remote-server-load.js'` (1 failed suite). The helper under test does not exist on main; `main.ts` runs on import, so the call site itself has no unit seam. - Pass-after: `git checkout HEAD -- <those files>`, same command -> `Test Files 1 passed (1), Tests 6 passed (6)`. - `pnpm exec turbo run typecheck test --filter=@bb/desktop --force` -> `Tasks: 5 successful, 5 total`, `Test Files 35 passed (35)`, `Tests 228 passed (228)`. Live repro (built Electron shell under `xvfb-run`, own `--user-data-dir` and `BB_DATA_DIR` under `~/.bb-dev/scratch/1494-verify/`, saved custom target `http://127.0.0.1:47771` with nothing listening, CDP on 49333, main-process inspector on 49334; the report's `run-desktop-unreachable.sh`, `cdp-screenshot.mjs`, and `main-click-server-menu.mjs`): - Built from origin/main's `main.ts` (bug confirmed): startup body `Could not open bb / Error: ERR_CONNECTION_REFUSED (-102) loading 'http://127.0.0.1:47771/' at rejectAndCleanup (node:electron/js2c/browser_init...)`, 0 interactive controls. Window > Server > re-select same target: URL `http://127.0.0.1:47771/`, empty body, 2x `UnhandledPromiseRejectionWarning` on stderr. - Built from this branch: startup body `Could not reach this bb server / The bb server at http://127.0.0.1:47771 did not answer. Check that the machine is awake and reachable, then choose Window ▸ Server to retry this server or switch to This Mac.`; stderr `[desktop] could not load the bb server at http://127.0.0.1:47771: ERR_CONNECTION_REFUSED (-102)`; 0 unhandled rejections. Menu re-select shows the same named error (no blank window). After starting an HTTP server on 47771, menu re-select loads `http://127.0.0.1:47771/` (body `fake bb server up`), so the menu route recovers. CI at verification time: 11 checks pass, 2 skipped (Node Compatibility Smoke, iOS simulator flows), none failing or pending. Residual risks (none blocking): the unit test proves the helper's contract, not the `applyServerTarget()` call site (covered by the live repro only); the error view still has no clickable Retry / Use This Mac control; a half-open host still waits for Chromium's connect timeout before the named error appears (get-bb#1524); the loading view copy still says "Starting local services" for remote targets; the `connect` failure branch was checked by code reading only (no bb Connect server here); verified on Linux/Xvfb, not macOS (no platform branch in the changed code). > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
## What was wrong
`createConnectServerSync().runSync()` in
`apps/desktop/src/connect-server-sync.ts` treated every empty outcome of
`fetchServers()` as `null`: no local runtime and no cached credential,
connect plugin disabled (HTTP 503), connect plugin unpaired (`{ code:
"handler_error", message: "not_paired" }`), server or gate unreachable,
and a refused credential. It logged one line and returned, so `main.ts`
was never told and never rebuilt the menu. `buildMenuServerItems()`
mapped an empty `connectAccountServers` and `createServerMenuItems()` in
`menu.ts` has no empty-state row, so Window > Server looked exactly like
an account with no servers. `fetchConnectAccountServers()` even parsed
`rpcFailureSchema` and discarded the result, although the server says
which case it is on the wire.
Issue: get-bb#1753. Report: https://get-bb.github.io/reports/issues/1753.html
## What changed
- `apps/desktop/src/connect-server-sync.ts`:
`fetchConnectAccountServers()` returns `{ ok: true, result } | { ok:
false, reason }` instead of `T | null`. The reason is derived from the
response: 503 is `plugin-disabled`, `handler_error`/`not_paired` is
`not-paired`, anything else (fetch threw, non-JSON, unknown shape) is
`unavailable`. The gate path returns `no-credential` when the app has
none, `unauthorized` when the gate refuses the credential (still calls
`onUnauthorized`), `unavailable` otherwise. New required callback
`onSkipped(reason)` fires for every skipped sync next to `onServers`.
The log line now names the reason and is written once per failure streak
plus once when the reason changes.
- `apps/desktop/src/main.ts`: stores the reason in
`connectServerSyncSkipReason`, clears it in `onServers`, and calls
`refreshApplicationMenu()` from `onSkipped` because Electron menus are
immutable once built. The menu gets the reason only when
`listMenuConnectServers()` is empty, so a persisted Connect selection
that is still listed gets no note under it.
- `apps/desktop/src/menu.ts`:
`InstallApplicationMenuArgs.connectServersSkipReason:
ConnectServerSyncSkipReason | null` (required, not optional). A non-null
reason renders one disabled row after the server radio items: `No
Connect servers — sign in to bb Connect` / `… Connect not paired on This
Mac` / `… Connect plugin disabled` / `… sign in to bb Connect again` /
`… could not reach bb Connect`.
No wire change between server and host daemon; the desktop to
local-server RPC request is unchanged, only the parse of its failure
body. No CLI or doc surfaces.
Deviation from the reporter's prototype
(`Joesirven/bb@prototype/connect-server-list-skip-reason`, no PR): the
reason is pushed through a callback that rebuilds the menu, instead of a
`getSkipReason()` polled at build time, so the row appears after the
sync that produced it rather than after the next unrelated rebuild.
Plugin-disabled and not-paired are told apart. The reason is set from
the outcome, never before the fetch resolves. No clickable "Sign in to
bb Connect…" item: that is a product decision and the issue asked for
the disabled row as the minimum.
Relation to get-bb#1494 / get-bb#2161: in the reporter's exact startup flow (saved
custom target that no longer answers) `applyServerTarget()` rejects on
`loadURL` before the startup `syncNow()` runs, so the first sync fires
from `menu-will-show` and the row shows from the second open of the
menu. With get-bb#2161 the startup sync is reached and the row is there on the
first open. This PR does not touch that flow.
## How you verified
Tests (`apps/desktop/test/connect-server-sync.test.ts`,
`apps/desktop/test/menu.test.ts`). With `git checkout origin/main --
apps/desktop/src/connect-server-sync.ts apps/desktop/src/menu.ts
apps/desktop/src/main.ts` and the new tests: `Tests 7 failed | 8 passed
(15)`, including
```
× explains an empty Connect list with a disabled row when the sync was skipped
TypeError: Cannot read properties of undefined (reading 'no-credential')
× reports no-credential without calling the gate when the app has none
AssertionError: expected [] to deeply equal [ 'no-credential' ]
× names the reason on network failure, plugin disabled, or not paired
AssertionError: expected null to deeply equal { ok: false, reason: 'unavailable' }
× reports a refused credential so the caller drops it
AssertionError: expected [] to deeply equal [ 'unauthorized' ]
```
On this branch the same files pass (`Tests 15 passed (15)`).
`pnpm exec turbo run typecheck test --filter=@bb/desktop --force` on the
committed tree (`git status --porcelain` empty): `Tasks: 5 successful, 5
total`, `Test Files 34 passed (34)`, `Tests 224 passed (224)`.
Manual: rendered the real `menu.ts` inside Electron 41 under Xvfb with
the report's harness, using the `servers` array `main.ts` produces for
the reporter's state (saved custom target, no local runtime, no
credential). Before: `This Mac | old-host.tailnet.ts.net:38886 |
<separator> | Set Server URL…`. After, with `connectServersSkipReason:
"no-credential"` as `main.ts` now passes it after the skipped sync:
`This Mac | old-host.tailnet.ts.net:38886 | No Connect servers — sign in
to bb Connect | <separator> | Set Server URL…`, the new row greyed out
and not clickable.
The server-side shapes the parser matches were checked against
`apps/server/src/routes/plugins.ts` (503 + string `error` for a plugin
that is not running) and
`apps/server/src/services/plugins/plugin-service.ts` +
`plugins/connect/src/rpc.ts` (`{ code: "handler_error", message:
error.message }` where the handler rethrows `ConnectListError.code`),
and match the report's live probe.
Fixes get-bb#1753
> AGENT GENERATED: by Claude Opus 5
## Independent verification
Checked out `d4d3412ef` (`origin/main` is an ancestor; `mergeable:
MERGEABLE`) in a fresh worktree, read the issue and the report first,
and verified the wire shapes the new parser matches against
`apps/server/src/routes/plugins.ts` (503 + string `error` for
`not-running`), `plugin-service.ts` (`{ code: "handler_error", message
}` with the raw thrown message) and `plugins/connect/src/rpc.ts` (`throw
new Error(error.code)` for `ConnectListError`).
Fail-before / pass-after:
```
git checkout origin/main -- apps/desktop/src/connect-server-sync.ts apps/desktop/src/main.ts apps/desktop/src/menu.ts
cd apps/desktop && pnpm exec vitest run test/connect-server-sync.test.ts test/menu.test.ts
Tests 7 failed | 8 passed (15)
AssertionError: expected null to deeply equal { ok: false, reason: 'unavailable' }
AssertionError: expected [] to deeply equal [ 'no-credential' ]
AssertionError: expected [] to deeply equal [ 'unauthorized' ]
TypeError: Cannot read properties of undefined (reading 'no-credential')
git checkout HEAD -- <same files>
Tests 15 passed (15)
```
`pnpm exec turbo run typecheck test --filter=@bb/desktop --force` on the
clean committed tree: `Tasks: 5 successful, 5 total`, `Test Files 34
passed (34)`, `Tests 224 passed (224)`.
Live wire check (own dev instance, not mocks): ran the branch's
`fetchConnectAccountServers` + `createConnectServerSync` with `tsx`
against the real local server. Connect enabled but unpaired (HTTP 500
`{"code":"handler_error","message":"not_paired"}`) ->
`onSkipped(["not-paired"])`; `bb plugin disable connect` (HTTP 503) ->
`onSkipped(["plugin-disabled"])`; closed port ->
`onSkipped(["unavailable"])`. One log line each.
Repro on the fixed branch: bundled the branch's real
`connect-server-sync.ts` + `menu.ts` into Electron 41 under Xvfb, wired
`onSkipped`/`onServers` to rebuild the application menu the way
`main.ts` does, and fired `onListRequested()` (the `menu-will-show`
trigger, the only one reached in the reporter's flow). Before the sync:
`This Mac | old-host.tailnet.ts.net:38886 | <separator> | Set Server
URL…`. After: `This Mac | old-host.tailnet.ts.net:38886 | No Connect
servers — sign in to bb Connect | <separator> | Set Server URL…`, the
new row greyed (`enabled: false`), 2 menu builds. Same harness with the
live dev server as the local runtime and the plugin disabled: `This Mac
| No Connect servers — Connect plugin disabled | <separator> | Set
Server URL…`. No longer reproduces.
CI: all required checks pass (Checks, Tests x6, Package Smoke ubuntu +
macos-15, version check); iOS/Node-compat smoke skipped by path filter.
Residual risks (none blocking): every desktop user whose bundled server
is not paired to Connect now sees the greyed `Connect not paired on This
Mac` row in Window > Server, which is the behaviour the issue asks for
but is visible beyond the reporter's case; `onSkipped` rebuilds the menu
on every skipped sync (every 10 min and on throttled menu open),
mirroring the existing `onServers` path; after switching targets the
previous reason can show for the sub-second window until the new sync
completes; `main.ts` wiring is verified by reading plus the harness
above, not by a unit test. The startup sync is still not reached when
the saved custom target is dead (get-bb#1494 / get-bb#2161), so in that exact flow
the row appears from the second open of the menu.
> AGENT GENERATED: by Claude Opus 5
Co-authored-by: Claude <[email protected]>
## What was wrong Issue get-bb#1072 (report: https://get-bb.github.io/reports/issues/1072.html) tracks heavy packages that sit in the static import closure of the lazy thread route (`SplitWorkspaceRoute`), so every thread open downloads and parses them before the timeline paints. Since the report was written, main already cut three of the five edges it names: `FilePreview -> @pierre/diffs` and the secondary-panel surfaces (get-bb#1894), `markdown-preview -> rehype-katex` (get-bb#1891), and Handlebars (get-bb#2080). The budget check in CI now ratchets that closure. One edge was still open: `useThreadStorageBrowser.ts` imported `@pierre/trees/react` statically, and `ThreadDetailView` calls that hook on every thread page (it has to, so the tree model survives the Info-tab/file-tab toggle). That put the tree model, its renderer and preact (~250 KB raw / ~62 KB brotli emitted) in the route closure, although only the "Thread storage" browser in the Info tab renders a tree, and the storage file list itself is only fetched once the panel opens. `node scripts/why-eager.mjs --from=views/SplitWorkspaceRoute.tsx node_modules/@pierre/trees` on main: ``` 0. apps/app/src/views/SplitWorkspaceRoute.tsx 1. apps/app/src/views/thread-detail/SplitThreadArea.tsx 2. apps/app/src/views/thread-detail/ThreadDetailView.tsx 3. apps/app/src/components/secondary-panel/useThreadStorageBrowser.ts 4. node_modules/@pierre/trees/dist/react/index.js ``` ## What changed All in `apps/app`. - `src/components/secondary-panel/ThreadStorageFileTree.tsx` (new): the only runtime importer of `@pierre/trees`. Exports `createThreadStorageTreeModel(onSelectionChange)` (the `new FileTree(...)` that `useFileTree` wrapped) and the `ThreadStorageFileTree` render component with the host style that used to live in `ThreadStorageBrowser.tsx`. - `useThreadStorageBrowser.ts`: no static tree import. When a thread has storage files, an effect imports the gate module (through `createRetryingModuleLoader`, the same helper the pierre worker pool uses) and builds the model; `model` is `null` until then, the `resetPaths`/selection sync effects wait for it, and cleanup calls `model.cleanUp()` and ignores a load that resolves after unmount. A failed chunk fetch logs a warning and the next mount retries. - `ThreadStorageBrowser.tsx`: renders the tree through `LazyThreadStorageFileTree` (new wrapper in `lazySecondaryPanelComponents.tsx`) and shows the existing "Loading files..." state while `model` is `null`. - `bundle-budget.json`: `@pierre/trees` added to the `SplitWorkspaceRoute` forbidden list and to `onDemandPackages` (gate: `ThreadStorageFileTree.tsx`, so no chunk outside that gate may reach it); route budget ratcheted to 10% above the new measurement (2,268,430 raw / 605,332 brotli, from 2,533,484 / 671,561). Route closure, `node scripts/check-bundle-budget.mjs`: before 2260.4 KB raw / 599.1 KB brotli, after 2013.9 KB raw / 537.4 KB brotli (-11% raw, -10% brotli). The tree now ships as `ThreadStorageFileTree-*.js` (253,881 B raw / 64,341 B brotli) fetched when the storage browser first has files. Not in this PR: the composer (`PromptBoxInternal -> tiptap/prosemirror`, ~600 KB raw in the shared `workspace-checkout-display` chunk). It is visible on every thread page, `PromptBoxInternal.tsx` owns the `useEditor` instance across 3,600 lines, and a first-focus handoff has to keep draft restore, autofocus, the mention menu and iOS keyboard-on-tap working. get-bb#1894 deliberately left it allowed in the route budget for that reason; it needs its own design. A previous agent's WIP on this branch (a null-rendering "tree model host" component returned from the hook as a ReactNode) was discarded in favour of the imperative model factory above. ## How you verified - New `useThreadStorageBrowser.test.tsx` (real `@pierre/trees` in jsdom, `vi.mock` factories only record when the library is first evaluated): - "loads the tree library only once there are files to show" fails on main's source files with `AssertionError: expected "vi.fn()" to not be called at all, but actually been called 1 times ... "@pierre/trees/react"` and passes on this branch. - "syncs files and selection into the model once it arrives, then destroys it on unmount": the files and `selectedPath` that arrived before the chunk are applied to the model; reconciling selection does not echo through `onSelectPath`; unmount calls `cleanUp()` once. - `node scripts/check-bundle-budget.mjs` with the new `bundle-budget.json` against main's build: `@pierre/trees is in the SplitWorkspaceRoute closure (assets/SplitWorkspaceRoute-9lmZmaba.js). It must load on demand`, exit 1. After rebuilding on this branch: `Bundle budget OK` (including the new on-demand gate check). - `pnpm exec turbo run typecheck --filter=@bb/app --force`, `pnpm exec turbo run lint --filter=@bb/app --force`, `pnpm exec turbo run build --filter=@bb/app`: pass. (The first push of this PR had two TS2322 errors in the new test file: `renderHook(..., { initialProps: { files: undefined } })` inferred the props type as `{ files: undefined }`, so the later `rerender({ files: [] })` calls did not compile and the CI bundle-budget step never ran. The test now declares `initialProps` with an explicit `{ files: readonly WorkspaceFile[] | undefined }` type; the forced typecheck is clean and the fail-before/pass-after result above was re-run with the typed test.) - `pnpm exec turbo run test --filter=@bb/app --force`: all files pass. - Manual, own dev instance + headless Chrome: opened a codex thread with two seeded storage files (`docs/notes.md`, `main.ts`); thread painted; opened the right panel, the "Thread storage" tree rendered `docs` and `main.ts`; clicking `main.ts` opened the file preview tab; switching back to Info showed the same tree (model survived the tab toggle). Fixes get-bb#1072 > AGENT GENERATED: by Claude Opus 5 ## Independent verification Round 2, by an independent verifier on a fresh worktree checked out at `3cf9d8d10` (rebased on `origin/main` `2c0b747a5`; `git merge-base --is-ancestor origin/main HEAD` true, `mergeable: MERGEABLE`). Commands run: - `pnpm install --frozen-lockfile --prefer-offline && pnpm exec turbo run build` (18/18 tasks). - `cd apps/app && node scripts/check-bundle-budget.mjs` → `SplitWorkspaceRoute closure: 2013.9 KB raw / 537.4 KB brotli` (budget 2215.3 / 591.1), `Bundle budget OK.` `node scripts/why-eager.mjs --from=views/SplitWorkspaceRoute.tsx node_modules/@pierre/trees` → `0 eagerly reachable module(s) ... only reachable behind a dynamic import (56 modules)`. The tree is emitted as `ThreadStorageFileTree-BVIqkJpc.js` (253,881 B). - `pnpm exec turbo run typecheck --filter=@bb/app --force` → `Tasks: 3 successful, 3 total`, no `error TS` (the round-1 TS2322 errors in the test file are gone). - `pnpm exec turbo run lint --filter=@bb/app --force` → `Tasks: 1 successful, 1 total`. - `pnpm exec turbo run test --filter=@bb/app --force` → `Test Files 415 passed (415)`, `Tests 3191 passed | 3 skipped`. Fail-before / pass-after (`apps/app`, `pnpm exec vitest run src/components/secondary-panel/useThreadStorageBrowser.test.tsx`): - With `bundle-budget.json`, `ThreadStorageBrowser.tsx`, `lazySecondaryPanelComponents.tsx`, `useThreadStorageBrowser.ts` checked out from `origin/main` and `ThreadStorageFileTree.tsx` removed: `1 failed | 1 passed` — `AssertionError: expected "vi.fn()" to not be called at all, but actually been called 1 times` with `1st vi.fn() call: ["@pierre/trees/react"]` at `useThreadStorageBrowser.test.tsx:45:38`. - Restored to the PR tree: `Tests 2 passed (2)`. Repro on the fixed branch (own dev instance, production `apps/app/dist` served on a private port with `/api` proxied, headless Chrome, `performance.getEntriesByType("resource")` with an enlarged buffer; codex thread `thr_52anzhhcu7` seeded with `docs/notes.md` and `main.ts` in its thread-storage dir): - Right panel closed: thread painted; `SplitWorkspaceRoute-BX4iePCW.js` (267,669 B) and `workspace-checkout-display-BuOjOA0-.js` (1,074,222 B) fetched at ~290 ms; no `/thread-storage/files` request and no `ThreadStorageFileTree` chunk at all. - Right panel open on the Info tab: `/thread-storage/files` at 1087 ms, then `ThreadStorageFileTree-BVIqkJpc.js` at 1207 ms; the "Thread storage" tree rendered `docs` and `main.ts`. CI on `3cf9d8d10`: all checks pass (Checks incl. `check-bundle-budget.mjs`, Tests app-1/2/3, integration, packages, server, Package Smoke ubuntu/macos). Residual risks / notes for the maintainer: - The composer edge (`PromptBoxInternal -> @tiptap/*` / `prosemirror-*`, ~600 KB raw inside `workspace-checkout-display`) is still a static import of the thread route; it is named in the issue title and is the largest remaining item behind "no editor parsing on first paint". `bundle-budget.json` allows it by design (get-bb#1894). If you want get-bb#1072 to keep tracking that edge, change `Fixes get-bb#1072` to `Refs get-bb#1072` or open a follow-up issue before merging; otherwise this PR closes it. - Behavior change is limited to the storage browser: one extra chunk fetch (and the existing "Loading files..." state) the first time a thread shows storage files; a failed chunk fetch leaves that state, logs a `console.warn`, and retries on the next mount. The model is now created per "files non-empty" span instead of once per `ThreadDetailView` mount, so it is rebuilt after the file list empties and refills; `resetPaths` re-applies expansion from the current search state in both designs, so no visible difference. > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
) ## What was wrong `micromark-extension-math` (behind `remark-math` in `MarkdownPreview`) parses `$$` display math like a fenced code block. `$$T_{a}` at line start opens a block whose TeX is stored as fence meta and never rendered, and the block only closes on a `$$` that sits alone on its own line. A trailing `…$$` is ordinary content, so the block runs to the end of the message and `rehype-katex` renders the heading, list, and links after it as one `.katex-error`. bb did no normalization before handing text to the parser. Issue: get-bb#1778. Report: https://get-bb.github.io/reports/issues/1778.html ## What changed - `apps/app/src/components/ui/markdown-math-fences.ts` (new): `normalizeMathFences` rewrites LaTeX-style display spans into the canonical `$$\n…\n$$` shape before parsing. It handles an opener with glued TeX (`$$x`), a trailing closer (`y$$`), and both together, including the `$$x\n$$` shape whose first line used to vanish as meta. Fenced code blocks are skipped, a span with no closing delimiter is left alone (same unclosed-fence behavior as before, which also covers a block still streaming in), and canonical blocks and inline `$$x$$` come out unchanged. - `apps/app/src/components/ui/markdown-preview.tsx`: apply the normalizer to the body after the frontmatter split, so parse positions still line up with the string react-markdown receives. - `apps/app/src/components/ui/markdown-prompt-blockquote-boundaries.ts`: export the existing code-fence helpers so the normalizer reuses them. Not covered: math blocks inside blockquotes or list items keep their container prefix and are not normalized (status quo). The mobile renderer (`apps/mobile/src/markdown/parse.ts`) has the same parser semantics but renders math as source and slices by source offsets, so it is left for a separate change. ## How you verified - `apps/app/src/components/ui/markdown-preview.test.tsx`: new case renders the issue body through `MarkdownPreview`. On origin/main it fails with `AssertionError: expected null not to be null` at `expect(container.querySelector(".katex-display")).not.toBeNull()` (the DOM contains a single `.katex-error` holding the heading, list, and link). With the fix it passes: one `.katex-display` whose annotation contains both TeX lines, no `.katex-error`, `h2`, two `li`, and the link. - `apps/app/src/components/ui/markdown-math-fences.test.ts`: shapes A/B/C, two blocks in one document, unchanged canonical/inline/prose input, unclosed span, fenced and indented code, CRLF. - `pnpm exec turbo run typecheck --filter=@bb/app`: `Tasks: 3 successful, 3 total` - `pnpm exec turbo run test --filter=@bb/app`: `Tasks: 4 successful, 4 total` (410 files, 3166 tests passed) - Manual: spawned a codex thread on a dev instance of this branch with the issue body as the prompt. The user bubble renders the KaTeX display formula (both lines), the `## Content after the formula` heading, two list items, and the link; `document.querySelectorAll(".katex-error").length === 0`. Fixes get-bb#1778 > AGENT GENERATED: by Claude Opus 5 ## Independent verification Verified at head `6df9819a9` (origin/main is an ancestor; `mergeable: MERGEABLE`). Commands: - `git checkout origin/main -- apps/app/src/components/ui/markdown-preview.tsx apps/app/src/components/ui/markdown-prompt-blockquote-boundaries.ts`, moved `markdown-math-fences.ts` aside, then `pnpm exec vitest run src/components/ui/markdown-preview.test.tsx -t 1778 src/components/ui/markdown-math-fences.test.ts` in `apps/app`. Fail-before: `FAIL markdown-preview.test.tsx > closes a display math block whose $$ delimiters are glued to the TeX (get-bb#1778)` — `AssertionError: expected null not to be null` at `expect(container.querySelector(".katex-display")).not.toBeNull()`; DOM dump shows one `span.katex-error` containing `## Content after the formula` and the list/link. `markdown-math-fences.test.ts` fails to import the module. - Restored the PR files and re-ran both test files: `Test Files 2 passed (2)`, `Tests 27 passed (27)`. - `pnpm exec turbo run typecheck --filter=@bb/app --force` -> `Tasks: 3 successful, 3 total`. - `pnpm exec turbo run test --filter=@bb/app --force` -> `Tasks: 4 successful, 4 total` (`Test Files 410 passed`, `Tests 3166 passed | 3 skipped`). - Ad-hoc parse probe (not committed): ran `remark-parse + remark-gfm + remark-math` on 19 inputs before/after `normalizeMathFences`. Canonical blocks, 2/3-space-indented blocks inside ordered lists, inline `$$x$$` (line start, mid-paragraph, table cell), `$5 to $10`, `\$\$` escapes, `~~~`/backtick fences, blockquote-prefixed spans, and prose ending in `$$` all parse identically. Only the glued shapes A/B/C from the report change, each to a closed math node with the meta line restored as TeX. - Live repro on my own dev instance (PR branch): spawned a codex thread whose prompt is the issue body. User bubble DOM: `katexDisplay=1`, `katexError=0`, annotation contains both TeX lines, `h2` "Content after the formula", 2 `li`, link "This should remain a link". Before the fix the same DOM is a single `.katex-error` (report screenshot). CI on head: all required checks pass (Checks, Tests app-1/2/3, packages, server, integration, Package Smoke ubuntu/macos, version check). Residual risks (non-blocking): spans with a container prefix (`> $$x` / `- $$x`) are not normalized and keep the old behavior; `apps/mobile/src/markdown/parse.ts` shares the parser semantics and still swallows the suffix into one source-rendered math block; a bare `$$` opener followed by a `$$x$$` line now closes at that line (invalid TeX either way). > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
…bb#2163) ## What was wrong Two of the three surfaces in get-bb#1615 still mounted every row of a large array into a small scroll box. A scroll box clips painting, not DOM, so WebKit still styled, laid out and kept every row in memory. `CsvFilePreview` mapped its whole 500x100 parse window into `<tr><td><span>` (50,000 `td`, ~101k elements in the table, a 2-8 s main-thread block and +33 MB heap, per the [report](https://get-bb.github.io/reports/issues/1615.html)). `RemotePathBrowser` mapped every `readdir` entry into an `<li>` inside its `h-56` box (5,000 rows / 20,000 elements for a 5,000-file folder) because the daemon listing has no cap. The third surface, the prompt-banner `WorkspaceChangesList`, was already fixed on main by get-bb#1783 (200-row cap and lazy mount of collapsed bodies). ## What changed - `apps/app/src/components/secondary-panel/FilePreview.tsx`: the CSV table mounts only the body rows near the viewport with `useVirtualizer` (the pattern `DiffFilesPanel` already uses) on the existing scroll container. Spacer `<tr>`s above and below the mounted window keep the table's natural height, so the scrollbar, the sticky header row and the sticky row-number gutter behave exactly as before. Row height is a fixed 29px estimate (`leading-5` + `py-1` + border) corrected by `measureElement`. Columns are not virtualized; a mounted row still has up to 101 cells, so the bound is roughly 35-45 rows x 101 cells instead of 500 x 101. - `apps/app/src/components/dialogs/RemotePathBrowser.tsx`: the entry list mounts only the rows near the viewport, positioned absolutely inside a `ul` sized to the virtual total. The "new folder" form stays inside the same scroll box above the list; the 10-row overscan covers its height so no `scrollMargin` measurement is needed (documented in the code). - No wire, CLI or protocol change. The daemon still returns the full directory listing and full CSV file; this PR bounds the DOM, which is what the issue and report measured. Capping the listing at the daemon (the report's optional step) would change the `host.browse_directory` result shape and need a `HOST_DAEMON_PROTOCOL_VERSION` bump, so it is left out of this focused change. ## How you verified New tests (jsdom, with `offsetHeight` mocked so the virtualizer has a viewport): - `FilePreview.test.tsx` > "mounts only the CSV rows near the viewport, not the whole 500x100 window": a 600x120 CSV mounts fewer than 6,000 `td` and 14-59 rows, the first row is visible and the last is not; scrolling the box to the bottom mounts `r499c0`, unmounts `r0c0`, and the truncation note still reads "Showing the first 500 rows and 100 columns." - `RemotePathBrowser.createFolder.test.tsx` > "mounts only the entries near the viewport for a huge directory": a 5,000-entry listing mounts 8-59 `li`; scrolling to the bottom mounts `file_04999` and unmounts `file_00000`. Fail before (source files checked out from `origin/main`, tests from this branch): ``` × mounts only the entries near the viewport for a huge directory AssertionError: expected 5000 to be less than 60 × mounts only the CSV rows near the viewport, not the whole 500x100 window AssertionError: expected 50000 to be less than 6000 ``` Pass after, from the committed tree (`git status --porcelain` empty): ``` pnpm exec turbo run typecheck --filter=@bb/app -> Tasks: 3 successful, 3 total pnpm exec turbo run test --filter=@bb/app --force -> Tasks: 4 successful, 4 total Test Files 409 passed (409), Tests 3158 passed | 3 skipped (3161) ``` Manual check on my own dev instance (headless Chromium 1400x900, fixture from the report: 600x120 `data/big.csv` plus 5,000 untracked files): - CSV preview (before, from the report at the same viewport: `td: 50000`, `tableNodes: 101306`, 3.2 s to table-in-DOM): after, `td: 3401`, `tableNodes: 7176`, 34 body rows, 597 ms from Enter to table-in-DOM including the file fetch. Scroll size unchanged at 28,848x14,529 px. Scrolled to the bottom: rows 467-499 mounted, last cell `r499c0`, sticky header still at the top of the box. Scrolled to (6000, 5000): rows 198-240 mounted, sticky `#` gutter still at the left edge. - Folder browser on the 5,000-file directory (before: 5,000 `li`, 20,001 nodes in the box): after, 19 `li`, 77 nodes in the box, 108 ms; scrolled to the bottom shows `file_04982`-`file_04999`. Fixes get-bb#1615 > AGENT GENERATED: by Claude Opus 5 ## Independent verification Checked out `bb/fix-1615-bounded-lists` at `bf3a653a2` (one commit over `origin/main`, which is an ancestor; GitHub reports MERGEABLE/CLEAN) in a separate worktree with its own dev instance. Commands: ``` git fetch origin main && git fetch origin bb/fix-1615-bounded-lists && git checkout -b verify-1615-r1 FETCH_HEAD git checkout origin/main -- apps/app/src/components/secondary-panel/FilePreview.tsx apps/app/src/components/dialogs/RemotePathBrowser.tsx (cd apps/app && pnpm exec vitest run --config vitest.config.ts src/components/secondary-panel/FilePreview.test.tsx src/components/dialogs/RemotePathBrowser.createFolder.test.tsx) git checkout HEAD -- <same two files> # then the same vitest command again pnpm exec turbo run typecheck --filter=@bb/app pnpm exec turbo run test --filter=@bb/app --force ``` Fail before (PR tests against `origin/main` sources): ``` × mounts only the entries near the viewport for a huge directory AssertionError: expected 5000 to be less than 60 × mounts only the CSV rows near the viewport, not the whole 500x100 window AssertionError: expected 50000 to be less than 6000 Test Files 2 failed (2) Tests 2 failed | 26 passed (28) ``` Pass after (PR sources restored, `git status --porcelain` empty): `Test Files 2 passed (2), Tests 28 passed (28)`. `turbo typecheck --filter=@bb/app`: `Tasks: 3 successful, 3 total`. `turbo test --filter=@bb/app --force`: `Tasks: 4 successful, 4 total`, `Test Files 409 passed (409)`. Repro on the fixed branch (own dev instance, headless Chromium 1400x900 via doobie, report fixture: 600x120 `data/big.csv` committed plus 5,000 untracked files, one "Reply only with ok." codex turn to provision the workspace): - CSV preview, after pressing Enter in the secondary-panel file search: `td: 3401`, `th: 135`, `tableNodes: 7176`, 34 body rows (indexes 0-33), 995 ms Enter-to-table; scroll box 505x742, scroll size unchanged at 28,848x14,529, note "Showing the first 500 rows and 100 columns." Scrolled to the bottom: rows 467-499 mounted, last cell `r499c0`, sticky header still at the top of the box. Scrolled to (6000, 5000): rows 164-206 mounted, sticky row gutter still at the left edge. The report measured `td: 50000`, `tableNodes: 101306`, 3.2 s on main. No longer reproduces. - Add-project folder browser on the 5,000-file directory: 19 `li`, 77 nodes in the 224 px box (report on main: 5,000 `li`, 20,001 nodes), `ul` height 139,981 px. Scrolled to the bottom: 18 `li` mounted, `file_04991`-`file_04999` visible. Scrolled to the middle: `file_02500`-`file_02508` visible with the viewport fully covered. With the "New folder" form open above the list, top and bottom still show `file_00000` and `file_04999` with no gap. No longer reproduces. - Third surface in the issue (prompt-banner `WorkspaceChangesList`) confirmed already bounded on `origin/main`: `WORKSPACE_CHANGES_LIST_MAX_ROWS = 200` and `AnimatedBody` mounts children only after the first expand. The banner on my instance exposes a single "Changed files: Untracked, 5000 files" button while collapsed. CI at verification time: all required checks pass (app-1/2/3, server, packages, integration tests; Package Smoke on ubuntu and macos-15; version check). iOS simulator flows and Node compatibility smoke skipped by path filter. Residual risks (none blocking): - `RemotePathBrowser` does not pass `scrollMargin`, so the virtualizer treats the list as starting at scroll offset 0 while the box's `py-1` padding and the optional "New folder" form (28 px + 4 px margin, plus an error line) sit above it. The 10-row (280 px) overscan absorbs that offset today; a taller element above the list would need `scrollMargin`. - CSV columns are not virtualized: each mounted row still carries up to 101 cells, so a 100-column file mounts ~3.4k `td` instead of 50k. Text selection for "Add to chat" spans only mounted rows, the same limitation the virtualized code view already has. - The daemon still returns unbounded directory listings and the status route still returns every changed file on the wire; capping those needs a protocol bump and is out of scope here. > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
## What was wrong `InlineVisDirective` in `plugins/inline-vis/app.tsx` starts in `loading` and stays there until the `prepareHtmlPreview` RPC resolves. The loading branch rendered a bare one-line "Loading visualization…" box with no height (37px in the app). The ready branch renders a header plus an iframe whose inline height comes from the directive's `height` attribute (default 224px, min 120px). The card therefore grew by hundreds of pixels in one React commit (measured 37px -> 515px for `height="480"`). The thread timeline is bottom-anchored, so that growth scrolled every earlier message upward on every mount of the directive, not only on cold loads. The preview height is known synchronously from the attributes, so the final geometry was knowable in the loading state; it just was not used. Issue: get-bb#1837. Report: https://get-bb.github.io/reports/issues/1837.html ## What changed - `plugins/inline-vis/app.tsx`: extracted the card chrome (outer card + header row) into a small `PreviewCard` so the loading and ready states cannot drift. The loading branch now renders that card with a `size-5` spacer where the open-in-sidebar button goes, and a `role="status"` / `aria-busy` / `aria-label="Loading visualization <file>"` container with `style.height = previewHeight` holding a plain `<Skeleton className="size-full" />` from `@bb/shared-ui/skeleton`. The ready branch is unchanged except for using `PreviewCard`. - `plugins/inline-vis/app.test.tsx`: new test pins the behaviour (loader height equals the iframe height, same card/header classes, status role and label); the existing sandbox test now finds the loader by role instead of the removed text. - Error, missing-file, and invalid-height branches still render compact alerts; loading -> error shrinks the card, which is acceptable for an error path and out of scope here. - No server, wire, CLI, or doc changes. App-side plugin UI only. Relation to get-bb#1555: that PR also reserves the height, but it duplicates the header markup, uses `.animate-shine-icon` inside an `aria-hidden` grid, which `theme.css` pauses since get-bb#1880 (so its advertised shimmer is frozen in the app), and its ~100-line test pins data attributes and class names rather than behaviour. It also predates get-bb#2140, which removed the `PrepareHtmlPreviewRpcResult` type it touches. This PR is the ~20-line version the report recommends: shared header, fixed-height `Skeleton` with its built-in pulse (verified running in the app), and a behaviour-only test. ## How you verified - New test fails on `origin/main` `app.tsx` (`git checkout origin/main -- plugins/inline-vis/app.tsx`, then `pnpm exec vitest run app.test.tsx` in `plugins/inline-vis`): ``` × reserves the preview height while loading so the timeline does not jump AssertionError: expected '' to be '480px' // Object.is equality ``` - On this branch, from the committed tree (`git status --porcelain` empty): `pnpm exec turbo run typecheck test --filter=bb-plugin-inline-vis --force` -> `Tasks: 6 successful, 6 total`, `Tests 17 passed (17)`. - Manual repro in a dev instance (`scripts/bb-dev-app current`, claude-code turn that replied with `::inline-vis{file="demo.html" height="480"}`), holding the `prepareHtmlPreview` request in headless Chrome and measuring the card before and after release: - main `app.tsx`: loading `boxHeight: 37` -> ready `boxHeight: 515`, `deltaHeight: 478`; the user message above moved from `top: 75` to `top: 17`. - this branch: loading `boxHeight: 515` -> ready `boxHeight: 515`, `deltaHeight: 0`; user message stays at `top: 17`; skeleton `animationName: pulse`, `playState: running`. Fixes get-bb#1837 > AGENT GENERATED: by Claude Opus 5 ## Independent verification Checked out `140e23e7f` (`git fetch origin bb/fix-1837-inline-vis-layout-jump && git checkout -b verify-1837-r1 FETCH_HEAD`); `origin/main` is an ancestor, GitHub reports `MERGEABLE`. Diff: `plugins/inline-vis/app.tsx` + `plugins/inline-vis/app.test.tsx` only, +117/-17. Fail-before: `git checkout origin/main -- plugins/inline-vis/app.tsx`, then `pnpm exec vitest run app.test.tsx` in `plugins/inline-vis`: ``` FAIL app.test.tsx > InlineVisDirective > reserves the preview height while loading so the timeline does not jump AssertionError: expected '' to be '480px' // Object.is equality Tests 2 failed | 5 passed (7) ``` (The second failure is the existing sandbox test, which now looks the loader up by `role="status"` name.) Pass-after: restored `app.tsx` from the PR head (`git status --porcelain` empty), `pnpm exec vitest run app.test.tsx` -> `Tests 7 passed (7)`. `pnpm exec turbo run typecheck test --filter=bb-plugin-inline-vis --force` -> `Tasks: 6 successful, 6 total`, `Tests 17 passed (17)`. Repro on the fixed branch: own dev instance (`scripts/bb-dev-app current`, app :13647 / server :21647), scratch project with `demo.html`, real claude-code turn replying `::inline-vis{file="demo.html" height="480"}`. Headless Chrome via doobie held the `prepareHtmlPreview` RPC, measured the card, released it, measured again: ``` before: state=loading cardHeight=515 innerHeight=480 userMsgTop=17 role=status label="Loading visualization demo.html" skeleton animation=pulse playState=running after: state=ready cardHeight=515 innerHeight=480 userMsgTop=17 deltaHeight: 0, userMsgShift: 0 ``` The report measured 37px -> 515px (delta 478) for the same scenario on main. The issue no longer reproduces. CI: all required checks green on `140e23e7f` (Checks, Tests app-1/2/3, integration, server, packages, Package Smoke ubuntu/macos, version check). Residual risks: error / missing-file / invalid-height branches still render compact alerts, so loading -> error shrinks the card (error path, out of scope). The loader no longer shows visible "Loading visualization" text; it is conveyed through `role="status"` + `aria-label`. No wire, CLI, or plugin-API surface changed, so no protocol bump or doc update is required. > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
## What was wrong The app set no `user-select` policy, so every element kept the browser default (`auto`). Sidebar labels, the page header, the composer toolbar and footer, and the visually hidden "Toggle Sidebar" label all joined mouse-drag selections and Select All alongside the conversation. On main, clicking empty sidebar space and pressing Ctrl-A selects `New thread … Extensions … Automations … Settings … Report a bug … Project: qa … Toggle Sidebar`, and a drag across the sidebar highlights its labels. Issue: get-bb#1440. Report: https://get-bb.github.io/reports/issues/1440.html ## What changed App chrome regions opt out of selection with `select-none`; content keeps the browser default. - `apps/app/src/components/ui/sidebar.tsx`: both sidebar panels (desktop and compact drawer) and `SidebarTrigger`. - `apps/app/src/components/layout/AppPageHeader.tsx`: the `<header>` element. - `apps/app/src/components/secondary-panel/ThreadSecondaryPanel.tsx`: the right panel's top chrome stack (tab toolbar and diff toolbar). - `apps/app/src/components/promptbox/PromptBoxInternal.tsx`, `FollowUpPromptBox.tsx`, `NewThreadPromptBox.tsx`: the composer action row and the footer strips below the prompt box. The editor and the banners above it are untouched. - `apps/app/src/app.css`: `.select-none :where(input, textarea, [contenteditable])` gets `user-select: text`. `auto` resolves from the parent, and WebKit carries a parent's `none` into editable controls; this keeps the sidebar thread search and the inline thread-title rename selectable. Why opt out of chrome instead of `body { user-select: none }` plus content opt-ins (the approach in get-bb#1428): in Blink a drag that starts on a `user-select: none` element never begins a selection, so marking only the chrome leaves gutter drags, multi-message drags, diagnostics (Info panel, settings, toasts, dialogs) and plugin panels exactly as they behave today. A shell-wide `none` needs every content surface to opt in, and each missed surface becomes uncopyable text. The report measured two such regressions in get-bb#1428 (gutter drag selects nothing; Ctrl-A highlights the thread but Ctrl-C copies nothing); get-bb#1428 has since grown to 115 files including an Electron menu rewrite and a renderer Select All controller, and conflicts with main. This PR covers the issue's title and its first three acceptance criteria with a class on each chrome root. Not changed: Select All is not scoped to the last-touched pane (a later criterion added to the issue by get-bb#1428); Ctrl-A from the sidebar still selects the conversation text, without any chrome. Timeline status rows ("Worked for 7s", "Working...") remain selectable as part of the conversation. No wire, CLI or plugin API change. ## How you verified New tests, run against origin/main sources (`git checkout origin/main -- <7 source files>`) fail, and pass on this branch: - `apps/app/src/components/layout/app-chrome-selection.test.tsx` (4 tests): sidebar panel, drawer, trigger, header, right-panel chrome carry `select-none`; app.css restores selection on editable controls. Before: `AssertionError: expected false to be true`, `expected 'shrink-0 bg-sidebar' to contain 'select-none'`. - `FollowUpPromptBox.test.tsx` "keeps the status footer out of text selection" and `PromptBoxInternal.test.tsx` "keeps the action row out of text selection while the editor stays selectable". Before: `AssertionError: expected false to be true`. Commands on the committed tree (`git status --porcelain` empty): - `pnpm exec turbo run typecheck --filter=@bb/app` → `Tasks: 3 successful, 3 total` - `pnpm exec turbo run test --filter=@bb/app` → `Tasks: 4 successful, 4 total` (410 test files passed) Manual check in headless Chromium 145 (Puppeteer via doobie) against my dev instance, thread with one user message and one reply, same gestures as the report's probes: | gesture | main | this branch | | --- | --- | --- | | click empty sidebar, Ctrl-A | 308 chars incl. `New thread … Toggle Sidebar` | 128 chars, conversation only | | drag from empty sidebar over labels | `Settings\nRemote access\nReport a bug…` | nothing selected | | drag across composer footer (`Project: qa …`) | `Project:\nqa\nEnvironment:…` | nothing selected | | drag across header title | `Selection QA` | nothing selected | | drag from gutter 200 px left of a message into it | `Run the shell command: echo hello-144` | same | | click message, Ctrl-A, Ctrl-C, paste into editor | whole page incl. chrome | conversation text only (128 chars) | | Ctrl-A inside the editor with a draft | draft only | draft only | Computed `user-select`: body `auto`, sidebar label `none`, message `auto`, Info panel directory value `auto`. Before/after screenshots of Ctrl-A from the sidebar are attached to the batch notes. Not verified in Electron or WebKit (no macOS/iOS here); the WebKit restore rule follows the documented `user-select` inheritance behavior. Fixes get-bb#1440 > AGENT GENERATED: by Claude Opus 5 ## Independent verification Verified by a second agent on a fresh worktree (`git fetch origin bb/fix-1440-chrome-user-select && git checkout -b verify-1440-r1 FETCH_HEAD`, head `b728ba309`, `origin/main` is an ancestor, GitHub reports `MERGEABLE`). Commands run: - `pnpm install --frozen-lockfile --prefer-offline && pnpm exec turbo run build` → `Tasks: 18 successful, 18 total` - Fail-before: `git checkout origin/main -- apps/app/src/app.css apps/app/src/components/layout/AppPageHeader.tsx apps/app/src/components/promptbox/{FollowUpPromptBox,NewThreadPromptBox,PromptBoxInternal}.tsx apps/app/src/components/secondary-panel/ThreadSecondaryPanel.tsx apps/app/src/components/ui/sidebar.tsx`, then `pnpm exec vitest run src/components/layout/app-chrome-selection.test.tsx src/components/promptbox/FollowUpPromptBox.test.tsx src/components/promptbox/PromptBoxInternal.test.tsx` in `apps/app` → `Tests 6 failed | 130 passed (136)`; failing assertions: `AssertionError: expected false to be true` (sidebar panel/trigger/header, compact drawer, footer, action row), `expected 'shrink-0 bg-sidebar' to contain 'select-none'`, and the app.css rule match being `undefined`. - Pass-after: `git checkout HEAD -- <same files>` and the same vitest command → `Tests 136 passed (136)`. - `pnpm exec turbo run typecheck --filter=@bb/app` → `Tasks: 3 successful, 3 total` - `pnpm exec turbo run test --filter=@bb/app --force` → `Tasks: 4 successful, 4 total` (410 test files, 3162 tests passed, 3 skipped) - Built CSS check: `apps/app/dist/assets/index-*.css` contains `.select-none :where(input,textarea,[contenteditable]:not([contenteditable=false])){-webkit-user-select:text;user-select:text}`, so the WebKit prefix is emitted. Repro on the fixed branch (headless Chromium 145 via doobie, own dev instance, codex thread with one message + reply), same gestures run against origin/main sources and this branch by swapping the 7 source files under Vite HMR: | gesture | origin/main sources | this branch | | --- | --- | --- | | click empty sidebar, Ctrl-A | 300 chars incl. `New thread … Settings … Report a bug … Project: qa … Toggle Sidebar` | 128 chars, conversation only | | drag from empty sidebar up over labels | 221 chars (`Settings\nRemote access\nReport a bug…`) | nothing (`type: None`) | | drag across composer footer | `Project:\nqa\nEnvironment:\nWorking locally\n\nmain\n` | nothing | | drag from gutter 150 px left of a message into it | `Run the shell command: echo hello-1440. Then reply` | same text | | click message, Ctrl-A, Ctrl-C, paste into editor | whole page incl. chrome (308 chars) | conversation only (128 chars) | | type a draft in the editor, Ctrl-A | — | `draft xyz 1440` only, anchor/focus inside the editor | | sidebar thread search input (computed `user-select`) | — | `text`; Ctrl-A and mouse drag select inside the input | | header inline title rename input (computed `user-select`) | — | `text` under a `none` header; Ctrl-A, drag (`Selec`) and Shift+End all work | Computed `user-select` on this branch: body `auto`, sidebar panel `none`, header `none`, composer footer `none`, action row `none`, editor `auto`. CI: all checks green on `b728ba309` (Checks, Tests app-1/2/3, integration, packages, server, Package Smoke ubuntu/macos, version checks). Residual risks: the thread title in the page header is now copyable only through the double-click rename input, not by dragging the label; timeline status rows ("Worked for 7s", "Working...") and dialog/settings labels keep the browser default; Select All is not scoped to the interacted pane and the Electron Edit menu is untouched (later acceptance criteria on the issue, out of scope here); Electron and WebKit/iOS were not exercised (Linux host), the WebKit path relies on the prefixed rule in the built CSS. > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
…#2173) ## What was wrong Issue get-bb#1603 reports the web app on an iPhone 8 Plus (iOS 16.x, so Safari 16.x) loading and then hiding its UI, including the Remote access entry. The reproduction report (https://get-bb.github.io/reports/issues/1603.html) found it is not CSS. Shiki's JavaScript regex engine, `oniguruma-to-es` (pulled in through `@pierre/diffs`), detects RegExp `v`-flag and modifier support at module top level with `try { new RegExp("[[]]", "v") } catch { return false } return true`. Rolldown and the oxc minifier treat `new RegExp(<literal>, <literal>)` as pure, delete it from the `try` block and fold the probe to `true`. The very next statement, `envFlags.unicodeSets && RegExp("[[^a]]", "v").test("a")`, then runs unguarded and throws `Invalid flags supplied to RegExp constructor.` on every engine without the `v` flag (Safari/iOS 16.4-16.6; Vite's default build target is `safari16.4`). The library degrades gracefully on its own; the bundler removes the guard. Neither `treeshake: false` nor `moduleSideEffects: "no-treeshake"` helps, because the minifier applies the same purity model. On current `main` the chunk that carries this code (`dist-*.js`) is no longer in the home route's static closure, so the whole app no longer blanks as in the report. It is still imported statically by `plugin-frontend-*.js`, `BbSourceCode`, `TimelineFileDiffBlock`, `FileDiff`, `File` and the diff worker pool. On a Safari 16.x engine the plugin runtime therefore fails to load (`plugin runtime load failed: Invalid flags supplied to RegExp constructor.`), so plugin-contributed UI such as Remote access and Automations never renders, and any view that renders a diff or source code trips the app error boundary. ## What changed - `patches/[email protected]`: the three probes in `dist/esm/index.js` and `dist/cjs/index.js` construct the RegExp through `Reflect.construct(RegExp, [...])`, which the bundler cannot prove pure. Verified shapes: `new RegExp(...)` and `RegExp(...)` get folded; `Reflect.construct(RegExp, ...)` and `new globalThis.RegExp(...)` survive. - `patches/@[email protected]`: `dist/worker/worker-portable.js` (loaded by `src/lib/diff-worker-pool.ts` as a module worker) inlines its own copy of `oniguruma-to-es`, so the package patch alone does not reach it. Same three-line rewrite. - `package.json` registers the two patches under `pnpm.patchedDependencies`; `pnpm-lock.yaml` picks up the patch hashes. - `apps/app/package.json` adds `oniguruma-to-es` as a devDependency so the new test can bundle it directly. - `apps/app/src/regex-engine-feature-probes.test.ts`: bundles `oniguruma-to-es` and `@pierre/diffs/worker/worker-portable.js` with the app's Vite/Rolldown build (minified) and evaluates the output in a `vm` context whose `RegExp` rejects the `v` flag and pattern modifiers like Safari 16. Asserts that the engine loads and compiles a pattern without the `v` flag, and that the worker reaches its `message` listener registration. Deviation from the report's proposal: the report also suggests patching `[email protected]`. The app reaches that package only through `regex/internals` (`atomic`, `possessive`, `RegExpSubclass`), which does not include its probes, so patching it would change nothing in the built output; I left it alone. Cause 1 from the report (regex lookbehind literals in `@pierre/diffs` and `mdast-util-gfm-autolink-literal`, Safari 16.0-16.3) is below Vite's declared `safari16.4` floor and is out of scope here; the app still shows the error card on a Safari 16.0-era engine. No wire changes; no CLI or doc surfaces. ## How you verified Test fails before (patches removed from `package.json`, `pnpm install`), both cases at module top level of the bundle: ``` × oniguruma-to-es loads and picks a v-less target on Safari 16 × the @pierre/diffs portable worker evaluates on Safari 16 SyntaxError: Invalid flags supplied to RegExp constructor. ❯ SafariSixteenRegExp src/regex-engine-feature-probes.test.ts:65:13 ❯ bundle.cjs:48:4094 ``` Test passes after (`pnpm exec turbo run test --filter=@bb/app -- src/regex-engine-feature-probes.test.ts`): `Tests 2 passed (2)`. Built output: `pnpm exec turbo run build --filter=bb-app --force`, then `grep -l "unicodeSets:!0" packages/bb-app/app/dist/assets/*.js` finds nothing (before: `dist-DdvSMfIo.js` and `worker-portable-DaFcwpf8.js`); both chunks now contain the `try{Reflect.construct(RegExp,[...])}catch{return!1}return!0` probes. Browser check with the report's harness (Playwright webkit-1837, iPhone 8 Plus emulation, init script that makes the `RegExp` constructor reject flag `v` like Safari 16.4-16.6) against the packaged app on isolated ports: - before: sidebar shows `New thread, Extensions, Threads, Settings`; console: `plugin runtime load failed: Invalid flags supplied to RegExp constructor.`; `has Remote access: false, has Automations: false` - after: sidebar shows `New thread, Extensions, Automations, Threads, Settings, Remote access`; no errors; `has Remote access: true, has Automations: true` Turbo, run from the committed tree after the final commit: - `pnpm exec turbo run typecheck lint --filter=@bb/app`: `Tasks: 4 successful, 4 total` - `pnpm exec turbo run test --filter=@bb/app --force`: `Tasks: 4 successful, 4 total` (`Test Files 410 passed (410)`, `Tests 3158 passed | 3 skipped (3161)`). One earlier full run had an unrelated flake in `TimelineRowDetails.output-preview.test.tsx` that passed on rerun. Only `@bb/app` depends on the patched packages. Fixes get-bb#1603 > AGENT GENERATED: by Claude Opus 5 ## Independent verification Checked out `bb/fix-1603-mobile-remote-access` (c3ed8ad, one commit on top of current `origin/main`, no conflicts) in a separate worktree; `pnpm install --frozen-lockfile --prefer-offline` applied both patches (`node_modules/.pnpm/[email protected]_patch_hash=...`, `@[email protected]_patch_hash=...`). Root cause: agrees with the report. `regex/internals` (`atomic.js`, `subclass.js`, `utils-internals.js`) never imports `regex/src/utils.js`, where that package's probes live, so leaving `regex` unpatched is correct. `@pierre/diffs` inlines the probe only in `dist/worker/worker-portable.js`. Only `apps/app` consumes either package in the workspace. Fail-before / pass-after (same test file, `pnpm exec vitest run src/regex-engine-feature-probes.test.ts` in `apps/app`): - before (root `package.json` + `pnpm-lock.yaml` from `origin/main`, `pnpm install`): both tests fail at bundle top level with `SyntaxError: Invalid flags supplied to RegExp constructor.` at `bundle.cjs:48:4094` and `bundle.cjs:59:4114`. - after (PR files restored, frozen install): `Tests 2 passed (2)`. `pnpm exec turbo run typecheck lint test --filter=@bb/app --force`: `Tasks: 6 successful, 6 total`; `Test Files 410 passed (410)`, `Tests 3158 passed | 3 skipped (3161)`; lint 0 errors (155 pre-existing warnings, none in the new file). Built output: on the PR branch `grep -l "unicodeSets:!0" packages/bb-app/app/dist/assets/*.js` finds nothing and a scan for `RegExp(<literal>, "v")` calls finds only the two `unicodeSets && RegExp("[[^a]]","v")` statements, now behind a real runtime probe. The unpatched rebuild still contains the folded probe in `dist-DdvSMfIo.js` and `worker-portable-DaFcwpf8.js`. Browser repro (report's harness: Playwright 1.33.0 webkit-1837, iPhone 8 Plus emulation, init script making `RegExp` reject flag `v` like Safari 16.4-16.6) against the packaged app on isolated ports 45231/45232 with a scratch data dir: - unpatched build: `plugin runtime load failed: Invalid flags supplied to RegExp constructor.`; sidebar `New thread Extensions Threads Settings`; `hasRemoteAccess: false, hasAutomations: false`. - PR build: no errors or warnings beyond WebKit preload notices; sidebar `New thread Extensions Automations Threads Settings Remote access`; `hasRemoteAccess: true, hasAutomations: true`, error boundary not shown. CI: all checks green (Checks, app-1/2/3, integration, packages, server, both Package Smoke jobs). Residual risks: the patches are pinned to `[email protected]` and `@pierre/[email protected]`; a version bump drops them (pnpm errors on the stale `patchedDependencies` entry, and the new test fails on the rebuilt output). Safari 16.0-16.3 still fails on regex lookbehind literals, below Vite's `safari16.4` target. The test emulates Safari 16 with a `vm` RegExp wrapper rather than a real WebKit build. > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
## What was wrong Fenced code blocks in chat are highlighted client-side by sugar-high 1.2.1, whose core lexer only knows JavaScript. `apps/app/src/components/ui/markdown-code-highlight.ts` mapped only rust/python/go/c/java/css fences to v1 presets. Every other fence language (`sh`, `bash`, `zsh`, `console`, `yaml`, `toml`, `sql`, `diff`, `json`, ...) got `preset = undefined` and ran through the JavaScript lexer. In a ```` ```sh ```` block, `# install the plugin` became a `sign` plus three `identifier`s painted in the full foreground color, and `./plugins/monokai` became a green `string` because the JS lexer read `/plugins/monokai` as a regex literal. v1 ships no shell preset, so the map could not be extended without writing a lexer. The mobile renderer (`apps/mobile/src/markdown/code.ts`) mirrored the same map and had the same gap. Issue: get-bb#1751. Report: https://get-bb.github.io/reports/issues/1751.html ## What changed - `apps/app/package.json`, `apps/mobile/package.json`, `pnpm-lock.yaml`: bump `sugar-high` from `^1.2.1` to `^2.0.1`. v2 ships 25 language tokenizers (shell, yaml, toml, sql, json, diff, html, markdown, dockerfile, kotlin, cpp, ...) and a `lang()` alias resolver. It is a major version: the root export dropped `tokenize`/`SugarHigh` (now in `sugar-high/core`) and `sugar-high/presets` is gone. These two files are the only importers in the repo. The lockfile diff is only the two `sugar-high` entries. - `apps/app/src/components/ui/markdown-code-highlight.ts`: replace the preset map with `lang(language)` plus a small `EXTRA_LANGUAGE_ALIASES` table for fence names v2 does not resolve but the old map (or agents) use: `console`/`shellscript` -> shell, `h` -> c, `hpp`/`hh`/`hxx` -> cpp, `less` -> css. A fence with no language or an unresolved language still goes through the JavaScript lexer as before (sugar-high's root `highlight()` maps `lang: undefined` to its `javascript` config). - `apps/mobile/src/markdown/code.ts`: same resolution, using `tokenize` from `sugar-high/core` and the per-language `config` from `sugar-high/lang`. A fence with no language or an unresolved language resolves to the `javascript` config explicitly. This matters in v2: `tokenize(code, undefined)` from `sugar-high/core` is now a generic lexer with an empty keyword set and no comment handlers (in v1 it was the JavaScript lexer), so passing `undefined` would have stripped keyword and comment highlighting from every plain ```` ``` ```` block on mobile. The first revision of this PR did exactly that; the verifier caught it and this revision fixes it. Also drops the `as unknown as string[]` cast on `SugarHigh.TokenTypes`, which v2 types as `{ [key: number]: string }`. - v2 output keeps the `sh__line` / `sh__token--*` classes and `--sh-*` variables, so `markdown-code-highlight.css` and the mobile palette are unchanged. No wire change, no CLI change. ## How you verified New test `apps/app/src/components/ui/markdown-code-highlight.test.ts` and new cases in `apps/mobile/src/markdown/code.test.ts`. Both files include a `null` / `ruby` (unknown language) case asserting `const` is a `keyword` and `// hi` is a `comment`. On origin/main source with sugar-high 1.2.1 installed (`git checkout origin/main -- <source files + package.json + lockfile>` + `pnpm install --frozen-lockfile`), only the shell/new-language cases fail; the `null`/`ruby` cases pass, so they guard v1 behavior: ``` @bb/app Tests 8 failed | 2 passed (10) AssertionError: expected [ [ 'sign', '#' ], …(14) ] to deep equally contain [ 'comment', '# install the plugin' ] @bb/mobile Tests 5 failed | 6 passed (11) AssertionError: expected [ { text: '#', type: 'sign' }, …(6) ] to deeply equal [ { …(2) } ] ``` On the first revision of this branch (46ba725, `undefined` config on mobile), the new mobile `null`/`ruby` cases fail: ``` @bb/mobile Tests 2 failed | 9 passed (11) AssertionError: expected { text: 'const', type: 'identifier' } to deeply equal { text: 'const', type: 'keyword' } ``` On this branch both files pass (10/10 and 11/11). From the committed tree (`git status --porcelain` empty): ``` pnpm exec turbo run typecheck --filter=@bb/app --filter=@bb/mobile # Tasks: 4 successful, 4 total pnpm exec turbo run test --filter=@bb/app --filter=@bb/mobile # Tasks: 5 successful, 5 total # @bb/app 3166 passed | 3 skipped; @bb/mobile 833 passed ``` `pnpm install --frozen-lockfile` passes with the lockfile containing only the `sugar-high` hunks. Manual (web, first revision; the web source is unchanged since): started my own dev instance, spawned a claude-code thread whose prompt held a ```` ```sh ```` and a ```` ```python ```` fence with the same `# install the plugin` first line, and dumped the DOM with doobie. Both blocks render the first line as one `sh__token--comment` (computed color `oklch(0.5 0 0)`, the subtle tier) and the `sh` block has no `sh__token--string` for `./plugins/monokai`. Before the fix the report shows the same line as `sign` + identifiers at full foreground and the path in green. Fixes get-bb#1751 > AGENT GENERATED: by Claude Opus 5 ## Independent verification Verified at `b09884bfe` (round 2) in a separate worktree, rebased state confirmed with `git merge-base --is-ancestor origin/main HEAD`. **Root cause check.** Confirmed independently against sugar-high 1.2.1 and 2.0.1 sources: v1 `highlight(code, undefined)` is the JS lexer and v1 ships no shell preset; v2 `lib/index.js` `configFor(name)` resolves `name || 'javascript'`, while `lib/core.js` `tokenize(code, undefined)` is the generic no-keyword/no-comment lexer. The revised mobile `tokenizerConfigFor` resolves `null`/unknown to the `javascript` config, matching the web path. v2 still emits `sh__line` / `sh__token--*` / `var(--sh-*)` with identical shape for empty lines and still HTML-escapes (`<script>` -> `<script>`), so `markdown-code-highlight.css` and `dangerouslySetInnerHTML` are unaffected. Metro already resolves sugar-high subpath exports (`./presets` on v1), so `./core` and `./lang` resolve the same way. No other importers of sugar-high exist in the repo. **Fail-before / pass-after.** - `git checkout origin/main -- apps/app/src/components/ui/markdown-code-highlight.ts apps/mobile/src/markdown/code.ts apps/app/package.json apps/mobile/package.json pnpm-lock.yaml && pnpm install --frozen-lockfile --prefer-offline` (sugar-high 1.2.1 installed), then `pnpm exec vitest run` on the PR's two test files: app `8 failed | 2 passed (10)` with `AssertionError: expected [ [ 'sign', '#' ], …(14) ] to deep equally contain [ 'comment', '# install the plugin' ]`; mobile `5 failed | 6 passed (11)` with `expected [ { text: '#', type: 'sign' }, …(6) ] to deeply equal [ { …(2) } ]`. The null/ruby cases pass on main, so they guard v1 behavior. - Round-1 regression guard: with only `apps/mobile/src/markdown/code.ts` at `46ba725f5` (v2 installed), mobile `2 failed | 9 passed` with `expected { text: 'const', type: 'identifier' } to deeply equal { text: 'const', type: 'keyword' }`. - Restored `HEAD` files, reinstalled (2.0.1): mobile `11 passed (11)`, app `10 passed (10)`. **Turbo (forced, from the committed tree, `git status --porcelain` empty).** - `pnpm exec turbo run typecheck --filter=@bb/app --filter=@bb/mobile --force` -> `Tasks: 4 successful, 4 total` - `pnpm exec turbo run test --filter=@bb/app --filter=@bb/mobile --force` -> `Tasks: 5 successful, 5 total` (@bb/app 3166 passed | 3 skipped, @bb/mobile 833 passed) **Repro on the fixed branch.** Own dev instance (`scripts/bb-dev-app current`, app :17771), project `proj_w583gwhs6b`, thread `thr_qaybud2d5f` (claude-code, "Reply only with ok." plus the report's ```sh and ```python fences). Headless Chromium DOM dump of the rendered user message: SH block first line is a single `sh__token--comment` "# install the plugin" with computed color `oklch(0.5 0 0)` (same as the PYTHON control), and the block contains no `sh__token--string` (`./plugins/monokai` is no longer a regex literal). No longer reproduces. **CI.** All checks on `b09884bfe` pass (Checks, Package Smoke ubuntu + macOS, Tests app-1/2/3, integration, server, packages, version check); iOS simulator flows and Node compatibility smoke skipped as usual. **Residual risks.** Major bump of sugar-high: token assignment for already-mapped languages can shift slightly (colors, not content). Languages v2 still lacks (ruby, lua, ini, ...) stay on the JS lexer as before. v2 emits an empty `sh__token--comment` span at the start of the line after a `#` comment; harmless markup. Bundle grows by 25 small language tables. > AGENT GENERATED: by Claude Opus 5 --------- Co-authored-by: Claude <[email protected]>
## What was wrong The provider-plugin migration deletes core's per-provider carve-outs (the census found 198 provider-id literals across 58 core files). Nothing stops a future change from re-adding a `providerId === "codex"` branch while the migration is in flight, or after it finishes. Progress toward a provider-agnostic core needs to be one-directional and enforced. ## What changed Adds guardrail **G1**, a CI ratchet: - `scripts/check-provider-literal-ratchet.mjs` scans core (everything outside `plugins/provider-*` and `examples/`, excluding tests, fixtures, stories, generated, and dist) for provider-**id** literals — `"codex"`, `"claude-code"`, `"pi"`, `"acp-…"`, `"cursor"`, `providerId === "…"`, `isAcpProviderId`, `RESERVED_PROVIDER_ID_OWNERS`, and the like. Pure Node, no ripgrep dependency on the runner. - `scripts/provider-literal-baseline.json` holds a per-file count. The check fails if any file's count rises or a new core file appears; a reduction requires `--write` to regenerate the baseline, so every removal is a committed, visible diff. When the baseline hits zero, the file and the guard are deleted. - Wired into the `ci.yml` `checks` job beside the existing repo guards (bundle budget, npm version). - Self-test in `@bb/scripts` covering: passes against the committed baseline, fails on a planted `providerId === "codex"` file, and the live count agrees with the baseline. - Documented in `docs/debugging-and-qa.md`. Scope is provider-**id** literals only. Tool-name keying (thread-view's `Read`/`Task`/`TodoWrite` tables) is retired by its own workstream and collides with unrelated identifiers, so it is tracked separately, not in this ratchet. Baseline at introduction: **198 literals across 58 core files**. The top concentrations are exactly what the migration dismantles — the provider registry (23), the daemon skill-discovery tables (20), the app icon map (14), the runtime codex-recovery block (11). ## How you verified - `pnpm exec turbo run test --filter=@bb/scripts` green, including the three ratchet self-tests (pass / planted-literal fail / baseline agreement). - `node scripts/check-provider-literal-ratchet.mjs` prints `ratchet OK: 198 literals across 58 core files`. - `--write` and `--list` exercised manually. - No production code touched; guard + baseline + CI wiring + docs only. Part of the provider-plugin migration (see `docs/provider-plugin-api.md` and https://get-bb.github.io/reports/design/provider-plugin-api.html). Fixes # > AGENT GENERATED: by Claude Opus 4.8 --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
## What was wrong
`plugins/provider-acp/server.ts` declared `fork: "tip"` for every
built-in ACP agent through `ACP_BASE_CAPABILITIES`. The server projects
that to `supportsFork: true` (the `POST /api/v1/threads/fork` gate and
the app's "Fork into new thread" action). But neither `cursor-agent acp`
(2026.08.11) nor `grok agent stdio` advertises
`sessionCapabilities.fork` in its ACP `initialize` reply, so the
bridge's per-session guard (`bridge.ts`: "does not advertise
session/fork support") rejected the fork only after the server had
already created and started the fork thread. The thread landed in
`status: error` with `system/error { code: thread_command_failed }`.
Issue: get-bb#1833. Report: https://get-bb.github.io/reports/issues/1833.html
The issue suggested deriving fork per agent at initialize time. That is
not a drop-in: the agent's `initialize` happens per session inside the
bridge after the server has created the thread, and there is no
daemon-to-server capability channel. The declaration is the server-side
source of truth (same as `supportsManualCompaction`), so it has to match
the agent.
## What changed
- `plugins/provider-acp/server.ts`: `acp-cursor` and `acp-grok` now
declare `fork: "none"`. The base stays `"tip"`; opencode, omp
(oh-my-pi), and hermes-agent all advertise `sessionCapabilities.fork` in
their ACP adapters (checked upstream sources:
`packages/opencode/src/acp/service.ts`,
`packages/coding-agent/src/modes/acp/acp-agent.ts`,
`acp_adapter/server.py`). Added a comment on the base capability
explaining why the declaration must match the agent.
-
`apps/server/test/services/plugins/first-party-provider-plugins.test.ts`:
the golden pin now records the fork ladder per first-party provider and
asserts `registration.serverCapabilities.fork`,
`registry.supportsFork()`, and the composed
`ProviderInfo.capabilities.supportsFork` against it.
Effects: `POST /threads/fork` on a Cursor or Grok thread returns HTTP
400 `Provider acp-cursor does not support thread forks` without creating
a thread; the app hides the fork action for those providers; the
declared ceiling that rides `bridgeLaunch.capabilities.fork` to the
daemon also becomes `"none"`, so the runtime rejects `thread/fork`
before spawning the agent.
No wire shape changes (the existing `fork` field just carries a
different value), so no `HOST_DAEMON_PROTOCOL_VERSION` bump. No CLI or
config surface changes. Custom `acp-*` agents still fall back to the
tier-wide `"tip"`; giving them a per-agent `fork` config field is a
separate change.
## How you verified
Probed the agents directly (same `initialize` request the bridge sends):
```
$ node probe.mjs cursor-agent acp -> sessionCapabilities: { list: {} } fork advertised: false
$ node probe.mjs grok agent stdio -> sessionCapabilities: { list, resume, close } fork advertised: false
```
New test fails on origin/main with the test file applied and the plugin
unchanged:
```
FAIL test/services/plugins/first-party-provider-plugins.test.ts > first-party provider plugins > are the sole source of the built-in providers
AssertionError: acp-cursor: expected 'tip' to be 'none' // Object.is equality
```
Passes on this branch (`Tests 2 passed (2)`).
From the committed tree (`git status --porcelain` empty):
```
pnpm exec turbo run typecheck --filter=@bb/server --filter=bb-plugin-provider-acp
Tasks: 6 successful, 6 total
pnpm exec turbo run test --filter=@bb/server --filter=bb-plugin-provider-acp
bb-plugin-provider-acp: Tests 181 passed (181)
@bb/server: Test Files 1 failed | 194 passed (195); Tests 1 failed | 1822 passed (1823)
```
The one server failure is `test/internal/internal-skill-trees.test.ts`
(`mode: 420` vs `436`), the known local umask 0002 failure unrelated to
this change; it passes here under `umask 022` and in CI.
Manual repro on this branch against a dev instance of this worktree:
```
$ curl -s $BB_SERVER_URL/api/v1/system/providers | ... supportsFork
codex True / claude-code True / pi True / acp-cursor False / acp-grok False
$ pnpm bb:dev thread spawn --provider acp-cursor ... --prompt "Reply only with ok." -> thr_7u6gb8ppn2, reached idle
$ pnpm bb:dev thread fork thr_7u6gb8ppn2 --workspace reuse --prompt "Reply only with ok." --json
Error: Failed to fork thread thr_7u6gb8ppn2: HTTP 400: Provider acp-cursor does not support thread forks
$ GET /threads?projectId=... -> only thr_7u6gb8ppn2 (idle); no fork thread created
```
Fixes get-bb#1833
> AGENT GENERATED: by Claude Opus 5
## Rebase
Rebased onto `origin/main` (`cf00cfe06`) after the grammar-v3 bridge
stack (get-bb#2148 `bb.providers.register` + single `ProviderInfo`, get-bb#2179
WS1b-acp) rewrote both touched files. The fix maps 1:1 onto the new
code:
- `plugins/provider-acp/server.ts`: the declarations now carry
`experimental_strings` / `experimental_serviceTiers` and register
through `bb.providers.register`, but `ACP_BASE_CAPABILITIES.fork: "tip"`
and the per-agent `capabilities` spreads are unchanged, so the `fork:
"none"` overrides for `acp-cursor` and `acp-grok` and the base comment
apply as before. Still no wire-shape change, so no
`HOST_DAEMON_PROTOCOL_VERSION` bump.
-
`apps/server/test/services/plugins/first-party-provider-plugins.test.ts`:
main dropped `supportsWorkflows` from the golden pin (conflict resolved
by adding only the `fork` ladder), and get-bb#2148 added a new test, "pins the
client-read ProviderInfo fields of the four core providers", that pinned
`acp-cursor` at `supportsFork: true`. That pin now reads `supportsFork:
false` with a `get-bb#1833` comment; `supportsSessionRewind: false` is
unchanged. The fork-ladder assertions in the first test
(`registration.serverCapabilities.fork`, `registry.supportsFork()`,
composed `ProviderInfo.capabilities.supportsFork`) carried over
verbatim; `serverCapabilities.fork` still exists on main
(`plugin-provider-registration.ts` projects `supportsFork:
capabilities.fork !== "none"`).
Re-verified on the new base. With `plugins/provider-acp/server.ts`
reverted to `origin/main` and the test file in place, the tests fail (so
main does not already cover the bug):
```
FAIL ... > are the sole source of the built-in providers
AssertionError: acp-cursor: expected 'tip' to be 'none' // Object.is equality
FAIL ... > pins the client-read ProviderInfo fields of the four core providers
AssertionError: expected { id: 'acp-cursor', …(8) } to strictly equal { id: 'acp-cursor', …(8) }
Tests 2 failed | 1 passed (3)
```
With the fix restored: `Tests 3 passed (3)`. From the committed tree
(`git status --porcelain` empty):
```
pnpm exec turbo run typecheck --filter=@bb/server --filter=bb-plugin-provider-acp
Tasks: 6 successful, 6 total
pnpm exec turbo run test --filter=@bb/server --filter=bb-plugin-provider-acp
bb-plugin-provider-acp: Test Files 15 passed (15); Tests 196 passed (196)
@bb/server: Test Files 1 failed | 197 passed | 1 skipped (199); Tests 1 failed | 1896 passed (1897)
```
The one server failure is again
`test/internal/internal-skill-trees.test.ts` (`mode: 420` vs `436`), the
known local umask 0002 failure; it passes in CI.
## Independent verification
Verified by a second agent on a separate worktree (branch
`verify-1833-r1` = `ece689920`, `origin/main` is an ancestor,
`mergeable: MERGEABLE`).
Commands run:
```
git fetch origin main && git fetch origin bb/fix-1833-acp-cursor-fork && git checkout -b verify-1833-r1 FETCH_HEAD
pnpm install --frozen-lockfile --prefer-offline && pnpm exec turbo run build
node probe.mjs cursor-agent acp -> cursor-agent sessionCapabilities: {"list":{}} fork advertised: false
node probe.mjs grok agent stdio -> grok sessionCapabilities: {"list":{},"resume":{},"close":{}} fork advertised: false
git checkout origin/main -- plugins/provider-acp/server.ts
cd apps/server && pnpm exec vitest run test/services/plugins/first-party-provider-plugins.test.ts
git checkout HEAD -- plugins/provider-acp/server.ts
cd apps/server && pnpm exec vitest run test/services/plugins/first-party-provider-plugins.test.ts
pnpm exec turbo run typecheck --filter=@bb/server --filter=bb-plugin-provider-acp
pnpm exec turbo run test --filter=@bb/server --filter=bb-plugin-provider-acp --force
```
Fail-before / pass-after:
- With `plugins/provider-acp/server.ts` reverted to `origin/main` and
the PR's test file in place: `Tests 1 failed | 1 passed (2)` with
`AssertionError: acp-cursor: expected 'tip' to be 'none' // Object.is
equality`.
- With the PR's source restored: `Tests 2 passed (2)`.
Typecheck and tests:
- `turbo typecheck` for `@bb/server` and `bb-plugin-provider-acp`:
`Tasks: 6 successful, 6 total`.
- `turbo test`: `bb-plugin-provider-acp` 14 files passed; `@bb/server`
1822 passed, 1 failed. The single failure is
`test/internal/internal-skill-trees.test.ts` (`mode: 420` vs `436`), the
known umask-0002 environment failure on this workstation; it also fails
on clean `main` here and passes in CI.
Repro on the fixed branch (own dev instance, server :20051, data dir
under `~/.bb-dev`, deleted afterwards):
- `GET /api/v1/system/providers` -> `acp-cursor False`, `acp-grok False`
(codex/claude-code/pi still `True`).
- Spawned an `acp-cursor` thread (`thr_4gh8bikbv6`), waited to `idle`,
then `pnpm bb:dev thread fork thr_4gh8bikbv6 --workspace reuse --prompt
"Reply only with ok." --json` -> `HTTP 400: Provider acp-cursor does not
support thread forks`. Thread list for the project still holds only the
source thread (`idle`); no errored fork thread was created. The original
symptom no longer reproduces.
CI: 11 checks pass, 2 skipped (Node Compatibility Smoke, iOS simulator
flows), none failing.
Review notes:
- Root-cause fix at the right layer: the server-side declaration is the
fork gate and the app affordance, and its value also rides
`bridgeLaunch.capabilities.fork` to the runtime adapter's
`effectiveFork()` ceiling, so `thread/fork` is refused before the agent
is spawned. No wire shape change, so no protocol bump is needed.
- Residual risk: custom `acp-*` agents configured through
`customAcpAgents` still inherit the tier-wide
`ACP_TIER_CAPABILITIES.supportsFork: true`
(`apps/server/src/services/providers/acp-provider-tier.ts`), so a custom
agent without `session/fork` still hits the errored-thread path. A
per-agent `fork` field on that config is a sensible follow-up, not a
blocker for this PR. opencode/omp/hermes fork support was checked from
upstream sources only (not installed here).
> AGENT GENERATED: by Claude Opus 5
## Independent verification (post-rebase)
Re-verified by a second agent after the rebase onto the grammar-v3
bridge rewrite (branch `verify-2150-rb` = `2d84751d9`, one commit on
`cf00cfe06`). `origin/main` had moved one more commit (`fcada5a3b`,
get-bb#2120 provider-literal ratchet) by the time of this check; a local `git
merge --no-commit origin/main` was clean (the ratchet scans core only
and excludes `plugins/provider-*`), and GitHub reports `mergeable:
MERGEABLE`.
Does the fix still target the right code path after the v3 rewrite? Yes:
- `apps/server/src/services/threads/thread-fork.ts:39`
(`requireForkCapableProvider`) still gates `POST /threads/fork` on
`providerRegistry.supportsFork()`, which for a registered plugin
provider reads `registration.info.capabilities.supportsFork` = `fork !==
"none"` (`plugin-provider-registration.ts:211`).
- The app still reads `ProviderInfo.capabilities.supportsFork`
(`useForkThreadFromMessage.ts:54`, `ThreadDetailView.tsx:977`,
`RootComposeView.tsx:538`).
- `provider-bridge-launch.ts:48-50` still forwards
`registration.serverCapabilities.fork` to the daemon, and
`packages/agent-runtime/src/bridge-protocol-adapter.ts`
`effectiveFork()` still takes the declaration as a ceiling over the
handshake, so `thread/fork` is refused before cursor-agent is spawned.
- The v3 bridge (`plugins/provider-acp/src/bridge/bridge.ts`) still
advertises `fork: "tip"` unconditionally in its handshake (line ~2372)
and only checks `agentCapabilities.sessionCapabilities.fork` per session
at agent initialize (lines 1718-1721, "does not advertise session/fork
support"). Nothing in the rewrite made the static declaration redundant;
it is still the only up-front gate.
Commands run:
```
git fetch origin main && git fetch origin bb/fix-1833-acp-cursor-fork && git checkout -b verify-2150-rb FETCH_HEAD
pnpm install --frozen-lockfile --prefer-offline && pnpm exec turbo run build
git checkout origin/main -- plugins/provider-acp/server.ts
cd apps/server && pnpm exec vitest run test/services/plugins/first-party-provider-plugins.test.ts
git checkout HEAD -- plugins/provider-acp/server.ts
cd apps/server && pnpm exec vitest run test/services/plugins/first-party-provider-plugins.test.ts
pnpm exec turbo run typecheck --filter=@bb/server --filter=bb-plugin-provider-acp
pnpm exec turbo run test --filter=@bb/server --filter=bb-plugin-provider-acp --force
```
Fail-before / pass-after (only non-test source file is
`plugins/provider-acp/server.ts`):
- With `server.ts` from `origin/main` and the PR's test file: `Tests 2
failed | 1 passed (3)`. Failing assertions: `AssertionError: acp-cursor:
expected 'tip' to be 'none' // Object.is equality` and, in the get-bb#2148 pin
test, `AssertionError: expected { id: 'acp-cursor', …(8) } to strictly
equal { id: 'acp-cursor', …(8) }` (supportsFork true vs false).
- With the PR's source restored: `Tests 3 passed (3)`.
Typecheck and tests (from the committed tree, `git status --porcelain`
empty):
- `turbo typecheck`: `Tasks: 6 successful, 6 total`.
- `turbo test`: `bb-plugin-provider-acp` Test Files 15 passed (15);
`@bb/server` Tests 1 failed | 1896 passed (1897). The single failure is
`test/internal/internal-skill-trees.test.ts` (`mode: 420` vs `436`), the
known umask-0002 local failure; it passes in CI.
Repro on the fixed branch (own dev instance, server :26547, data dir
under `~/.bb-dev`, deleted afterwards):
- `GET /api/v1/system/providers` -> `codex True`, `claude-code True`,
`pi True`, `acp-cursor False`, `acp-grok False`.
- Spawned an `acp-cursor` thread (`thr_2c8kkaj7rz`) with cursor-agent
2026.08.11, waited to `idle`, then `pnpm bb:dev thread fork
thr_2c8kkaj7rz --workspace reuse --prompt "Reply only with ok." --json`
-> `HTTP 400: Provider acp-cursor does not support thread forks`. A
direct `POST /api/v1/threads/fork` also returned 400. The project's
thread list still holds only the source thread (`idle`); no errored fork
thread was created. The original symptom no longer reproduces.
CI on `2d84751d9`: all checks pass (server, packages, integration,
app-1/2/3, both Package Smoke runners, Checks, version check); iOS
simulator flows and Node Compatibility Smoke skipped; none pending or
failing.
Residual risks (unchanged from the pre-rebase review): custom `acp-*`
agents configured through `customAcpAgents` still fall back to
`ACP_TIER_CAPABILITIES.supportsFork: true`
(`apps/server/src/services/providers/acp-provider-tier.ts:43`) and can
still hit the errored-thread path; a per-agent `fork` field on that
config is a follow-up. No wire shape change (the `fork` field already
rides `bridgeLaunch.capabilities`; only its value for two providers
changes), so no `HOST_DAEMON_PROTOCOL_VERSION` bump is needed.
> AGENT GENERATED: by Claude Opus 5
Co-authored-by: Claude <[email protected]>
…t-bb#2147) ## What was wrong Codex labels each reconnect attempt with a structured `codexErrorInfo` (for example `{ responseStreamDisconnected: { httpStatusCode } }`, `willRetry: true`, failure text in `additionalDetails`), then reports the terminal failure for the same stream error with `codexErrorInfo: "other"` and the failure text moved to `message`. That downgrade is upstream: codex-rs `notify_stream_error` always labels retries `ResponseStreamDisconnected`, while `CodexErr::to_codex_protocol_error` maps `CodexErrorDetails::Stream` to `CodexErrorInfo::Other`. The bridge trusted the terminal value, so the final timeline row lost the `stream-disconnected` category and rendered as a generic **Provider error** (the detail text is longer than the 80-char title budget, so the disconnect cause was only visible after expanding the row). Issue: get-bb#1840. The independent report URL (https://get-bb.github.io/reports/issues/1840.html) returns 404; the issue body and get-bb#1563 carry the repro. ## What changed - `plugins/provider-codex/src/delta-translation.ts`: the translation state remembers the retry-time `codexErrorInfo` and failure text per codex `threadId\0turnId`. A terminal (`willRetry: false`) error whose `codexErrorInfo` is `other` and whose failure text equals the remembered retry text reuses the retry classification. The context is consumed by the terminal error, dropped on `turn/completed`, and never crosses turns. Unrelated terminal errors and every non-`other` terminal value keep the provider-reported classification. No provider prose is parsed. - `plugins/provider-codex/src/translator.ts`: `thread/closed` also clears the retry context for that codex thread (exported `clearCodexEventTranslationThreadState`). - No wire change between server and host daemon: the `provider/error` event shape is unchanged, only the value of `errorInfo` on this one path. No CLI or doc surface changes. Relation to get-bb#1563: that PR (same design, by @ymichael and @brsbl) targets `plugins/provider-codex/src/event-translation.ts`, which get-bb#1834 deleted when it moved Codex onto the narrow-grammar delta translator. It no longer merges (`git merge-tree` reports a content conflict in `delta-translation.ts`). This PR ports that design onto `delta-translation.ts`, with a flat `Map` keyed by thread+turn instead of nested maps. ## How you verified Tests added in `plugins/provider-codex/src/translator.test.ts` (`codex terminal retry-error classification`): - carries the retry classification into the degraded terminal error (and the context is consumed, so a repeat stays `other`) - does not relabel an unrelated terminal error after a reconnect - scopes the retry context to the turn and drops it on `turn/completed` - drops the retry context when the codex thread closes Fail-before: with `delta-translation.ts` and `translator.ts` restored from `origin/main`, `pnpm exec turbo run test --filter=bb-plugin-provider-codex --force -- --run src/translator.test.ts` fails the first test: ``` × carries the retry classification into the degraded terminal error AssertionError: expected [ { type: 'provider/error', …(7) } ] to deep equally contain ObjectContaining{…} expected "category": "stream-disconnected", "providerCode": "responseStreamDisconnected" received "category": "unknown", "providerCode": "other" ``` The three negative tests pass on `origin/main` as expected (they pin that the guard does not over-apply). Pass-after, from the committed tree (`git status --porcelain` empty): - `pnpm exec turbo run typecheck test --filter=bb-plugin-provider-codex` → `Tasks: 7 successful, 7 total` (16 test files, 176 tests passed) - `pnpm exec turbo run build` → `Tasks: 18 successful, 18 total` Manual replay of the incident's two events (reconnect with `responseStreamDisconnected`, then terminal `other` with the same `stream disconnected before completion: ...` text) through `createCodexEventTranslator` via `node --conditions=source --import tsx`: the terminal delta now carries `errorInfo: { category: "stream-disconnected", providerCode: "responseStreamDisconnected", httpStatusCode: null }`. ## Rebase Rebased onto `origin/main` after the grammar-v3 bridge stack landed (get-bb#2124, get-bb#2136, get-bb#2153, get-bb#2148, get-bb#2164). That stack rewrote `delta-translation.ts` (presentation on every item, `injectedToolsByName` on the translation state, delegation items) and `translator.ts` (`clearClosedThreadState` now returns the closes for open delegations), but it did not touch the `error` case, `toProviderErrorInfo`, or `turn/completed`, so the fix maps onto the new code unchanged: - The only textual conflict was in `CodexEventTranslationState` / `createCodexEventTranslationState`, where main added `injectedToolsByName` next to where this PR adds `retryErrorsByTurnKey`. Resolved by keeping both fields. - `clearCodexEventTranslationThreadState` is still called from `clearClosedThreadState` in `translator.ts`, before it returns the delegation closes that main added. - The tests merged cleanly into `translator.test.ts`; they run through the grammar-v3 `createDeltaAssembler` harness on main, and the `provider/error` event shape they assert is unchanged. Re-verified on the new base (`798b720ef`, one commit on top of `origin/main`): - Fail-before: with `delta-translation.ts` and `translator.ts` restored from `origin/main`, `pnpm exec turbo run test --filter=bb-plugin-provider-codex --force -- --run src/translator.test.ts -t "codex terminal retry-error classification"` → `1 failed | 3 passed`; `carries the retry classification into the degraded terminal error` fails with expected `"category": "stream-disconnected", "providerCode": "responseStreamDisconnected"`, received `"category": "unknown", "providerCode": "other"`. The bug is still present on current main. - Pass-after, from the committed tree (`git status --porcelain` empty): `pnpm exec turbo run typecheck test --filter=bb-plugin-provider-codex --force` → `Tasks: 7 successful, 7 total`, `Test Files 18 passed (18)`, `Tests 197 passed (197)`. `pnpm exec turbo run build` → `Tasks: 18 successful, 18 total`. Fixes get-bb#1840 > AGENT GENERATED: by Claude Opus 5 ## Independent verification Verified on a fresh checkout of `bb/fix-1840-codex-stream-disconnect` (282f32e, one commit on top of `origin/main`; `git merge-base --is-ancestor origin/main HEAD` true, GitHub reports MERGEABLE). Root cause checked against current upstream sources (not from the PR description): `codex-rs/core/src/session/mod.rs` `notify_stream_error` hard-codes `CodexErrorInfo::ResponseStreamDisconnected` for every retry notification, `codex-rs/core/src/responses_retry.rs` returns the raw `CodexErr` once retries are exhausted, and `codex-rs/protocol/src/error.rs` `to_codex_protocol_error` has no arm for `CodexErrorDetails::Stream` so it hits `_ => CodexErrorInfo::Other`. The app-server maps `EventMsg::StreamError` to `error` with `willRetry: true` plus `additionalDetails`, and `EventMsg::Error` to `willRetry: false` with `additional_details: None`. The PR's correlation (retry `additionalDetails` vs terminal `message`, same thread+turn, `other` only) matches that wire shape exactly. Commands: - `pnpm install --frozen-lockfile --prefer-offline` and `pnpm exec turbo run build` (18/18). - Fail-before: `git checkout origin/main -- plugins/provider-codex/src/delta-translation.ts plugins/provider-codex/src/translator.ts`, then `pnpm exec turbo run test --filter=bb-plugin-provider-codex --force -- --run src/translator.test.ts -t "codex terminal retry-error classification"`: 1 failed, 3 passed. Failing assertion: `carries the retry classification into the degraded terminal error` -> `AssertionError: expected [ { type: 'provider/error', ...(7) } ] to deep equally contain ObjectContaining{...}`, expected `"category": "stream-disconnected", "providerCode": "responseStreamDisconnected", "httpStatusCode": 502`, received `"category": "unknown", "providerCode": "other", "httpStatusCode": null`. - Pass-after: restored the PR sources (`git status --porcelain` empty), `pnpm exec turbo run typecheck test --filter=bb-plugin-provider-codex --force` -> `Tasks: 7 successful, 7 total`, `Test Files 16 passed (16)`, `Tests 176 passed (176)`. - Only `packages/thread-view/src/error-display.ts` consumes the `stream-disconnected` category (title text); no runtime recovery keys on it, so the blast radius is the timeline row title. Repro on the fixed branch: a real Codex stream outage cannot be triggered deterministically here, so I replayed upstream-shaped events through `createCodexEventTranslator` directly (`node --conditions=source --import tsx`): four `Reconnecting... n/5` retries labelled `responseStreamDisconnected` with the failure text in `additionalDetails`, then a terminal `other` with that text as `message` and `additionalDetails: null`. Fixed branch: `{"category":"stream-disconnected","providerCode":"responseStreamDisconnected","httpStatusCode":null}`. Same script with `origin/main` sources: `{"category":"unknown","providerCode":"other"}`. Extra negative replays on the fixed branch all stayed correct: unrelated terminal text after a retry stays `unknown`; a structured terminal value (`responseTooManyFailedAttempts`, 503) is never overridden by the remembered retry; a thread-scoped retry (no `turnId`) does not relabel a turn-scoped terminal; a retry on a different codex thread does not leak across threads. CI: all checks pass (Checks, Package Smoke ubuntu+macos, Tests app-1/2/3, integration, server, packages, version check). Residual risks (minor, not blocking): the correlation needs the terminal `message` to equal the last notified retry's `additionalDetails`; the terminal `CodexErr` is the attempt after the last notified retry, so if the inner reqwest text differs between attempts the row falls back to today's generic label (never to a wrong one). Retry context for a turn whose child dies without `thread/closed` or `turn/completed` lives in the per-session translator until the session is released (a few bytes). The upstream mapping gap in codex-rs remains. > AGENT GENERATED: by Claude Opus 5 ## Independent verification (post-rebase) Re-verified after the rebase onto the grammar-v3 bridge. Checked out `798b720ef` (one commit on top of `cf00cfe06`); `origin/main` had since gained get-bb#2120 (provider-literal ratchet), which merges cleanly and excludes `plugins/provider-*`, so it cannot affect this PR (`node scripts/check-provider-literal-ratchet.mjs --base origin/main` -> `ratchet OK: 148 references across 40 core files`). Fix still targets the right code path in the rewritten translator: the v3 stack left the `error` case, `toProviderErrorInfo`, and `turn/completed` unchanged; `clearCodexEventTranslationThreadState` runs inside `clearClosedThreadState` before the delegation closes it now returns; `translateEvent` still routes `error` events through `translateCodexEventToDeltas(event, eventTranslationState)` with the single per-session state. Nothing downstream reclassifies: `@bb/agent-runtime` `shouldRestartCodexThreadAfterEvent` keys only on `rate-limit`/`unauthorized` categories (a retry-time label is always `stream-disconnected`, so restart policy is unchanged) and `packages/thread-view/src/error-display.ts` is the only consumer of the category. Commands (all from the committed tree): - Fail-before on current main source: `git checkout origin/main -- plugins/provider-codex/src/delta-translation.ts plugins/provider-codex/src/translator.ts`, then `pnpm exec vitest run src/translator.test.ts -t "codex terminal retry-error classification"` in `plugins/provider-codex` -> `1 failed | 3 passed`; `carries the retry classification into the degraded terminal error` fails with expected `"category": "stream-disconnected", "providerCode": "responseStreamDisconnected", "httpStatusCode": 502`, received `"category": "unknown", "providerCode": "other", "httpStatusCode": null` (`src/translator.test.ts:1272`). - Pass-after (sources restored, `git status --porcelain` empty): same vitest command -> `4 passed`. `pnpm exec turbo run typecheck test --filter=bb-plugin-provider-codex --force` -> `Tasks: 7 successful, 7 total`, `Test Files 18 passed (18)`, `Tests 197 passed (197)`. - Dependents: `pnpm exec turbo run typecheck test --filter=@bb/provider-parity --filter=@bb/agent-runtime --filter=@bb/provider-bridge-protocol --force` -> `Tasks: 10 successful, 10 total` (parity 43 passed, agent-runtime 439 passed, bridge-protocol 217 passed). The parity suite replays every committed recording, including `recordings/codex/auth-failure`, through the current bridge with zero diffs. - `pnpm exec prettier --check` and `pnpm exec eslint` on the three touched files: clean. Repro on the fixed branch: replayed the issue's event sequence (four `Reconnecting... n/5` retries labelled `responseStreamDisconnected` with the failure text in `additionalDetails`, then terminal `other` with that text as `message`) through `createCodexEventTranslator` via `node --conditions=source --import tsx`: terminal delta is `{"category":"stream-disconnected","providerCode":"responseStreamDisconnected","httpStatusCode":null}`. A terminal-only event with no preceding retry stays `unknown`/`other` (by design). Cross-checked against upstream `codex-rs/protocol/src/error.rs` (`Stream(..)` still falls to `_ => CodexErrorInfo::Other`; terminal `message` is `self.to_string()`, the same text `notify_stream_error` puts in `additional_details`). CI: all 11 check-runs on `798b720ef` succeed (Checks, Package Smoke ubuntu+macos, Tests app-1/2/3, integration, server, packages, version check x2); 2 skipped (node-compat smoke, iOS flows). Residual risk (minor, not blocking): the real recorded `auth-failure` cell shows Codex's failure text can carry per-request `cf-ray`/`request id` values that differ between the last retry and the terminal attempt; there the exact-text guard does not fire and the terminal row stays the generic label exactly as on main (for that 401 case a `stream-disconnected` label would arguably be wrong anyway, and the runtime's 401 restart text pattern still matches). Retry context for errors without a `turnId` is only dropped on `thread/closed`. > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
## What was wrong The connected card in the bb connect settings section showed a "Show QR for phone" toggle for the public URL. The card also shows the mobile-app pairing QR. Two QR codes with different purposes on one card confused users. ## What changed - `plugins/connect/app.tsx`: removed the URL QR toggle, its hint text, and the `qrOpen` state. `QrCodeImage` stays for the mobile pairing section. - `plugins/connect/app.test.tsx`: the "rest of the paired card is unaffected" assertion now checks the `Re-pair` button. ## How you verified `pnpm exec turbo run typecheck test --filter=bb-plugin-connect` passed (90 tests). > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
…et-bb#2202) ## What was wrong TestFlight needs a Beta App Review for the first build of each new marketing version. The nightly iOS job in `publish-bb-app.yml` passed the bb-app nightly version to `mobile-ios-eas.yml`, which wrote its numeric base into `app.json`. Each base bump (0.39.0 → 0.39.1 → …) created a new TestFlight version, and external testers had to wait for a new review every time. ## What changed - `.github/workflows/publish-bb-app.yml`: the nightly iOS job passes `version: ""`. The reusable workflow skips the "Apply the marketing version" step, so every nightly keeps the committed `app.json` version and only the remote EAS build number moves. - `apps/mobile/app.json`: `expo.version` is pinned to `0.39.0`, the version TestFlight has already approved. New builds of an approved version skip the review. - `.github/workflows/mobile-ios-eas.yml`: comment cleanup. Manual dispatch still accepts a `version` input for a real release. - `apps/mobile/README.md`: the CI and "TestFlight testers" sections explain the pinned version, when to bump it, and the "Automatically distribute builds" toggle. No wire changes. ## How you verified - `app.json` parses (`node -e 'JSON.parse(...)'`). - `actionlint` on both workflows reports only pre-existing warnings (custom Blacksmith runner labels, one shellcheck info line), none from this change. - The `version` input of `mobile-ios-eas.yml` is `required: true, type: string`; an empty string is valid and the apply step is gated on `inputs.version != ''`. - Manual check of the next nightly: it should upload as 0.39.0 with a build number above 4 and reach the external group without a new review. Fixes # > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
…t-bb#2210) ## What was wrong After get-bb#2202 the nightly keeps one TestFlight marketing version, but a new build still reaches only the internal group. Apple offers "Automatically distribute builds" only for internal groups (`hasAccessToAllBuilds` is `null` on the external group in the App Store Connect API). Each build must be added to the external group by hand, and the README wrongly told readers to turn on a toggle that does not exist for external groups. ## What changed - `apps/mobile/scripts/testflight-distribute.mjs` (new, no npm dependencies): signs an App Store Connect JWT with the `.p8` the submit profile already uses, waits for the build (`--version`, `--build`) to reach `processingState: VALID`, submits it for Beta App Review when it has no submission, and adds it to the beta group (`--group`, default `External testers`). Idempotent: a build already in the group is a no-op. - `.github/workflows/mobile-ios-eas.yml`: `eas build` now runs with `--json`; stdout goes to `eas-build.json` and the progress log still goes to `eas-build.log` and the step summary. The step exports `app_version` and `build_number`. A new step runs the distribute script when `submit` is true and the new `external_group` input (default `External testers`, empty skips) is set. The `.p8` cleanup moved to an `always()` step because the distribute step needs the key. - `.github/workflows/publish-bb-app.yml`: the nightly passes `external_group: External testers`. - `apps/mobile/README.md`: CI and "TestFlight testers" sections describe the distribute step; removed the stale "marketing version climbs on every nightly" paragraph and the wrong "Automatically distribute builds" advice. No wire changes. ## How you verified - Ran the script against the live app with the local `.p8`: `node scripts/testflight-distribute.mjs --version 0.39.0 --build 3` printed `Build 0.39.0 (3) is VALID; review state: APPROVED.` and `Build is already in 'External testers'. Nothing to do.` (the idempotent path; build 3 is the approved build). - `eas build:list --json` confirms the build records carry `appVersion` and `appBuildVersion`, which the workflow reads from `eas build --json`. - `actionlint` on both workflows: only the pre-existing warnings (custom runner labels, one SC2016 info line). - `prettier --write` and `node --check` on the script. - The first real run is the next nightly; it should add the new 0.39.0 build to External testers with no manual step. > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude <[email protected]>
## What was wrong The embedded Release branch of `launch-app.yaml` returned as soon as Maestro's `launchApp` started the native process, before the embedded JavaScript bundle and Expo Router had necessarily mounted. With the E2E profile reset, the initial `/` route redirects to Add server while the live custom-scheme handler is coming online. The smoke flow therefore delivered `bb://dev/spike` into a race between that initial redirect and the incoming URL. The failed artifact from [Mobile E2E run 32470089883](https://github.com/get-bb/bb/actions/runs/32470089883) makes the race visible: iOS delivered `UIOpenURLAction` at 10:06:54.564, and the same app PID rendered and focused the Add server URL field about 154 ms later. The passing artifacts from runs [32356115918](https://github.com/get-bb/bb/actions/runs/32356115918) and [32445580667](https://github.com/get-bb/bb/actions/runs/32445580667) never rendered that field for the smoke PID before reaching the spike route. The backend, simulator, and app build were healthy in the failed run; all five later flows passed. ## What changed The embedded-bundle launch subflow now waits for the first React screen (`add-server-screen`) before returning to callers. That readiness condition establishes that app boot, the initial router mount, and the empty-profile redirect have completed before smoke delivers a live deep link. This is a state-based gate rather than a sleep or an increase to the smoke assertion timeout. The smoke flow and its Phase 0, workspace probe, HTTP, raw WebSocket, realtime, and config-change assertions are unchanged. There are no wire, CLI, guide, or protocol changes. ## How you verified - Inspected the failed artifact's screenshots, Maestro command trace, screen hierarchy, simulator logs, launch subflow, router boot, empty-profile redirect, and native-intent handling; compared them with both passing artifacts above. - Parsed `launch-app.yaml` and `smoke.yaml` as two-document YAML files. - `pnpm exec turbo run build --filter=@bb/mobile` - `pnpm exec turbo run typecheck --filter=@bb/mobile` - `pnpm exec turbo run lint --filter=@bb/mobile` - `pnpm exec turbo run test --filter=@bb/mobile --force` — 124 files and 839 tests passed. - [Mobile E2E stress run 32502973878](https://github.com/get-bb/bb/actions/runs/32502973878) built and installed the Release app on the pinned Xcode 26 runner, then passed 10 consecutive cold-start smoke flows against one simulator and backend. The artifacts record all 10 readiness gates completing in 3.05–4.36 seconds and all 10 Phase 0 assertions completing in 170–278 ms, with the full downstream probe assertions preserved. > AGENT GENERATED: by GPT-5.6-Sol
## What was wrong The provider-recording redactor only recognized classic and fine-grained personal access tokens. Documented OAuth and GitHub App token prefixes could survive both replacement and the final survivor sweep while the command reported zero survivors. ## What changed Expand the shared GitHub token pattern to cover `ghp_`, `gho_`, `ghu_`, `ghs_`, and `ghr_`, including the newer URL-safe `ghs_` form, while retaining `github_pat_`. Add a CLI-level regression for every documented family. This is not a wire change; `HOST_DAEMON_PROTOCOL_VERSION` is unchanged. ## How you verified The new regression failed before the production change and passes after it. The full `@bb/provider-bridge-protocol` Turbo suite passes 218 tests, Turbo typecheck passes, and re-redacting all 241 committed recording files reports zero survivors with byte-identical output. Fixes none. > AGENT GENERATED: by GPT-5.6-Sol
## What was wrong PR get-bb#2158's bare-repository provisioning regression test compared `git worktree list --porcelain` with the lexical temp path passed to `createWorktree`. On macOS, `os.tmpdir()` yields `/tmp` while Git canonicalizes that symlink to `/private/tmp`, so the feature assertions pass but the package suite fails on path spelling. ## What changed `packages/host-workspace/test/provisioning.test.ts` now canonicalizes the created target with `fs.realpath()` before comparing it with Git porcelain, and compares exact output lines. This is test-only. No production behavior, CLI/guide/docs, SDK/plugin API, or host-daemon wire shape changed; `HOST_DAEMON_PROTOCOL_VERSION` remains unchanged. ## How you verified - Before the change, the required macOS Turbo suite failed with 213 passed / 1 failed. - The focused bare-worktree regression passes after the change. - The full `@bb/host-workspace` Turbo suite passes with 214/214 tests. - The package Turbo typecheck passes; the package has no Turbo build task. - `git diff --check` passes. Follow-up to get-bb#2158. > AGENT GENERATED: by GPT-5.6-Sol
## Summary - constrain the desktop model picker to the popover available height - allow the full menu to scroll so reasoning options remain reachable - keep compact drawer sizing unchanged ## Tests - `pnpm exec turbo run test --filter=@bb/app --force` - `pnpm exec turbo run typecheck --filter=@bb/app --force` - `pnpm exec turbo run lint --filter=@bb/app --force` - `pnpm exec turbo run build --filter=@bb/app --force` - verified at a 1000x400 viewport that wheel scrolling reveals the final reasoning option > AGENT GENERATED: by GPT-5.4 --------- Co-authored-by: bianrenping.juns <[email protected]> Co-authored-by: Michael Yong <[email protected]>
## Summary - add a native **Copy Link** action when the desktop context menu opens over a link - preserve the existing **Copy** action when link text is selected - cover the combined link-and-selection menu behavior with a regression test ## Root cause The desktop shell replaces Chromium's native context menu, but its custom menu builder ignored Electron's `linkURL` context. As a result, right-clicking a Markdown link in chat only exposed text-selection actions. ## Before  ## After <img width="1838" height="1121" alt="image" src="https://github.com/user-attachments/assets/5f971713-f8f7-4d7f-a33b-4583e4304d46" /> ## Validation - `pnpm exec turbo run test --filter=@bb/desktop --force` — 33 files, 250 tests passed - `pnpm exec turbo run typecheck --filter=@bb/desktop` - `pnpm exec prettier --check apps/desktop/src/desktop-context-menu.ts apps/desktop/test/desktop-context-menu.test.ts` --------- Co-authored-by: Michael Yong <[email protected]>
## What was wrong `experimental_Diff` accepted only a patch, while the native diff panel could lazily load both complete file sides and enrich Pierre so users could expand unchanged context between hunks. The host diff boundary discarded that resolved semantic input, so plugin callers and `experimental_diffRenderer` replacements could not offer equivalent context expansion. ## What changed - Add the experimental `ExperimentalDiffFullFileContents` contract and optional `experimental_fullFileContents` prop to `experimental_Diff`. - Resolve replacement props to the complete old/new text sides or `null`, while keeping loading, retry, viewport, image-preview, and mobile policy with the caller. - Preserve the native panel lazy-loading flow, enrich the built-in renderer only when complete contents are consistent with the patch, and forward those contents to replacement renderers. - Update the plugin testing harness, authoring skill, guide, and API audit entry. - Add regression coverage for public component enrichment and native panel lazy-loading through a replacement renderer. This is an app/plugin SDK contract change only. It does not change server-to-daemon messages, so `HOST_DAEMON_PROTOCOL_VERSION` is unchanged. ## How you verified The new tests fail before this change because the full-file contract and renderer prop do not exist. - `pnpm exec turbo run typecheck --filter=@bb/app --filter=@get-bb/plugin-sdk` - `pnpm exec turbo run test --filter=@bb/app --force` — 404 files, 3,124 tests passed - Focused diff context tests — 3 files, 21 tests passed after the final experimental API naming pass - `pnpm exec turbo run test --filter=@get-bb/plugin-sdk --force` — 107 tests passed - Plugin authoring documentation test — 14 tests passed - `pnpm exec turbo run lint --filter=@bb/app --force` — no errors - `git diff --check` Fixes: no linked issue. > AGENT GENERATED: by GPT-5 Codex
…#1638) An inline visualization in a thread (`::inline-vis{file="…"}`) has an external icon whose click opens the file in the sidebar. This adds the second step: once it is open there, the sidebar preview header gains an **Open in external browser** action that opens the visualization **full-page in the user's default browser**. The first click is unchanged — `plugins/inline-vis/app.tsx` is untouched, so the in-thread icon still only ever opens the sidebar. ## Decisions worth reviewing - **`Globe`, not `ExternalLink`.** `OpenInEditorButton` already renders `ExternalLink` in this same toolbar; reusing it produced two identical adjacent icons. `Globe` is the codebase's browser signifier (`BrowserTabContent`, `NewTabFileSearch`, `ThreadDetailView`). The existing "Open in editor" affordance is untouched and still works. - **The absolute-URL resolution is load-bearing, not cosmetic.** Preview URLs are relative app paths, and `apps/desktop/src/main.ts` parses with `new URL(payload)` and no base — a relative path throws into a bare `return`, i.e. a dead button with no error. `toAbsolutePreviewUrl` is what makes the desktop path work; a test pins it. - **`openUrlInExternalBrowser`, deliberately not `useOpenUrlByPreference`.** The latter honours the in-app-browser preference and would route the visualization to bb's in-app browser panel, which is not "the user's default external browser". - **Scope:** the button appears only for rendered-HTML previews (`html` and `iframe` states) and is absent for text/markdown/csv. A negative test pins that. - **Judgment call, no test pins it:** the button also shows on the **Raw** tab of an HTML preview, not just **Preview**. Reading: you're asking for the rendered page regardless of which tab you're on. Defensible either way — happy to gate it to Preview if reviewers prefer. ## Verification Gates on this branch, rebased onto current `main` (includes get-bb#1630 and get-bb#1635): `tsc --noEmit` clean · `FilePreview.test.tsx` 19/19 · `plugins/inline-vis` 16/16 unchanged · ESLint 0 errors (4 pre-existing `set-state-in-effect` warnings on lines this diff does not touch). Driven through the real UI in an isolated dev instance, three assertions: | Click | Result | | --- | --- | | In-thread icon | sidebar opens · **0** new browser tabs | | Sidebar Globe | **1** new tab, absolute URL, rendered full-page | | In-thread icon again | **0** new tabs | The served route returns `200 text/html` with no `content-disposition`, so it renders rather than downloads. It carries `content-security-policy: sandbox allow-scripts`, which also applies to the top-level document: scripts run and relative assets load, but `localStorage`/cookies/same-origin fetches are unavailable — identical to what the sidebar iframe already imposes. The CSP is the security boundary for arbitrary worktree HTML and is deliberately left alone. ## Known gap The live click-through exercised the **browser** dispatch (`window.open`). The **desktop** dispatch (`shell.openExternal` → OS default browser) is covered by a unit test asserting `openExternalUrl` receives the absolute URL, and the main-process consumer was confirmed by reading `main.ts`, but the IPC hop itself was not exercised by clicking inside a packaged Electron build. Fixes get-bb#1842 BB-Thread-ID: thr_zhe3sbcbgx Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
## What was wrong The server can mark a thread active before the provider's `turn/started` id reaches it. An auto-targeted message created in that window carried `expectedTurnId: null`, so the shared host-daemon handler started a competing turn instead of steering the turn already opening; for Codex, user and system turns then also produced different construction signatures from raw `permissionEscalation` values even though automatic review mapped them to identical effective permissions, causing an unnecessary session rebuild that could terminate the accepted user turn. See get-bb#2241 and the [production thread](https://ymichael.getbb.app/projects/proj_qrv2s45kmq/threads/thr_7ccj7nuz57). ## What changed - Resolve auto-targeted submissions against the daemon's live active-turn state, rebase stale snapshots, and wait up to five seconds when a provider turn start is already pending. - Recheck after that wait: start normally if the prior start settled idle, steer if its id arrived, or reject with a visible command error if it remains pending. A slow provider start can no longer fall back to a competing turn. - Preserve vouched ids for explicit steer requests. - Build the Codex session signature from effective approval policy, approval reviewer, and sandbox settings instead of bb's raw permission intent. - Add regression coverage for pending starts, stale ids, completed prior turns, a pending-start timeout, and Codex auto-review session reuse. - Bump `HOST_DAEMON_PROTOCOL_VERSION` from 150 to 151 because the same `turn.submit` command can now report `appliedAs: "steer"` instead of `appliedAs: "new-turn"`. ## How you verified - `pnpm exec turbo run test --filter=@bb/host-daemon --force -- src/command-dispatch.test.ts` — 31 tests passed. - `pnpm exec turbo run test --filter=bb-plugin-provider-codex --force -- src/bridge/bridge.session-signature.test.ts` — 2 tests passed. - `pnpm exec turbo run test --filter=@bb/host-daemon-contract --force -- test/contract.test.ts` — 38 tests passed. - `pnpm exec turbo run typecheck --filter=@bb/host-daemon` - `pnpm exec turbo run typecheck --filter=bb-plugin-provider-codex` - `pnpm exec turbo run typecheck --filter=@bb/host-daemon-contract` A broader combined package test run also reached an existing environment-sensitive gzip byte-count mismatch in `payload-size.test.ts`; uncompressed JSON byte counts were unchanged, and the targeted contract test above passes. Fixes get-bb#2241 > AGENT GENERATED: by GPT-5
Collapse the trailer to a single marker line and apply the same wording to the issue and pull request templates and docs. Tidy the Claude Code transcript fixtures while here: drop opaque signature blobs the translator never reads and trim the model-list recording to the catalog entries. Co-Authored-By: Claude <[email protected]>
## What was wrong The `desktop-nightly` release has not been updated by a nightly run since get-bb#1651 landed on 2026-08-15. The nightly desktop builds themselves have been fine — they succeed every night and then discard their artifacts. `nightly-desktop-publish` is declared with no `if:`, so it defaults to `success()`. get-bb#1651 added the `publish-nightly` job and put it in the `needs` graph of both desktop build jobs, where it is skipped by design on the scheduled and manual-nightly paths. GitHub propagates a skip **transitively** through `needs`, so that skip reaches `nightly-desktop-publish` even though both of its direct needs run and succeed. The build jobs already anticipate this and override it with `!cancelled()` — see the comment at `publish-bb-app.yml:493-495` — but the publish job never got the same guard. ``` publish ──────┐ ├─→ nightly-desktop-macos ──┐ publish- │ nightly-desktop-linux ──┴─→ nightly-desktop-publish nightly ──────┘ (if: !cancelled() ...) (no if: → inherits the skip) [skipped] ``` The net effect is that the job is skipped on exactly the two paths whose purpose is to produce a nightly, and runs only on a stable release run — the one path where `publish-nightly` actually succeeds, leaving no skip in the graph. That is why the release still moves occasionally and looks merely stale rather than broken. | Run | Date | Trigger | `Publish bb Nightly desktop` | |---|---|---|---| | [31693508850](https://github.com/get-bb/bb/actions/runs/31693508850) | Aug 13 | schedule | success | | — | Aug 15 | [get-bb#1651](get-bb#1651) merges as [`8e6fc8358`](get-bb@8e6fc8358) | — | | [32020362329](https://github.com/get-bb/bb/actions/runs/32020362329) | Aug 17 | schedule | **skipped** | | [32358956903](https://github.com/get-bb/bb/actions/runs/32358956903) | Aug 20 | schedule | **skipped** | | [32502502056](https://github.com/get-bb/bb/actions/runs/32502502056) | Aug 21 | dispatch, `npm_tag=nightly` | **skipped** | Corroborating evidence: every asset currently on the release is `0.39.1-nightly.32204811379.1`, uploaded 2026-08-19 01:52Z by run [32204811379](https://github.com/get-bb/bb/actions/runs/32204811379) — an `npm_tag=latest` dispatch, i.e. the stable-release path. ## What changed `.github/workflows/publish-bb-app.yml` — added an `if:` guard to `nightly-desktop-publish` mirroring the one on the two build jobs, so a transitively-skipped `publish-nightly` no longer skips it, while a genuine build failure still does: ```yaml if: >- ${{ !cancelled() && needs.nightly-desktop-macos.result == 'success' && needs.nightly-desktop-linux.result == 'success' }} ``` The explicit `.result == 'success'` checks are required rather than relying on the default, because `!cancelled()` alone would let the job publish a partial release after a build job failed. No wire-format, CLI, or documented-surface changes, so no `HOST_DAEMON_PROTOCOL_VERSION` bump. ## How you verified - Reproduced the root cause from run history rather than from the symptom: confirmed the last schedule-triggered run that published was Aug 13, before get-bb#1651, and that all three subsequent nightly-path runs show the job as `skipped` with both build jobs `success` (`gh api .../actions/runs/<id>/jobs`). - Confirmed via the release asset manifest that the only run to move `desktop-nightly` since Aug 15 was the Aug 19 `latest` dispatch, matching the predicted "stable-release-only" path. - Verified the edited workflow still parses and that the condition and `needs` resolve as intended (`yaml.safe_load` on the file, inspecting `jobs.nightly-desktop-publish`). Full verification requires a live nightly run, since GitHub's transitive skip propagation cannot be exercised locally. Recommend confirming on the first cron after merge, or via a `workflow_dispatch` with `npm_tag=nightly`, `dry_run=false`. Ruled out as causes: the two cron failures on Aug 18 and Aug 21 are unrelated — both are `Build bb Nightly desktop (Linux)` failing outright, a separate issue that is not addressed here. Regression from get-bb#1651. No tracking issue was open at the time of filing. > AGENT GENERATED: by Claude Opus 5 Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
xterm renders terminal output onto a canvas, so mobile browsers cannot provide useful native text selection. iOS also leaves xterm's hidden textarea focused after dismissing the keyboard, which makes DOM focus an unreliable signal for deciding whether a tap should reopen the keyboard or offer Paste.
The terminal drawer additionally needs to follow the visual viewport while its textarea is active; otherwise the software keyboard covers the prompt and cursor.
User impact
Mobile users can complete terminal-based authentication and other clipboard workflows without switching to desktop: open an authentication URL, return to bb, paste a code, select terminal output, adjust the selection, and copy it.
Validation
pnpm exec turbo run typecheck --filter=@bb/app --filter=@bb/shared-uigit diff --checkTracks get-bb#1763 and get-bb#1764.