Skip to content

[FEATURE]: Plugin hooks for real-time stream observation and abort control #14740

@marcusquinn

Description

@marcusquinn

Feature hasn't been suggested before.

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

Describe the enhancement you want to request

Plugins currently can only observe completed text via experimental.text.complete. There is no way to monitor streaming content in real time, abort a stream mid-flight based on content rules, or retry with corrective instructions after an abort.

Proposed hooks:

  • stream.delta — fires on every text-delta, reasoning-delta, and tool-input-delta event. Plugins can observe the stream and optionally set abort: true to cancel it.
  • stream.aborted — fires after a stream is aborted by a delta hook. Plugins can decide whether to retry with optional corrective context injected into the conversation.

Use cases: content filtering, pattern detection, real-time monitoring, self-correcting agents.

I have a working implementation ready as a PR.

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