Repository navigation
Description
Problem
Plugins can create threads with threads.spawn and threads.fork, but they cannot attach private plugin-owned metadata for use when configuring the new thread. Plugins must instead use external storage or place coordination data somewhere user-visible.
Here's a fork where I've implemented a solution: https://github.com/samanthar0se/bb/tree/fix/plugin-launch-context-remediation
Proposed behavior
Add an optional pluginLaunchContext value to plugin threads.spawn and threads.fork calls.
- Accept finite JSON values up to 16 KiB after normalization.
- Validate the original value before transport and validate it again at the server boundary.
- Bind supplied context to the calling plugin and persist it atomically with the thread.
- Expose it only to that plugin during agent configuration. Freeze the context envelope and value before delivery.
- Copy context during a fork only when the caller supplies a new value. Never inherit it from the source thread.
- Preserve existing spawn and fork behavior when the field is absent.
- Keep the context out of thread DTOs, prompts, provider input, and ordinary host or provider protocols.
This metadata is coordination data, not a place for secrets and not an authorization mechanism.
Example
const thread = await bb.threads.spawn({
prompt: "Help the user review this draft",
pluginLaunchContext: { workflowId: "review-42", step: 2 },
});The plugin can read that value when resolving configuration for thread, without exposing it through normal thread APIs.
Acceptance criteria
- Spawn and fork accept an optional JSON launch context.
- Invalid, unsafe, or oversized values fail before the network request.
- The server independently enforces the same validation and plugin ownership.
- Persistence is atomic with thread creation.
- Configuration receives the persisted context as frozen runtime data.
- Forks do not inherit source context unless the caller supplies context explicitly.
- Existing callers that omit the field behave exactly as before.
- Public thread data and model-facing payloads do not expose the context.
- The fake plugin host follows the same new-field behavior for plugin tests.
- Existing databases migrate without losing thread or title-search data.
Activity
bb-slop-cop commentedon Sep 10, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotApplied Type: Feature, Priority: Medium, Effort: High, and labels:
plugins,threads. All classification fields were previously empty; verified the final values.This adds plugin API behavior and persisted coordination data, with external storage available as a workaround. No reproduction report or pull request: the final Type is Feature, so the rule skips those steps.
feat(plugin-sdk): add thread plugin metadata with review fixes (get-b…