Skip to content

Embedded ThreadChat should inherit compatible provider features #2967

Description

@iamhenry

The workflow

I use a custom OpenCode provider plugin with a separate Pins plugin that shows several BB threads side by side. Pins follows the intended host-component model: each column supplies a thread ID to the BB SDK ThreadChat, while BB owns the timeline, composer, drafts, queue, streaming, and permissions.

The workflow is:

  1. Open an OpenCode-backed thread in the normal BB thread view.
  2. Pin that same thread in the Pins layout.
  3. Pins renders <ThreadChat threadId={threadId} variant="full" layout="contained" />.
  4. Continue the same conversation from either place.

The core chat works in Pins, but only some provider functionality follows the thread. The custom provider therefore feels fully integrated in the native view and only partly integrated in the embedded view.

What happens today

Embedded ThreadChat already provides the important chat engine: timeline updates, sending, streaming, queueing, drafts, permissions, and restoration after remounting. Provider timeline and tool renderers follow the embedded thread provider. Composer customizations also receive an explicit per-thread scope.

Three gaps prevent the embedded full chat from behaving like the native full chat:

  1. Provider message actions do not appear. The host currently passes includePluginMessageActions={false} for embedded timeline and composer variants: PluginThreadChat.tsx.
  2. Native context-window usage is absent. The embedded composer receives contextWindowUsage={null}: EmbeddedThreadChat.tsx and queued composer.
  3. There is no supported per-chat identity seam for scoped content-script behavior. The embedded roots expose data-thread-window, but not the owning thread ID. With several visible chats, provider decorations that currently depend on the active route or document-wide DOM cannot reliably stay inside the correct column.

This was checked against bb main at b66c739543d4d78cba3b0ef318a78dc6b57abdc4. I searched open and closed issues for ThreadChat, embedded plugin actions, and context usage. I found the broader extension-lifecycle RFC #2900, but not this concrete embedded-chat capability request.

What you would expect

A full embedded ThreadChat should inherit the compatible features owned by the provider for that thread, without the embedding plugin knowing which provider is active or copying provider UI.

In plain English:

  • The same OpenCode thread should show the same applicable provider actions and native context usage in the normal thread view and in a full Pins column.
  • BB should provide extensions with a supported way to identify the exact thread/chat instance they are attached to. A documented DOM attribute is one option; an SDK-level scoped extension surface would also satisfy the need.
  • Actions that require a surface unavailable in embedded chat, such as the main thread side panel, should remain unavailable or return false without breaking the chat.
  • Compact consumers should keep their intentional compact behavior.
  • Adding a future compatible provider extension should not require a Pins release.

Acceptance criteria:

  • A provider-backed thread in native and full embedded views shows matching applicable provider actions and context usage.
  • Multiple visible ThreadChat instances keep actions, decorations, and composer updates scoped to their own thread.
  • Non-matching providers do not receive provider-specific actions.
  • Existing compact ThreadChat consumers do not unexpectedly gain full-view chrome.
  • Embedding plugins do not manually forward provider actions or import provider components.

Context and alternatives

Pins could populate the per-instance messageActions prop, but that would make Pins depend directly on OpenCode and require Pins changes whenever the provider adds an action. Recreating the context meter or provider controls in Pins has the same maintenance problem. Both workarounds defeat the purpose of using host ThreadChat.

Blindly enabling every global plugin action may also be unsafe: some third-party actions assume a single main composer or require a side panel. A provider-aware compatibility policy would be safer. If provider ownership cannot be determined reliably, one generic embedded-extension policy is preferable to feature-specific props such as showOpenCodeChips or showContextRing.

This follows existing plugin practice. Cascade delegates each column to host ThreadChat and explicitly leaves chat behavior to the host: https://github.com/SawyerHood/bb-plugin-cascade/blob/507f96047e4587f4ae1eb04b1fb2b28b5ae7cd31/app.tsx

  • I searched open and closed issues for the same request.
  • If an agent wrote this, the body ends with > AGENT GENERATED.

AGENT GENERATED

Activity

  1. added
    plugins
    ui
    on Sep 2, 2026
  2. bb-slop-cop commented on Sep 2, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Classification applied: Type Feature, Priority Medium, Effort High.

    Labels: plugins, ui.

    No reproduction report or pull request was required because the final Type is not Bug.

  3. iamhenry commented on Sep 2, 2026

    @iamhenry
    ContributorAuthor

    @SawyerHood @ymichael my agent wrote the issue, but basically i need a way to get the custom features from my custom opencode provider into the ThreadChat api so that my opencode plugin could user native opencode sdk features like revert/edit etc.

    Currently the api doesnt expose this so my opencode plugin provider does work but only if it's in the "Thread Page"

    Image

    the limitations of the "thread chat" makes for a thread within my pins plugin to lack features like native bb cards (used for subagents, etc)

    from the image below you see its missing the cards that sit above the composer, which i really miss.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    pluginsui

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions