Skip to content

[FEATURE] Plugin hook for streaming text transformation (e.g. text.delta) #39526

Closed as not planned

Description

@razavioo

Description

  • I have verified this feature I'm about to request hasn't been suggested before.

Currently, plugins can hook into the AI's response via the experimental.text.complete event, which fires after the full message has been generated.

For plugins that format or transform text (such as the opencode-rtl plugin which adds Unicode BiDi isolates to make right-to-left text readable), this means the text streams in "broken" (scrambled) and only fixes itself once the entire response is finished.

Proposed Solution

Add a streaming hook, such as experimental.text.delta or experimental.text.partial, that allows plugins to intercept and transform text chunks as they arrive from the LLM, before they are rendered to the UI (CLI or Desktop).

Example hook signature:

interface TextDeltaEvent {
  delta: string;       // The new chunk of text
  fullText: string;    // The accumulated text so far
  transform: (newDelta: string) => void;
}

Or simpler, just allow a synchronous map function over the stream:

plugin.on('text.stream', (chunk: string) => {
   return applyBidiIsolates(chunk);
});

Context

This is critical for any plugin attempting to do real-time formatting, translating, or text manipulation where the user experience suffers if they have to watch raw, unformatted text stream in for 30 seconds before it snaps into the correct format.

Activity

  1. github-actions commented on Jul 29, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Please review these to see if your request is already covered or if you can add context there instead.

  2. github-actions commented on Sep 29, 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