Skip to content

[FEATURE]: Add plugin session webview bridge with safe file write and global asset routing #15747

Closed as not planned

Description

@alotth
  • I have verified this feature I am about to request has not been suggested before.

Plugin authors need a first-class way to render session webviews and communicate with OpenCode securely.

Today, interactive plugin UI and safe write-back flows require ad-hoc workarounds.

Proposed scope:

  • Allow plugin session UI contributions (ui.session.tabs and ui.session.buttons)
  • Introduce a minimal webview bridge protocol:
    • host handshake: opencode.bridge.host
    • webview request: opencode.bridge.request
    • host response: opencode.bridge.response
  • Add base bridge actions:
    • file.read
    • file.write with optimistic concurrency (expectedHash)
  • Serve plugin webview assets from a stable route:
    • /global/plugin/<plugin-id>/<asset-path>
  • Handle CORS preflight for global plugin paths used by webview integrations

Why this helps:

  • Enables richer plugin UX directly in session workflows
  • Makes plugin-to-host communication explicit and secure
  • Supports safer plugin-driven file updates and reduces stale-write conflicts
  • Improves reliability of plugin webview loading across environments

Related to #11249 and #6330

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 2, 2026
  2. github-actions commented on Mar 2, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of or significantly overlap with existing issues. Please check:

  3. alotth commented on Mar 2, 2026

    @alotth
    Author

    Thanks for the duplicate check.

    I believe this issue is related to #6330 but not a duplicate.

    #6330 proposes a broader, generic cross-client UI intent channel.
    This issue proposes a concrete, narrower implementation path focused on plugin session webviews:

    • ui.session.tabs / ui.session.buttons
    • webview bridge handshake/request/response
    • base bridge actions (file.read, file.write with expectedHash)
    • stable global plugin asset route
    • CORS preflight for global plugin paths

    So this can be treated as an incremental delivery step that may complement #6330.

  4. alotth commented on Mar 5, 2026

    @alotth
    Author

    Im motivate to do this, because I'm working now in orchestration of the agents by visualizing the kanban tasks and roadmaps, integrating on opencode by this plugin https://github.com/alotth/mapctx/tree/main/packages/opencode-plugin with the patterns that this PR adds.

    Image Image
  5. assigned and unassigned on Apr 26, 2026
  6. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  7. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions