Skip to content

Graduate six early adopter experiments - #8068

Merged
ymichael merged 2 commits into
mainfrom
bb/remove-early-adopter-experiments-thr_ht3d7wimve
Nov 24, 2026
Merged

ymichael merged 2 commits into
mainfrom
bb/remove-early-adopter-experiments-thr_ht3d7wimve

Conversation

@ymichael

@ymichael ymichael commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Six experiments that early adopters have run as defaults were still gated and off for everyone else: Skip notifications for the thread you're viewing (skipFocusedThreadNotifications), Thread context card (threadContextCard), Background database checkpoints (walCheckpointWorker), Faster styles inside plugins (keyedPluginCss), Lower agent CPU priority (agentCpuPriority) and Keep machines connected through network drops (resumeDaemonSessions).

What changed

All six keys are gone from @bb/domain experiments, Settings → Experiments, the app's placeholder config, and the early adopter defaults. getExperiments already ignores stored rows for unknown keys, so a stored override no longer gates anything.

  • Skip focused-thread notifications: push-notifications always passes the focused thread to client delivery. experimental_useExperiment now has no core caller; it stays in the SDK, and its api_to_audit.md entry says so.
  • Thread context card: ThreadDetailView enables the card everywhere except phones (compact viewport with a coarse pointer), which keep the context row above the composer.
  • Background database checkpoints: the server starts startWalCheckpointer directly. startGatedWalCheckpointer and its test are deleted.
  • Faster plugin styles: the app always requests css-scope=plugin-attribute-v1 and keeps the scope-attribute observer running. The server still serves owned-root-v1 and unscoped CSS to older tabs.
  • Lower agent CPU priority: the daemon always runs provider processes and lifecycle scripts at nice 10, and on macOS the launcher always starts the server and daemon under taskpolicy -a. The agent-cpu-priority.json handoff file, setAgentWorkloadsLowered, and the daemon's onAgentCpuPriority hook are removed.
  • Keep machines connected through network drops: the server always keeps a dropped daemon session for HOST_RECONNECT_GRACE_MS (30 s) and returns it as reconnectGraceMs in session open. The experiment-off test is deleted, and the resume tests and the dropped-connection integration test no longer set the experiment.
  • Wire change: agentCpuPriority is removed from the session open response and from provider-session-policy.replace. HOST_DAEMON_PROTOCOL_VERSION goes from 279 to 280. reconnectGraceMs keeps its shape; it is now always 30 s.
  • Render invariants harness: openThread's settle step treated the page as settled after 1 s without React commits, even while queries were still in flight. With the card on, page load issues more requests, and under CPU load the providers and system-config queries could finish inside the 10 s idle window. That re-rendered the composer and every timeline row, which is what failed CI. Settling now also waits until no HTTP request is awaiting a response and requests have been quiet for the same window. A per-hook probe confirmed the idle re-renders came from those queries going pending/fetching → success, not from card state.
  • Docs: the features are now described outside the Experiments section: in docs/configuration.md (Notifications section, plus new Daemon session resume, Thread context card, and "CPU priority, plugin styles, and database checkpoints" sections), docs/debugging-and-qa.md, docs/multiple-devices.md, bb guide customization and bb guide machines. The plugin-authoring thread context card reference, the Plugin Guide surface bullet, and the push-notifications overview are updated too. The early adopter list is now compactExpiredCache, pluginUpdates, serverRoutes.

How you verified

  • pnpm exec turbo run typecheck lint --filter='...[origin/main]' passed.
  • Full @bb/server and @bb/app suites passed through Turbo.
  • Focused suites passed through Turbo:
    • @bb/process-utils workload priority
    • bb-app logged-process tests
    • @bb/host-daemon-contract (whole package)
    • @bb/host-daemon app, server-connection and server-client tests
    • push-notifications (whole plugin), CLI failing-server guard, templates, plugin-api-docs
  • Render invariants:
    • Before the harness fix, the idle test failed in about half of roughly a dozen local runs, as it did in CI.
    • With the card disabled, it passed. With the card on, a hook-level probe showed the idle commits came from in-flight provider and system-config queries.
    • After the fix, the full suite passed 6 of 6 runs.
  • Not run: tests/integration locally (left to CI), and live app, desktop or real multi-machine drop checks.

AGENT GENERATED

🤖 Generated with Claude Code

ymichael and others added 2 commits November 23, 2026 15:03
Remove the agentCpuPriority, keyedPluginCss, skipFocusedThreadNotifications,
threadContextCard and walCheckpointWorker experiments and ship their
behavior to everyone. Drop agentCpuPriority from the daemon session wire
and bump HOST_DAEMON_PROTOCOL_VERSION to 280.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… requests

Remove the resumeDaemonSessions experiment: the server always keeps a
dropped daemon session for HOST_RECONNECT_GRACE_MS and offers it in
session open.

The render-invariants harness treated the page as settled after 1 s
without React commits, even while system queries such as the provider
list were still in flight. With the thread context card on, page load
issues more requests, and under CPU load those queries could land in the
idle window and re-render the composer and timeline. Settling now also
waits until no request is awaiting a response and requests have been
quiet for the same window.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael ymichael changed the title Graduate five early adopter experiments Graduate six early adopter experiments Nov 24, 2026
@ymichael
ymichael merged commit c720163 into main Nov 24, 2026
99 of 100 checks passed
@ymichael
ymichael deleted the bb/remove-early-adopter-experiments-thr_ht3d7wimve branch November 24, 2026 04:53
ymichael added a commit that referenced this pull request Nov 24, 2026
ymichael added a commit that referenced this pull request Nov 24, 2026
## Human comments

## What was wrong

Three CI flakes from the last week, each caused by its test rather than
the product. The third one is already fixed on main by #8068, which
landed the same settle change while this PR was open, so this PR now
carries the first two.

**Pi bridge: `a child whose extension never reports ready is a
construction error, not a hung tool call`** (Windows plugins-1, main
4d2fccc, run 44840631240). The harness decided a fake Pi child had
exited only when the fake wrote an `exit:` line from its SIGTERM or
stdin-EOF handler. On Windows, `kill()` closes stdin and then runs
`taskkill /T /F` straight away. If the forced kill lands before the
child handles EOF, the child dies without writing the line, so the test
waits 10 s and fails with `expected false to be true` (12 040 ms in the
failing log; passing runs take 1.9–3.1 s). The same self-reported exit
backs the transient-login, catalog-eviction and catalog-close assertions
in `bridge.round2`/`bridge.lifecycle`, and the refresh test in
`catalog.test.ts`. All of them go through `kill()`.

**Workflows: `wakes queued runs when settings frees capacity`** (ubuntu
plugins-2, e1f97e4; attempt 2 passed on the same SHA). The test used
fake timers and gave the queued run `vi.waitFor({ timeout: 20, interval:
1 })` to reach `succeeded`. That is 20 ms of **real** time for an
in-process QuickJS + SQLite run. Each check also advanced the fake clock
by 1 ms, so the tight timeout was what kept the fake clock short of a
polling tick. I measured the real time from freeing capacity to
`succeeded`: p50 2–3 ms, but 5–16% of iterations take over 20 ms, up to
318 ms.

**Render invariants: `typing an Ask User Question answer renders nothing
outside the question form`** (11-17 018f74a, `expected [ …(41) ] to
deeply equal []`; the next push on that branch passed). `settle()` only
waited for 1 s with no React commits. It did not check whether the page
still had requests in flight. On a freshly seeded server under load, the
requests the page sends at load (`/system/providers`,
`/system/execution-options`, `/system/providers?environmentId=…`,
`/hosts/…/provider-clis/status`) were still pending 6.5–7.5 s after
load, when `reset()` ran. They finished about 1 s into the typing
window, and their commits re-rendered the hidden follow-up composer
(Send options, Prompt actions), a timeline row's menu and sidebar footer
items. That only happens on the first page against a fresh server, which
is why only the first test in `typing.test.ts` failed.

## What changed

- `plugins/provider-pi/src/bridge/test-support.ts`:
`readProcessLog().exited` now lists the tracked fake-Pi `ChildProcess`es
that have exited, from `experimental_trackChildProcesses`. It no longer
reads the fake's self-written `exit:` lines, so it is right however the
child died. `spawned` still comes from the log. This fixes every caller
at once.
- `plugins/provider-pi/src/bridge/catalog.test.ts`: the
refresh-replacement test checks that only the second child is still
running, instead of looking for an `exit:` line from the first.
- `plugins/workflows/src/service-policy.test.ts`: both waits in the wake
test use `{ timeout: 5_000, interval: 0 }`. With interval 0 each check
advances the fake clock by 0 ms, so no polling tick can fire and the run
can only finish because of the wake. The real-time limit is only there
to bound a failure.
- `tests/render-invariants/src/render-session.ts`: no change here any
more. #8068 made `settle()` wait for pending requests as well as React
quiet, which is the fix for the root cause above, so I dropped my
version of it when rebasing.

Not changed: the 11-18 render-invariants failure (run 44414918194:
`push.test` and `typing.test` both timed out in
`waitForSelector('[data-timeline-row-id]')` before any settle, with the
first row never visible within 30 s). It happened once, in two files at
the same moment, the next push on that branch passed, and it has not
come back in about 130 Render invariants jobs since 11-19. I did not see
it in about 15 local parallel runs, so I am leaving it alone.

## How you verified

- **Pi.** I made the fake ignore EOF and SIGTERM
(`FAKE_PI_HANG_ON_CLOSE=1`), so it is killed without running its
handler, the same as a Windows forced kill. The old harness then fails
the test with the CI assertion (`expected false to be true`, 14 s), and
the new harness passes. The touched files (`bridge.round2`, `catalog`,
`bridge.lifecycle`, 31 tests) passed 10 of 10 loops under 16 CPU
burners. `turbo run test --filter=bb-plugin-provider-pi` passes: 371
passed, 5 skipped.
- **Workflows.** Mutation check: with `wakeWorker()` removed from
`updateSettings`, the fixed test fails with `expected 'queued' to be
'succeeded'`, so it still catches a wake that is missing. I measured
real and fake time to `succeeded` over 100 repeats per variant, idle and
under 48 burners. Fake time consumed is ≤2 ms with the old interval and
0 ms with the new one. The fixed test passed 600 of 600 repeats (100 × 3
variants × 2 runs) under 48 burners.
- **Render invariants** (fixed on main by #8068; these numbers are from
my equivalent change before the rebase). Before the fix, under 6 burners
with all three files in parallel, it failed in 1 of 2 full-suite runs
and in 2 of 5 instrumented first iterations on a fresh fixture. Request
logging tied the failure to the pending provider requests described
above. After the fix, 6 of 6 full-suite runs passed (7 of 7 tests each)
under the same load.
- `turbo run typecheck lint` passes for `bb-plugin-provider-pi` and
`bb-plugin-workflows` after the rebase onto 22a9366 (Pi 371 passed,
workflows 284 passed), and oxfmt is clean.

> AGENT GENERATED

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
ymichael added a commit that referenced this pull request Nov 24, 2026
ymichael added a commit that referenced this pull request Nov 24, 2026
ymichael added a commit that referenced this pull request Nov 24, 2026
ymichael added a commit that referenced this pull request Nov 25, 2026
)

## Human comments

## What was wrong

Since #8068 graduated `agentCpuPriority` (merged 2026-11-24 04:53 UTC),
`deprioritizeAgentWorkload` renices every provider process to nice 10
unconditionally. Before that it was a no-op unless the daemon turned it
on, so `@bb/agent-runtime` test bridges ran at the Vitest worker's
priority. Now each bridge a test spawns runs below the nice-0 Vitest
workers. On a contended 4-vCPU Linux runner (turbo runs four suites at
once), the bridges get a small share of CPU, so bridge startup and exit
take seconds and tests with wall-clock bounds fail. macOS ignores nice
across processes, so this never reproduces locally.

In the failing run for #8158 ([run 45680230926, attempt
1](https://github.com/get-bb/bb/actions/runs/45680230926/job/139438721951)),
every bridge-spawning test near the start of both files took 8–12 s;
they normally take 0.2–2 s:
- `uses the construction deadline for thread/'resume'
(requestTimeoutMs=undefined)` hit the 15 s test timeout. Its siblings
took 10.3 s and 8.3 s.
- `fires onProcessExit when provider crashes` spent about 10 s in
`ensureProvider`. It then gave the exit callback only the
`waitForRuntimeState` default of 1 s. That window has to cover the
bridge's `process.exit` plus the `close` event, which the runtime itself
allows up to `PROVIDER_PROCESS_CLOSE_GRACE_MS` (1 s) to report.

Main CI has hit the same problem. Of the 60 most recent failed main CI
runs (Nov 16–25), the 49 before Nov 24 had no `@bb/agent-runtime`
failures. On Nov 24, 7 of 10 failed main runs were
`runtime.process-lifecycle.test.ts` tests timing out at 15 s on Linux:
`ranks provider processes ahead of bb for the out-of-memory killer` (4
runs), `keeps an old-hash bridge process that still owns a thread` (3),
`retires a threadless bridge process superseded by a new artifact hash`,
and `waits for provider retirement before starting a same-key
replacement`. The two tests named above did not appear in that scan.

## What changed

- `packages/agent-runtime/src/test/keep-provider-process-priority.ts`,
registered as a Vitest `setupFiles` entry, stubs
`deprioritizeAgentWorkload` from `@bb/process-utils`. Test bridges now
run at the worker's priority, as they did before #8068. Production
renicing is unchanged. No agent-runtime test asserts nice values;
`@bb/process-utils` keeps its own `workload-priority` test.
- `fires onProcessExit when provider crashes` now awaits the
`onProcessExit` callback instead of polling it against a 1 s deadline,
and asserts it fired once.

The construction-deadline test is unchanged. With bridges back at normal
priority it runs in about 1.7 s. Its 1.5 s scripted response delay is
what lets it tell the 120 s construction deadline from the 30 s request
default, and that delay was not part of the failure.

## How you verified

I reproduced this on Linux in an OrbStack `node:22-bookworm` container
pinned to 4 CPUs (`--cpuset-cpus=0-3 --init`), with nice-0 busy-loop
burners standing in for the other suites. At 6 burners, a nice-10 CPU
job ran 5.3× slower than the same job at nice 0.

| load | renice on (main) | renice off / this PR |
| --- | --- | --- |
| 6 burners, 7 runtime test files, ×2 | 122/122 pass, tests 118 s |
122/122 pass, tests 41 s |
| 12 burners, same files, ×2 | 2 failed each run (`command-contract`
real-time tests), tests 222–231 s | 122/122 pass, tests 57 s |
| 64 burners, the target tests, ×2 | pass, at CI-like timings: `fires
onProcessExit` 5.7–7.2 s, construction tests 7.5–9.5 s | 0.7–2.8 s |
| 110 burners, the target tests | all 5 fail: `The bridge never received
thread/start` / `thread/resume`, and 15 s timeouts for `fires
onProcessExit` and `handles JSON-RPC error responses` | pass, ×2 runs on
this PR's code |

- With renice on at 110 burners, the time from `ensureProvider`
resolving to `onProcessExit` firing was 484 ms in one run and 1762 ms in
another. The second would fail the old 1 s wait. With renice off at 110
burners it was 175 ms.
- A temporary probe confirmed the stub works on Linux: a spawned
provider ran at nice 0 with the setup file and nice 10 without it.
- With this PR on Linux at 12 burners: 305/305 passed. That run skipped
`runtime.codex-topology` and `runtime.skill-roots-capability`, which
need plugin packages the container's filtered install did not have.
- Locally: `pnpm exec turbo run typecheck lint
--filter=@bb/agent-runtime` passed, and `pnpm exec turbo run test
--filter=@bb/agent-runtime` passed: 23 files, 316 passed, 1 skipped (the
Linux-only OOM test).

Not changed here: `apps/host-daemon` lifecycle scripts get the same
nice-10 renice, and other `runtime.process-lifecycle` tests still poll
exit callbacks with the 1 s default. Both are the same kind of issue,
but neither failed in the runs above once bridges were back at normal
priority.

> AGENT GENERATED

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@SawyerHood SawyerHood mentioned this pull request Dec 2, 2026
SawyerHood added a commit that referenced this pull request Dec 2, 2026
## Human comments

## What was wrong

`main` has 331 commits since `desktop-v0.50.1` with no release notes,
and `bb-app` and `@bb/desktop` are still at 0.50.1.

## What changed

- `packages/bb-app/package.json`, `apps/desktop/package.json`: 0.50.1 →
0.51.0 (`node scripts/bump-version.mjs --minor`). The release adds 14
database migrations (0159–0172), raises `HOST_DAEMON_PROTOCOL_VERSION`
from 268 to 286, moves `@get-bb/plugin-sdk` from 0.6.157 to 0.6.216,
replaces the Cursor agent with Grok Build, and turns six early-adopter
experiments on for everyone (#8068).
- `CHANGELOG.md`: the 0.51.0 section, covering `desktop-v0.50.1` through
#8507 (`4d7a9af609`). Same sections as 0.50.0: Reliability, Performance,
Usability, Experiments, Now on for everyone, Agents, Bug fixes, Plugins,
Security, Thanks (21 outside contributors). The telemetry rework (#8402)
is left out on purpose.
- `changelog-metadata.ts`: the 0.51.0 `RELEASE_META` entry (December 2,
2026, "Warm worktrees, multi-folder projects, and new agents").

## How you verified

- `node .github/workflows/check-version-lockstep.mjs`: `bb-app=0.51.0
@bb/desktop=0.51.0`.
- `pnpm exec turbo run typecheck test --filter=@bb/app
--filter=@bb/config --filter=@bb/server --filter=bb-app`: 17/17 tasks
(`@bb/app` 709 files, 7574 passed, 20 skipped).
- `pnpm exec turbo run smoke:tarball --filter=bb-app --force`: passed in
51 s.
- oxfmt on `CHANGELOG.md` and `changelog-metadata.ts`, and `git diff
--check`: clean.

> AGENT GENERATED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant