Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,21 @@ session is bound to the environment it was spawned into; if the primary thread
moves, the reviewer is respawned rather than left inspecting the old checkout.

The reviewer's permission mode is negotiated per review against what the
provider actually advertises, narrowest first: `readonly` when bb offers it,
otherwise `accept-edits`. Pinning either would be wrong — `readonly` reports
every review as unavailable on a bb released before that mode existed, and
`accept-edits` keeps handing the reviewer workspace write access on a bb that
has something narrower. A session spawned under a wider mode is retired rather
than reused once a narrower one becomes available, so upgrading bb tightens
the reviewer without any action.
provider actually advertises, narrowest first. bb briefly offered a `readonly`
mode and removed it again, so on current bb the narrowest mode a reviewer can
be spawned in is `accept-edits`, and a provider that offers nothing narrower
than `auto` is reported as unable to host a reviewer. The preference stays a
list rather than a pinned value: once an SDK publishes a narrower mode, adding
it to `ADVISOR_PERMISSION_MODE_PREFERENCE` in `server.ts` is the whole change.

A session spawned under a mode that is no longer the negotiated one is retired
rather than reused — including a session left over from a bb that still had
`readonly` — so the reviewer never stays pinned to a mode the host can no
longer validate.

When the provider catalog cannot be read, the mode is probed narrowest-first
rather than assumed: the reviewer asks for `readonly`, and only a refusal
moves it to `accept-edits`. A mode the host accepted before is tried first, so
the probe costs nothing on the common path. A transient outage therefore
neither disables reviews nor silently widens them.
rather than assumed, and a mode the host accepted before is tried first. A
transient outage therefore neither disables reviews nor silently widens them.

## Inspect

Expand All @@ -261,13 +263,14 @@ bb plugin logs advisor -f
> database, and thread orchestration. Read the source before installing —
> this repository is small on purpose.

The reviewer itself is constrained by the negotiated permission mode, with one
caveat: bb only gained a first-class `readonly` mode recently, so on an older
build the reviewer is a behavioural boundary rather than an enforced one — it
is instructed to use read-only operations and runs in the narrowest mode
available, but it is not sandboxed. The exact tool set exposed in a given mode
remains the provider's responsibility, so provider-specific non-workspace
capabilities must still be assessed by that provider.
The reviewer itself is constrained by the negotiated permission mode, with an
important caveat: current bb has no read-only permission mode, so the reviewer
runs in `accept-edits` and **can write to the workspace**. Read-only review is
a behavioural boundary here, not an enforced one — the reviewer is instructed
to use read-only operations and runs in the narrowest mode available, but it is
not sandboxed. The exact tool set exposed in a given mode remains the
provider's responsibility, so provider-specific non-workspace capabilities must
still be assessed by that provider.

## Development

Expand Down
2 changes: 1 addition & 1 deletion app.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @vitest-environment jsdom
import { cleanup, fireEvent, waitFor, within } from "@testing-library/react";
import { afterEach, describe, expect, it } from "vitest";
import { loadPluginApp, renderSlot } from "@bb/plugin-sdk/testing/app";
import { loadPluginApp, renderSlot } from "@get-bb/plugin-sdk/testing/app";

const app = await loadPluginApp(() => import("./app"));

Expand Down
4 changes: 2 additions & 2 deletions app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import {
useRpc,
Markdown,
ThreadChat,
} from "@bb/plugin-sdk/app";
} from "@get-bb/plugin-sdk/app";
import type {
PluginRpcResult,
PluginThreadHeaderActionProps,
PluginThreadPanelProps,
} from "@bb/plugin-sdk/app";
} from "@get-bb/plugin-sdk/app";
import type { ModelConfiguration, rpcContract } from "./server";

const PANEL_ACTION_ID = "reviews";
Expand Down
Loading