Skip to content

Ability to intercept or emulate agent messages in plugins #14451

Closed

Description

@yurihbm

Question

I would like to know if there is a recommended way to:

  • Inject Agent Responses: Send a message that is visually and functionally treated as an "Assistant/Agent" output (including markdown/syntax highlighting).
  • Message Interception: A hook or middleware to intercept a message generated by the agent before it reaches the UI, allowing for real-time transformation.

Context

I am developing a plugin where I need to either intercept agent messages for transformation or send messages on behalf of the agent.

Current Behavior

Currently, using client.session.prompt with the noReply: true option allows sending a message to the session, but it has two main limitations for this use case:

  • User Role: The message is sent as the user, not the agent.
  • Formatting & Costs: These messages appear to consume input tokens and lack the syntax highlighting typically applied to agent outputs.

Activity

  1. added
    needs:complianceThis means the issue will auto-close after 2 hours.
    and removed
    needs:complianceThis means the issue will auto-close after 2 hours.
    on Feb 20, 2026
  2. github-actions commented on Feb 20, 2026

    @github-actions
    Contributor

    Thanks for updating the issue! It now follows the contributing guidelines and the needs:compliance label has been removed.

  3. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 20, 2026
  4. github-actions commented on Apr 22, 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

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions