Repository navigation
Use the shared host-path parser across bundled plugins - #6760
Merged
Merged
Conversation
ymichael
force-pushed
the
bb/remove-plugin-host-path-copies-thr_nzsvgfhat5
branch
from
November 2, 2026 19:33
74965c0 to
85279a4
Compare
ymichael
force-pushed
the
bb/remove-plugin-host-path-copies-thr_nzsvgfhat5
branch
2 times, most recently
from
November 2, 2026 19:52
50d7833 to
3ebc711
Compare
ymichael
force-pushed
the
bb/remove-plugin-host-path-copies-thr_nzsvgfhat5
branch
from
November 2, 2026 20:16
3ebc711 to
a7b92ef
Compare
Storage Retention skips paths it cannot parse instead of failing the whole scan, and treats them as owned by bb when deciding removals. Automations, Docs and Monaco replace non-null assertions with explicit errors. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
added a commit
that referenced
this pull request
Nov 2, 2026
## Human comments
## What was wrong
After a server restart, the GitHub PR Status plugin restores each
environment's PR from its database and serves it right away. It also
starts a background re-check right away, often before the host daemon
has reconnected. That re-check returned `unavailable` ("machine isn't
available"), and `store.load` replaced the environment's known PR link
with that result. The sidebar row badge disappeared and stayed gone
until something re-read that row, such as opening the thread or
refocusing the page. Observed on prod: the server restarted at 13:04:14
and the daemon reconnected at 13:04:20. Afterwards the sidebar showed
only #6849 (the thread that was opened). Six other inbox threads with
open PRs (#6760, #6755, #6736, #6728, #6727, #6734) showed no badge,
although their links and snapshots were still in the plugin database.
## What changed
- `plugins/github-pr-status/store.ts`: when a re-check of a known PR URL
comes back `unavailable`, the environment's link is no longer replaced,
so the last snapshot keeps being served. The snapshot's `fetchedAt` is
still bumped, so the regular poll retries it. Discovery reads (no known
URL) behave as before.
- Behaviour change: `bb pull-request show` for an environment whose
machine is offline now prints the last PR bb saw, or `unavailable` when
it has none. Actions (`ready`/`draft`/`merge`) still refuse with the
machine message. The skill doc and README are updated.
## How you verified
- New store test, "keeps serving a restored PR when its machine is
unreachable after a restart": it restores a persisted PR, makes the
first re-check return `unavailable`, and checks that the PR is still
served, nothing is published, and the next successful check publishes
the update. It fails without the fix (`expected { outcome: 'unavailable'
} to deeply equal { outcome: 'available' }`) and passes with it.
- `pnpm exec turbo run test typecheck lint
--filter=bb-plugin-bb--github-pr-status`: 183/183 tests pass, typecheck
and lint clean.
> AGENT GENERATED
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5.5 <[email protected]>
k0d3r1s
added a commit
to lettland/bb-plugins
that referenced
this pull request
Nov 5, 2026
Port upstream get-bb/bb#6760: resolve CLI client paths with experimental_resolveHostPath (Windows/UNC aware, null for unparsable) instead of node path resolve, derive attachment names with experimental_getHostPathBasename, raise the SDK floor, and add the upstream routing regression cases (posix root, drive root, UNC) to the machine-flow test.
ymichael
added a commit
that referenced
this pull request
Nov 18, 2026
## Human comments ## What was wrong bb capped text with raw UTF-16 `.slice(0, n)` / `.slice(-n)` / `.substring` in dozens of places. When an emoji's surrogate pair straddled the cap, the cut kept half of it, a lone surrogate. Much of that text goes to agents: child-thread output reported to the parent (`child-thread-notifications.ts`), the restart-resume note (`restart-resume.ts`), plugin instructions (`thread-runtime-config.ts`, `host-policy.ts`), MCP/browser/annotation tool results, and more. It also goes to push notifications and terminal titles. `JSON.stringify` escapes a lone surrogate as `\ud83d`. Codex's serde-based app-server rejects that escape and drops the whole message without answering. bb then waits on `thread/start` until it times out. Nothing made text well-formed before it left for a provider, so any one bad cut could break a turn. T3 Code fixed the same class: pingdotgg/t3code#30369, #29168, #29653, #29906 (#30369 pointed us at it). ## What changed - **Safe cuts where text reaches an agent or a person.** Caps on user or agent text now use `sliceUtf16Head` / `sliceUtf16Tail` from `@bb/text-utils` (added in #3995, but #7050's plugin-instructions cap and older cuts such as child-thread output never used them): server, daemon, app, desktop, CLI, web, packages, and first-party plugins. Plugins get the same functions through the SDK (below) instead of local copies. Cuts on text that cannot hold a surrogate pair (ASCII slugs, handles, hostnames, URLs, tag names) and log-only or dev-tooling output are left alone. The page script in agent-annotations is stringified into the browser, so its copy lives inside the injected functions. `boundedMarkdownPreview` now cuts with `sliceUtf16Head` and checks for a split token against the original text. - **Well-formed at the provider boundary.** `serializeJsonRpcLine` in `bridge-kit/runtime-json-rpc.ts` replaces lone surrogates with U+FFFD in every string the runtime sends to a provider bridge (requests, results, errors), so every provider gets well-formed turn input and instructions. It serializes with plain `JSON.stringify` and only re-serializes with the replacer when the line holds an escaped lone surrogate (`\ud`), so normal traffic pays nothing extra (20k-string message: 1.3 ms plain, 4.6 ms always-replacer, 1.5 ms with the check). The ACP message stream and the Codex bridge's app-server writer use the same function, which also covers text a bridge builds itself. New `toWellFormedUtf16` in `@bb/text-utils`. - **Plugin SDK exports.** Core's own functions, re-exported with `experimental_` names (entries in `docs/api_to_audit.md`, symbols in the Plugin Guide): - `experimental_sliceUtf16Head` from `@get-bb/plugin-sdk` (server code) and `@get-bb/plugin-sdk/app` (wired in `plugin-sdk-app-impl.tsx`). - `experimental_sliceUtf16Head` / `experimental_sliceUtf16Tail` from `@get-bb/plugin-sdk/host`, because the root SDK runtime in host bundles is a stub. Browser Automation's host code and the Claude Code and Codex providers use it. - `experimental_serializeJsonRpcLine` from `@get-bb/plugin-sdk/provider-bridge`, used by the Codex app-server writer. - Agent Annotations keeps an inline copy because its page script is stringified into the browser. The 10 plugins that use the runtime-provided root or `/app` export require `bbPluginSdk >=0.6.161`, as #6760 did for the host-path helpers. - No lint guard: the provider boundary makes any future raw cut harmless to providers, so a name-based heuristic rule was not worth its false positives. - No server/daemon wire change, so `HOST_DAEMON_PROTOCOL_VERSION` stays the same. The JSON-RPC change is between the daemon and its own bridge processes. `@get-bb/plugin-sdk` is bumped to 0.6.161 for the new exports and the changed bridge code. `@bb/text-utils` was added as a dependency to the packages that newly import it. ## How you verified **Repro on origin/main (502cf5a), real dev instance (`pnpm start:worktree`) with real Codex:** a local plugin contributed instructions `"x".repeat(32767) + "😀 …"`; the 32,768-char cap cut the emoji in half. - Codex thread: `Command thread.start failed — codex app-server did not answer thread/start within 60000ms` (status `error`). - Control with the plugin disabled: the thread replies `ok`. - Talking to `codex app-server` (codex-cli 0.169.0) directly with the same bytes: stderr `Failed to deserialize JSONRPCMessage: unexpected end of hex escape at line 1 column 32921`, and no response. With a safe cut, both `thread/start` and `turn/start` succeed. - Claude Code accepted the same instructions, so this broke Codex turns but not Claude Code turns. **After the fix, same dev data dir and plugin enabled:** the Codex thread starts and replies `ok`. **Tests added:** - runtime JSON-RPC: a lone surrogate never reaches the provider's stdin, while real emoji pairs survive. - Cut boundaries for child-thread output, plugin instructions, restart-resume command names, and push-notification `truncate`. - `toWellFormedUtf16`. **Commands:** - `pnpm exec turbo run typecheck --filter='...[origin/main]'`: 112/112 passed. - `pnpm exec turbo run test lint --filter='[origin/main]'`: everything passed except `@bb/app` `CommandPalette.test.tsx` and `@bb/server` `install-machine-script.test.ts`. Both were timeouts while a dev instance was running and pass on rerun; neither touches changed code. - `pnpm exec turbo run prepare:bundled`: 70/70 passed. **After trimming the change (811d979):** `pnpm exec turbo run typecheck lint --filter='...[HEAD]'` 151/151, `pnpm exec turbo run test --filter='[HEAD]'` 29/29, `prepare:bundled` for the touched plugins 12/12. On a rebuilt `pnpm start:worktree` with real Codex, a plugin whose instructions put an emoji at the 32,768 cap and one that sends a raw lone surrogate both get `ok`. **After moving the helpers into the SDK (2d6fa48):** `pnpm exec turbo run typecheck lint --filter='...[HEAD]'` 129/129, `pnpm exec turbo run test --filter='[HEAD]'` 23/23 (including `@bb/app`, `@get-bb/plugin-sdk` and the Plugin Guide), `prepare:bundled` for the 12 touched plugins 18/18. The built bundles show the Codex host bundle inlining `serializeJsonRpcLine`, the Docs server importing `experimental_sliceUtf16Head` from the runtime root, and Browser Automation's app reading it from the app runtime. Both live Codex checks still reply `ok` on a rebuilt `pnpm start:worktree`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) > AGENT GENERATED --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
smsunarto
added a commit
to smsunarto/bb-plugins
that referenced
this pull request
Nov 19, 2026
…3) (#187) * fix(scott-tasks): return a saved comment before agent delivery finishes Port of upstream get-bb/bb#4679. The app's createComment waited for the thread lookup and send before answering, so a slow or stuck worker held the composer. The app now returns the saved comment at once and delivers in the background; the CLI still waits so it can report the notified count. * feat(scott-tasks): move a task and its sub-tasks to another project Port of the server and CLI half of upstream get-bb/bb#4100. A moved task gets a fresh number in the target project, lands at the end of its status column, and keeps its old key as an alias, so mentions and agent instructions that name the old key still resolve. Labels are remapped by name and created when missing. A sub-task moved on its own leaves its parent. New: moveTaskToProject RPC and bb tasks move. * feat(scott-tasks): move tasks from the detail page and the list's context menu The UI half of upstream get-bb/bb#4100. The properties rail and inline chips get a project picker, and a list row's context menu gets Move to project. Opening a task by a key it had before a move asks the server and follows the task to its current key. * feat(scott-tasks): keep New task drafts and cap the dialog's height The dialog half of upstream get-bb/bb#4100. Title, description and attributes save to localStorage as they change, so an outside click, Escape or reload no longer throws a long task away; Discard draft clears it. The dialog is capped at 85dvh with the description scrolling, so Create task stays reachable. * fix(scott-tasks): port upstream touch, embed and download fixes - get-bb/bb#5097: label and preset row actions stay visible on screens without hover, such as a 13-inch iPad. - get-bb/bb#5157: a narrow desktop pane keeps the compact topbar; only touch screens get the taller one. - get-bb/bb#5903: the whole task embed card opens the task, and a loading card no longer highlights on hover. - get-bb/bb#5508: attachment downloads go through bb's saveFile, which the iOS shell implements with WebKit's native download. * docs(scott-tasks): document bb tasks move; drop unused hono and cron-parser hono 4.11.9 was a vulnerable pin that nothing imports; cron-parser is unused too. * feat(scott-tasks): delegate as a child thread from a chosen base branch bb tasks delegate takes --parent-thread, --parent-notifications auto|stuck|off and --base-branch, passed to threads.spawn. An orchestrating agent dispatches its crew as children so bb reports their turns to it, and starts each worktree from its own branch. --base-branch always means a new worktree, whatever the preset names, and leaves the preset unchanged. * fix(scott-tasks): let the attachment preview's img own its object URL Attachment chips set state in an effect to hold the preview URL; the <img> ref callback now creates and revokes it. Clears a react(set-state-in-effect) lint error. * feat(scott-tasks): owned fields, crew snapshot and parent wakes for Captain - defineField/setField: typed fields only the owning plugin may write; a write bumps the task's updated_at. - crewSnapshot({threadIds, changedSince}): one read of task, parent, fields, preset, live status and the last notifying comment with its delivery state. - bb tasks comment --notify-parent sends a one-line wake to the commenting thread's parent and retries from the database (1, 2, 5, 15 min; 6 attempts), then marks it undeliverable; --attach puts files on the comment first. - delegate takes reportContract and drops its built-in contract under stuck; taskThreadsAttach keeps presetName; plugin callers may author comments. - Task threads get an archived live status that unarchive reverses. * perf(scott-tasks): drop unused toolbar and command exports Cuts 10 KB of app.css that Tailwind generated for components nothing imports. * fix(scott-tasks): let the list's empty state fill the scroller Port of get-bb/bb#7613's Tasks part: the list's size container moves inside the scroller, and the empty state grows to fill it. * fix(scott-tasks): resolve CLI file paths with the target host's path rules Port of get-bb/bb#6760: file flags resolve with the SDK's host-path parser, so Windows drive and UNC paths from a remote thread resolve on that machine instead of with the server's node:path. * refactor(scott-tasks): drop store inputs nothing passes Port of the Tasks part of get-bb/bb#4606: create inputs no longer take an id, comment updates take only notifiedCount, attachment updates only blobPath, and new comments rely on the column's 0 default. The tie-break test sets its ids with SQL, as upstream's does. Skipped: upstream blanking the is_image migration (it already ran here), and displayWidth and the description saver's schedule option, which fork tests still use. * test(scott-tasks): cover list scope switches while reads are pending Ports get-bb/bb#7056's regression tests. Upstream fixed a list stuck behind placeholders when it switched scope to a cached list; the fork's collection-backed list already passes them, so no code change was needed. All shows every task the shared collection holds, so the All step checks no absent row. * fix(scott-tasks): apply resize-measured layout in the resize frame Port of get-bb/bb#7635's Tasks part. The board-width check and the list's row window read their size in a shared ResizeObserver and write it inside flushSync, so a resize never paints one frame of the old layout. lib/shared-resize-observer.ts is vendored from upstream's registry, which the desktop-v0.49.0 pin predates. The row window measures through a plain function of the element so the mount read stays a ref-derived layout measurement. * docs(scott-tasks): record the upstream sync to get-bb/bb 48c3a78 Names the new upstream base and every change the fork holds, with the reason for each. * fix(scott-tasks): settle the list's scroll scope during render, not from a ref ListView read settledScope.current during render, the one oxlint error left in scott-tasks (react(refs)), so bunx oxlint on the plugin failed. The settled scope is now state set during render, like the saved preference above it, and settles in the same render its rows finish loading. * fix(scott-tasks): stop an expired wake attempt from sending after a retry Promise.race ended the 30s wait but not the attempt, so a stalled thread lookup could resume after a retry had delivered and wake the parent twice. The deadline now aborts the attempt's signal, and the attempt re-checks right before threads.send (and before recording a target) that it is unexpired and still the latest claim on a pending record. Review's deterministic repro is the regression test; it fails on the old code. * chore(scripts): prune the resolved scott-tasks list refs baseline entry
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.
Human comments
What was wrong
Bundled plugins used local Node path rules or their own Windows detection for remote host paths. UNC paths, bare drive roots, separators, and ambiguous relative paths disagreed with the shared parser. Storage Retention could miss a live Windows checkout when its path used different casing.
What changed
Expose eight experimental host-path helpers through SDK 0.6.113 and migrate nine bundled plugins. Workflows and previews retain containment; Secrets still permits outside destinations. Update SDK minimums and Plugin Guide/API audit documentation. No daemon protocol, database, or lifecycle changes. Rebased onto main and swept the diff again, removing a redundant Docs wrapper and validation check. Stabilize the pre-existing Windows notification test by waiting for delivery without weakening its assertions. A follow-up review pass makes Storage Retention skip host paths it cannot parse instead of failing the whole scan, treating them as bb-owned so removal never deletes them, and replaces the remaining non-null assertions in Automations, Docs, and Monaco with explicit errors (an empty
--script-filename such as/now fails before reading).How you verified
Regression cases failed on the prior implementations and passed after migration, including active Windows checkout/workspace deletion guards. After rebase, Turbo passed 1,763 tests across all nine plugins, SDK, and Plugin Guide, plus 56 server documentation checks and affected lint/typechecks. The SDK version gate and diff checks passed. The notification regression test now waits for each persisted notice instead of assuming advancing fake timers finishes asynchronous delivery; its 11 focused/sibling tests and server lint/typecheck passed. Final CI on the rebased commit passed all 47 checks, with 4 skipped, including the previously failing Windows server job. For the follow-up, a new Storage Retention case (an unparsable project source next to a live checkout) and a new Automations case (
--script-file /) each failed on the prior commit and pass now; typecheck, tests, and lint passed for the four touched plugins.