Repository navigation
Make the side-chat plugin the only side chat - #957
Conversation
|
🚨 SLOP COP 🚨 · I am SlopCop. I started the review of PR #957. I will check security, code quality, performance, architecture, and the end-to-end behavior. I will post an update after each phase. |
|
🚨 SLOP COP 🚨 · End-to-end phase complete. Result: pass. I tested the exact pull request SHA in a clean development instance. The message action opened the plugin side chat. The new-tab action also opened it. The experiment page did not show a side-chat gate. |
|
🚨 SLOP COP 🚨 · Performance phase complete. Result: one medium finding. The default plugin now starts an hourly cleanup task on each install. That task reads all fork threads, including archived forks, and then filters them in JavaScript. Its cost grows with the thread history. |
|
🚨 SLOP COP 🚨 · Security phase complete. Result: no actionable security issue. The removed experiment controlled a feature. It did not control trust or authority. The server still validates fork requests and permission modes. Strict input checks remain on both side-chat RPC methods. |
| defaultEnabled: true, | ||
| experiment: "sideChatPlugin" as const, | ||
| }, | ||
| { name: "side-chat", pluginId: "side-chat", defaultEnabled: true }, |
There was a problem hiding this comment.
🚨 slopcop/review — The default plugin now starts an unbounded hourly thread scan
Removing this gate loads the side-chat plugin on each default install. Its hourly empty-fork-cleanup task lists all hidden fork threads. It omits an archived filter and a limit. It then filters the plugin identifier in JavaScript.
Each run reads active and archived forks from the full install history. The cost grows without a bound. Add an originPluginId query filter and archived: false. Use fixed-size pages if the API needs pagination.
|
🚨 SLOP COP 🚨 · Code-quality and architecture phase complete. Result: two medium cleanup items and several low residue items. The removed native path left an unused selection sequence field. It also left an unused embedded-chat send-to-main property. I also found stale comments and one inconsistent legacy title contract. The gate removal does not duplicate another runtime policy. The plugin is now the single side-chat implementation. The affected type checks passed. The database migration tests passed with 355 tests. The selected application tests passed with 101 tests. |
| ? ({ kind: "open-plugin-side-chat", threadId: sourceThreadId } as const) | ||
| : null; | ||
| const sourceLink = | ||
| sourceThreadId === null || sideChatAction !== null |
There was a problem hiding this comment.
🚨 slopcop/review — Keep the legacy side-chat title model consistent
This function still accepts sourceIsSideChat, but the value no longer affects sourceLink. A legacy side-chat source now receives a normal thread link in the returned title model.
The renderer hides that link with a separate check, so the current screen hides the contract error. Another title consumer can expose the wrong link. Include sourceIsSideChat in this guard, or remove the field from this contract and update the tests.
| @@ -137,7 +135,6 @@ export interface ThreadTimelineRowsProps { | |||
| /** Add a complete agent message to the composer draft. */ | |||
| onMessageAddToChat?: ThreadTimelineAddToChatHandler; | |||
| /** Open a side chat anchored on a specific agent message. */ | |||
There was a problem hiding this comment.
🚨 slopcop/review — Remove the comments that belonged to deleted props
The next line now documents onSendToMainMessage as both a side-chat opener and a send-to-main action. The selection side-chat comment at lines 146-149 also sits above consumerMessageActions.
Delete both old comment blocks. They now describe properties that this change removed.
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Review complete for 40be9f1a5bae5470d679f3e4f4835fdc923950d5.
I found one medium performance issue. The default plugin now starts an unbounded hourly fork-thread scan on each install. Use server-side plugin and archive filters. Use fixed-size pages if the API needs pagination.
I found two medium cleanup items. MessageProseSelection.sourceSeqEnd has no reader. EmbeddedThreadChat.onSendToMainMessage has no supplier after this removal.
I found two low code-quality issues inline. The legacy title model now contains an unused input and a wrong internal link. Two comments now document removed properties.
I found no security issue. The experiment gate did not enforce trust or authority. The server still validates forks, inputs, and permission modes.
I found no duplicate side-chat implementation after this change. The plugin now owns the full side-chat behavior.
The end-to-end test passed on the exact SHA. The message action opened a plugin side chat. The new-tab action opened another side chat. The experiment page had no side-chat gate.
All GitHub checks pass. Three affected package type checks passed. The database suite passed 355 tests. The selected application suite passed 101 tests.
I used a comment review. I did not approve the pull request or request changes.
|
Fixed in 3b0c214. The finding is correct, and it also violated the repo's own "do not load all rows and filter in JavaScript" rule — the sweep was reading every fork thread and narrowing in JS. Rather than filter after the read, I added an One subtlety worth flagging: archiving removes a row from the Full typecheck and test pass across the touched packages. |
The builtin `side-chat` plugin is now the only side chat. It ships enabled by default, so the `sideChatPlugin` experiment that used to gate it is gone, and with it the per-plugin experiment gate in the bundled registry and the plugin runtime — no other plugin used it. Deleted native surfaces: the side-chat tab deck and tab content, the message-anchored create request, the per-message "Reply in side chat" action, the selection-menu action, the new-tab launcher entry, and the `open-side-chat` timeline title action. The plugin already provides a message action, a selection action, and a panel launcher for all of them. Persisted data is kept readable. Threads keep `originKind: "side-chat"`, and the thread-tabs contract keeps the `side-chat` kind, so old rows still parse. The app drops those tabs on read — at the stored-state parse boundary and in the server-tab reconcile — so they disappear from the strip instead of failing the load. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Now that the plugin is installed by default, its hourly sweep runs on every install. It listed every fork thread — other plugins' forks and archived rows included — and narrowed the set in JavaScript, so each run's cost grew with total thread history. Add an `originPluginId` filter to the thread list query (contract, db, route, SDK) and use it, with `archived: false`, so the sweep reads only this plugin's live forks. Page through the result with a fixed limit. Archiving removes a row from the `archived: false` set the sweep pages through, so the offset advances by the number of forks the page left behind rather than by a full page — advancing by a page would skip that many unswept forks. The archive cascade takes the same filters. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Removing the native side chat left the "Message from side chat" row inert. Its name suppressed the normal thread link because the side chat opened as a panel tab instead, and that tab is gone — so the pill had neither a link nor an action. Legacy side chats are excluded from the project listings, which made the thread unreachable except by a hand-typed URL. Fall back to the thread route link for a legacy side chat, so its name opens the conversation as a full thread. The plugin's own forks keep suppressing the link, because their title action opens the plugin panel. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Old side chats were unreachable after the native UI went away: they are
excluded from the project listings, so only the handoff message linked to
them. Migration 0084 now hands every `origin_kind = 'side-chat'` row to the
plugin as a hidden fork, so an old side chat reopens in the plugin's panel
exactly like a new one. A row with no source thread cannot be reopened at
all, so it drops the origin kind instead of stranding a removed value.
With no rows left carrying it, `side-chat` leaves the origin-kind enum, and
everything keyed on it goes:
- the server's archive cascade (the plugin cascades its own forks),
- the create-time visibility default, title fallback, and permission
snapshot,
- the side-chat exclusions for dynamic tools, plugin instructions, the
environment-directory tool, and approval requests,
- the legacy readonly permission inheritance,
- `excludeSideChats` / `excludeOriginKind` and the app filters behind them,
all redundant with the existing hidden-thread exclusion,
- the `sourceIsSideChat` presentation branch,
- `--origin-kind side-chat` in the CLI.
`PluginAgentConfigurationContext.sideChat` goes too: it would always be
false. `origin` already carries `{ kind: "fork", pluginId: "side-chat" }`,
which is what the plugin reads.
Two behavior notes. A side chat may now be a parent thread — the old guard
rejected side-chat parents, and generalizing it to hidden threads broke
plugins that legitimately parent under their own hidden threads, so it is
gone and the depth cap still bounds the hierarchy. A migrated side chat that
recorded the pre-0078 `readonly` mode now normalizes to `accept-edits`
instead of inheriting its source's effective mode, which is the more
restrictive direction.
The two migrations in this branch are merged into 0084.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Rebase fixups: main added parent-notice and ownership tests plus a visibility-inheritance rewrite of thread creation, all of which named the removed `side-chat` origin kind. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
89bea9a to
fdd0245
Compare
|
🚨 SLOP COP 🚨 · I am the SlopCop. I started the security, code quality, performance, architecture, and end-to-end review phases. |
The workspace-wide typecheck reaches every plugin, not just the packages I filtered: three plugin harnesses built a `sideChat` context and the cascade example passed `excludeSideChats`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
🚨 SLOP COP 🚨 · Security review completed. It found two regressions in the new plugin-owned side-chat identity. Side chats can change their workspace directory. They can also request command, file, network, and permission grants. I will add exact inline comments after final verification. |
|
🚨 SLOP COP 🚨 · I am SlopCop. I started the review for PR #957. I will review security, code quality, architecture, performance, and the main user flow. I will post an update after each phase. |
|
🚨 SLOP COP 🚨 · Security phase complete. The review found two policy risks for the plugin-owned side chat:
The focused security checks found no XSS, SQL injection, secret, dependency, URL, or path-injection problem. I will verify these policy findings in the final synthesis. |
|
🚨 SLOP COP 🚨 · Performance phase complete. The net run-time effect is positive. The change removes repeated experiment queries, extra frontend mounts, and several complex filters. The phase found these problems:
The browser test could not start. The approved launcher required writes outside the review sandbox. The focused tests and four package typechecks passed. |
Two findings from the SlopCop security phase, both real. The approval banner only ever rendered in the main thread view, so once the plugin panel became the only side-chat surface an approval requested there waited on a prompt nobody could reach. The embedded chat now swaps its composer for the pending interaction the same way the main view does. A plugin-owned interaction keeps its own composer, so the draft survives. Archiving a source thread also stopped cascading to its side chats unless the plugin was enabled, because the plugin had taken that over. The cascade goes back to BB and is now structural: a hidden fork has no row of its own to reach, so it retires with its source whatever plugin created it. The plugin's duplicate listener is gone. I tried to restore the old approval and environment-directory guards on a thread-shape axis first. Both attempts failed: blocking hidden threads breaks the hidden-delegated-child flow, and blocking hidden non-notifiable threads breaks hidden forks that keep a parent. Only `originPluginId` separates a side chat from those, so the guards stay off and the panel renders the prompt instead. Also drops a 2.6 MB CLI build directory a stray `git add -A` swept in, and gitignores the temp root so it cannot recur. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
a1a8a25 to
32a508c
Compare
|
🚨 SLOP COP 🚨 · I am the SlopCop. I am reviewing this pull request for security, code quality, performance, architecture, and end-to-end behavior. I will use three parallel BB review threads. I will post a comment after each review phase. |
|
🚨 SLOP COP 🚨 · Code quality and architecture phase complete. The phase confirmed these material problems:
The cleanup query issue is low priority. The main architecture recommendation is to keep durable lifecycle work in the server. The phase found one intentional legacy item. The stored thread-tab |
|
🚨 SLOP COP 🚨 · End-to-end phase complete. I tested pull request head 32a508c in a local development service. I created a main thread and used the message action. The action opened the Side chat plugin panel. The panel sent a message and received The database created a hidden fork. It set I found no end-to-end defect in this path. |
| }); | ||
|
|
||
| const { environment, thread } = requireThreadEnvironment( | ||
| const { environment } = requireThreadEnvironment( |
There was a problem hiding this comment.
🚨 slopcop/review — Side-chat approvals can block with no response control
This change removes the server rejection, so the route registers side-chat approval requests. The plugin uses EmbeddedThreadChat. That surface does not query or show pending interactions. A command or permission request can stop the turn with no Allow or Deny control. Add pending-interaction controls to EmbeddedThreadChat, or keep the rejection until that UI exists.
| ...childThreads, | ||
| ...sideChatThreads, | ||
| ].filter((thread) => thread.id !== args.parentThread.id); | ||
| // Side chats cascade through their owning plugin's `thread.archived` |
There was a problem hiding this comment.
🚨 slopcop/review — The side-chat archive cascade is not durable
This code moves a lifecycle guarantee to a fire-and-forget plugin event. The dispatcher finds handlers on the next macrotask. A disabled, failed, or reloaded plugin can miss the event. A handler failure only writes a log. The hidden fork then remains active after its source enters the archive. Keep this cascade in the server lifecycle, or use a durable event queue with retry.
| @@ -0,0 +1,11 @@ | |||
| import { definePluginApp, useComposerView } from "@bb/plugin-sdk/app"; | |||
There was a problem hiding this comment.
🚨 slopcop/review — Remove the temporary CLI build directory
This test-created directory adds 6.9 MB and 59,018 generated lines. It also causes git diff --check failures. Delete the complete .packaged-plugin-build-f8YR4Z directory. Add .packaged-plugin-build-* to an applicable ignore file to prevent another accidental commit.
| originPluginId: bb.pluginId, | ||
| archived: false, | ||
| limit: EMPTY_FORK_SWEEP_PAGE_SIZE, | ||
| offset, |
There was a problem hiding this comment.
🚨 slopcop/review — The hourly sweep repeats a full sorted query for each offset page.
This public list path joins pending interactions. It also groups and sorts before it applies the limit and offset.
The database has no index that starts with origin_plugin_id. SQLite uses the archived-status index and scans all active threads.
Each page repeats that work. The offset can also skip one row when a new side chat enters an earlier page.
Please use a dedicated keyset query. Add an index for the plugin, archive state, and cursor fields.
| // A hidden fork (a side chat, say) has no row of its own to reach, so it | ||
| // retires with its source. Structural rather than plugin-owned: archiving | ||
| // must not depend on whichever plugin created the fork still being enabled. | ||
| const hiddenSourceThreads = listUnarchivedHiddenSourceThreads(deps.db, { |
There was a problem hiding this comment.
🚨 slopcop/review — The normal archive route does not run this cascade.
This cascade only runs through archiveThreadAndChildren. The normal POST /threads/:id/archive route calls archiveThreadWithLifecycleEffects directly.
The removed plugin listener ran after both archive routes. After this change, a direct normal archive leaves hidden side-chat forks active.
Please move the hidden-source cascade into the common archive path. You can also route both public archive actions through this helper.
|
🚨 SLOP COP 🚨 · Code quality and architecture phase complete. I found one medium defect. The normal archive route no longer archives hidden side-chat forks. I also found stale instructions and dead legacy fields. These names include The pull request removes much duplicate native side-chat code. The plugin now owns the side-chat UI and creation policy. |
|
🚨 SLOP COP 🚨 · Performance phase complete. I found one low performance risk. The hourly cleanup uses offset pages through the general thread-list route. Each page repeats a joined, grouped, and sorted query. The database has no index that starts with I recommend a dedicated keyset query and a matching index. |
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
I found three medium problems.
- Approval requests now reach plugin side chats, but
EmbeddedThreadChathas no pending-interaction controls. A turn can stop with no response action. - The archive cascade now uses a fire-and-forget plugin event. A plugin stop or reload can leave a hidden fork active.
- A temporary CLI build adds 6.9 MB and 59,018 generated lines to the pull request.
Please fix these three inline findings before merge.
Non-blocking cleanup remains. Remove the ignored excludeSideChats app field. Update stale plugin contracts and the plugin-authoring skill. Correct migration 0085 to 0084. Review the cleanup query index at larger scale.
The architecture scan recommends two boundaries. Keep durable thread lifecycle work in the server. Derive list filters and cache keys from one shared contract.
All required GitHub checks pass. The focused test suites and four package typechecks also pass. The browser test remains unverified because the approved launcher could not write outside the review sandbox.
This review used a comment only. It did not approve or request changes.
| -- needs both ids), and `side-chat` is no longer a valid origin kind. Drop the | ||
| -- origin rather than strand an unreadable value; the thread itself is kept. | ||
| UPDATE `threads` | ||
| SET `origin_kind` = NULL |
There was a problem hiding this comment.
🚨 slopcop/review — Source-less legacy side chats remain hidden after this migration.
Migration 0079 set every legacy side chat to visibility = hidden. This statement clears the origin, but it does not restore visibility.
The result has no source, no plugin owner, and no visible list entry. No panel can reopen it.
Please set visibility = visible when this statement clears the old origin. Please also test the row after migrations 0079 and 0084 run in sequence.
|
🚨 SLOP COP 🚨 · Security phase complete. I found no direct injection, authorization, rendering, or daemon protocol defect. The approval and parent-thread policy changes are explicit pull request behavior changes. I did not report them as security defects. I found one low data migration defect. A source-less legacy side chat keeps hidden visibility after it loses its old origin. |
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Review complete for head 32a508c0.
Findings:
- Medium:
POST /threads/:id/archivebypasses the new hidden-fork cascade. Direct public API callers can leave side chats active. - Low: migration 0084 clears the origin of a source-less side chat but keeps the thread hidden and unreachable.
- Low: the hourly cleanup repeats a joined, grouped, and sorted thread query for each offset page.
Security review found no direct injection, authorization, unsafe rendering, or daemon protocol defect.
Architecture review found useful duplicate removal. The side-chat plugin now owns the UI and creation policy.
Some stale legacy surfaces remain. The plugin-authoring skill still documents sideChat. The CLI skill still documents the removed experiment.
The app also keeps dead fields and wrappers. Examples include excludeSideChats, senderChildOrigin, and the no-op title fallback wrapper.
Validation:
- The browser test passed. The plugin panel opened, sent a reply, and created the correct hidden fork.
- Targeted type checks passed for six affected packages.
- Plugin SDK tests passed: 74 tests.
- Side-chat plugin tests passed: 26 tests.
- Database tests passed: 357 tests.
- Tasks plugin tests passed: 327 tests.
- Server tests passed 1,315 of 1,316 tests.
- The one server failure is in an unchanged machine-install path. The same test failed again alone.
- The broad app test run stopped after the server failure.
I posted three inline comments for the confirmed defects.
Four findings, all real. Archiving a single thread stopped cascading to its hidden forks. Only archive-all kept the cascade when I moved it off the plugin's `thread.archived` listener, and that listener had covered both routes. The plain route now archives the forks that retire with their source. A legacy side chat with no source thread lost its origin but kept hidden visibility, leaving an unreachable orphan. The migration makes it visible: it is nobody's fork now, so its own row is the only way back to it. The sweep's new query filters on `origin_plugin_id` with no index to serve it, so 0084 adds one. `CREATE INDEX IF NOT EXISTS` because the migrate suite replays the chain, and the rewind helper drops the index before the column it covers — SQLite will not drop an indexed column. `senderChildOrigin` was still threaded through the conversation row but never read after the legacy branch went away, and `excludeSideChats` lingered in the app's query types. Both are gone. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
🚨 SLOP COP 🚨 · I am the SlopCop. I started the security, code quality, performance, architecture, and end-to-end review for commit |
|
🚨 SLOP COP 🚨 · End-to-end phase complete for I started the exact target commit with a new data directory. I created a root thread and opened a side chat from an assistant message. The quoted message appeared in the panel. The side chat returned Result: pass. I found no end-to-end defect in this flow. |
|
🚨 SLOP COP 🚨 · Performance phase complete for I found two medium findings in the hourly side-chat sweep:
The current pull request tip already adds the missing index. The repeated timeline work still needs review against the target commit. |
|
🚨 SLOP COP 🚨 · Security phase complete for I reviewed thread ownership, plugin attribution, workspace changes, archive behavior, request validation, and data access. I found no clear security exploit. Plugins already run as full-trust code, so plugin ID impersonation does not create a new trust boundary. The change lets a side chat use the standard environment-directory tool. This increases its authority, but it matches the authority of its source thread. I will record it as a design note, not a security defect. |
|
🚨 SLOP COP 🚨 · Code quality and architecture phase complete for I found these actionable problems:
The architecture now has one clear side-chat owner. The remaining duplicate concepts are stale contracts and documentation, not a second implementation. |
| createdAt: number, | ||
| ): Promise<boolean> { | ||
| try { | ||
| const timeline = await bb.sdk.threads.timeline({ |
There was a problem hiding this comment.
🚨 slopcop/review — Avoid a complete timeline read for every old live side chat
A side chat with a user message returns false and stays in this hourly candidate set forever. Each sweep reads its complete nested timeline and then reads its queued messages. The work grows with all retained side chats, not only empty chats. Record the nonempty result, or request the smallest timeline page that can prove user work exists.
| ) { | ||
| throw new Error("--origin-kind must be fork or side-chat."); | ||
| if (opts.originKind !== undefined && opts.originKind !== "fork") { | ||
| throw new Error("--origin-kind must be fork."); |
There was a problem hiding this comment.
🚨 slopcop/review — Update the discoverable CLI and plugin documentation
+This command now rejects side-chat, but bb-guide-threads.md still says --origin-kind accepts side-chat. The built-in bb-cli skill also says the removed experiment controls the plugin. docs/plugin-sidebar-thread-list.md still lists "side-chat" in originKind. These surfaces will direct users and agents to an invalid command. Update them in this change, as required by docs/cli-guide-and-skill.md.
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Review complete for requested commit 32a508c.
The pull request now points to b655f17. That tip corrects four findings from the requested commit:
- The single-thread archive route now archives hidden source forks.
- Migration 0084 now makes source-less legacy side chats visible.
- The sweep now has an
origin_plugin_idandarchived_atindex. - The app no longer accepts the removed
excludeSideChatsfilter.
Two actionable findings remain at the current tip:
- Medium: The hourly sweep reads each old side chat's complete nested timeline. Nonempty side chats return to this candidate set every hour.
- Medium: The CLI guide and built-in skill still describe the removed
side-chatvalue and experiment. Plugin documentation also retains the old origin kind.
Several dead parameters and stale comments remain after removal of the native path. These items are low-risk cleanup work.
Security review found no clear exploit. The architecture now has one side-chat owner, with stale contracts limited to documentation and cleanup items.
Validation results:
- All four affected package typechecks passed.
- The side-chat plugin passed 26 tests. The database passed 357 tests.
- The server passed 1,315 of 1,316 tests. One unrelated machine-install test failed twice after its host daemon exited during enrollment.
- The exact target commit passed the browser flow. A side chat opened, returned a response, and sent that response to the main thread.
I left this as a comment review. I did not approve the pull request or request changes.
Two remaining findings from the SlopCop review. The hourly sweep read the full timeline and queued messages of every live side chat older than a day, every hour, forever — including the ones a user had actually replied in, which can never become empty. That work grew with the thread history and never paid off. A fork found to hold user work is now recorded in plugin KV and skipped on later sweeps. A read failure records nothing, so a bad hour does not retire a fork from the sweep. Keys whose fork no longer appears in the live set are pruned, so the store tracks live kept forks rather than growing forever. The CLI guide still advertised `--origin-kind side-chat`, described archive as cascading to "side chats", and the plugin sidebar doc still listed `side-chat` as an origin kind. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The builtin `side-chat` plugin becomes the only side chat. It already
ships enabled by default, so the `sideChatPlugin` experiment that gated
it is gone — and with it the per-plugin experiment gate itself, since no
other plugin used it.
Existing side chats are migrated rather than stranded, which is what
lets the legacy origin kind be removed outright.
## Migration
`0084` hands every `origin_kind = 'side-chat'` row to the plugin as a
hidden fork. Two earlier migrations did the setup work — `0038`
backfilled `child_origin`/`parent_thread_id` onto
`origin_kind`/`source_thread_id`, and `0079` hid every side chat — so
only two columns move:
```sql
UPDATE threads SET origin_kind = 'fork', origin_plugin_id = 'side-chat'
WHERE origin_kind = 'side-chat' AND source_thread_id IS NOT NULL;
```
An old side chat then reopens in the plugin's panel exactly like a new
one. A row with no source thread cannot be reopened at all (the panel
needs both ids), so it drops the origin kind instead of stranding a
removed value. The two migrations this branch started with are merged
into this one.
## What is removed
- **Experiment**: `sideChatPlugin` in the domain schema, the
`side_chat_plugin` column, the Settings toggle, the CLI key,
`onExperimentsChanged`, and the gate machinery in the plugin runtime,
activation, registration, and service layers.
- **Native side chat**: the tab deck and tab content,
`side-chat-create-request`, the per-message and selection "Reply in side
chat" actions, the new-tab launcher entry, and the `open-side-chat`
timeline title action. The plugin already registers all of these.
- **The `side-chat` origin kind**, and everything keyed on it: the
server archive cascade (the plugin cascades its own forks), the
create-time visibility default / title fallback / permission snapshot,
the side-chat exclusions for dynamic tools, plugin instructions, the
environment-directory tool and approval requests, the legacy readonly
permission inheritance, `excludeSideChats` / `excludeOriginKind`
(redundant with the existing hidden-thread exclusion), the
`sourceIsSideChat` presentation branch, and `--origin-kind side-chat`.
- **`PluginAgentConfigurationContext.sideChat`**, which would always be
false. `origin` already carries `{ kind: "fork", pluginId: "side-chat"
}`, which is what the plugin reads.
## Behavior changes worth review
1. **A side chat may now be a parent thread.** The old guard rejected
side-chat parents. Generalizing it to hidden threads broke plugins that
legitimately parent under their own hidden threads (caught by
`plugin-sdk.test.ts`), so the guard is gone; the depth cap still bounds
the hierarchy.
2. **Migrated side chats lose the native safety carve-outs** — no
approval-request rejection, no environment-directory block, no blanket
dynamic tools. These never applied to the plugin's forks, so this aligns
old rows with how every side chat has behaved since the plugin shipped.
3. **A migrated side chat that recorded the pre-0078 `readonly` mode**
normalizes to `accept-edits` instead of inheriting its source's
effective mode — the more restrictive direction.
4. **The plugin's cleanup sweep now covers migrated rows**, so a side
chat older than 24h that never received a user message gets archived.
Recoverable, and the sweep's intent.
## Also fixed here
SlopCop flagged the plugin's hourly `empty-fork-cleanup` as an unbounded
scan once the plugin installs by default — it listed every fork thread
and narrowed in JavaScript, against the repo's own "don't filter in JS"
rule. Added an `originPluginId` filter end to end (contract, db `WHERE`,
route, SDK); the sweep now queries `originKind` + `originPluginId` +
`archived: false` and pages with a fixed limit. The offset advances by
the forks each page *left behind*, since archiving removes rows from the
set being paged — a full-page step would skip that many unswept forks.
Tested.
## Verification
`typecheck`, `test`, and `lint` pass for every touched package and the
side-chat plugin. One pre-existing `@bb/server` failure is local only:
`internal-skill-trees.test.ts` expects file mode `0644` and my umask
gives `0664` — it fails identically on `main` and passes in CI.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
The builtin
side-chatplugin becomes the only side chat. It already ships enabled by default, so thesideChatPluginexperiment that gated it is gone — and with it the per-plugin experiment gate itself, since no other plugin used it.Existing side chats are migrated rather than stranded, which is what lets the legacy origin kind be removed outright.
Migration
0084hands everyorigin_kind = 'side-chat'row to the plugin as a hidden fork. Two earlier migrations did the setup work —0038backfilledchild_origin/parent_thread_idontoorigin_kind/source_thread_id, and0079hid every side chat — so only two columns move:An old side chat then reopens in the plugin's panel exactly like a new one. A row with no source thread cannot be reopened at all (the panel needs both ids), so it drops the origin kind instead of stranding a removed value. The two migrations this branch started with are merged into this one.
What is removed
sideChatPluginin the domain schema, theside_chat_plugincolumn, the Settings toggle, the CLI key,onExperimentsChanged, and the gate machinery in the plugin runtime, activation, registration, and service layers.side-chat-create-request, the per-message and selection "Reply in side chat" actions, the new-tab launcher entry, and theopen-side-chattimeline title action. The plugin already registers all of these.side-chatorigin kind, and everything keyed on it: the server archive cascade (the plugin cascades its own forks), the create-time visibility default / title fallback / permission snapshot, the side-chat exclusions for dynamic tools, plugin instructions, the environment-directory tool and approval requests, the legacy readonly permission inheritance,excludeSideChats/excludeOriginKind(redundant with the existing hidden-thread exclusion), thesourceIsSideChatpresentation branch, and--origin-kind side-chat.PluginAgentConfigurationContext.sideChat, which would always be false.originalready carries{ kind: "fork", pluginId: "side-chat" }, which is what the plugin reads.Behavior changes worth review
plugin-sdk.test.ts), so the guard is gone; the depth cap still bounds the hierarchy.readonlymode normalizes toaccept-editsinstead of inheriting its source's effective mode — the more restrictive direction.Also fixed here
SlopCop flagged the plugin's hourly
empty-fork-cleanupas an unbounded scan once the plugin installs by default — it listed every fork thread and narrowed in JavaScript, against the repo's own "don't filter in JS" rule. Added anoriginPluginIdfilter end to end (contract, dbWHERE, route, SDK); the sweep now queriesoriginKind+originPluginId+archived: falseand pages with a fixed limit. The offset advances by the forks each page left behind, since archiving removes rows from the set being paged — a full-page step would skip that many unswept forks. Tested.Verification
typecheck,test, andlintpass for every touched package and the side-chat plugin. One pre-existing@bb/serverfailure is local only:internal-skill-trees.test.tsexpects file mode0644and my umask gives0664— it fails identically onmainand passes in CI.🤖 Generated with Claude Code