Skip to content

feat(plugins): support opt-in streaming fence renderers - #1698

Draft
zwqjoy wants to merge 1 commit into
vastsa:mainfrom
zwqjoy:codex/streaming-plugin-fences
Draft

zwqjoy wants to merge 1 commit into
vastsa:mainfrom
zwqjoy:codex/streaming-plugin-fences

Conversation

@zwqjoy

@zwqjoy zwqjoy commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Renderer plugins currently receive a fenced block only after it closes, with no transcript identity or completion lifecycle. This prevents GenUI from displaying completed components while a reply is still arriving and from associating explicit actions with the original message.

Add an optional streaming: true blockRenderer registration. Opted-in plugins receive growing source, closed/streaming status, and host-owned session/message/fence identity. Terminal status updates are delivered even when source does not change. Legacy registrations retain their closed-fence, props-once behavior and original two props.

Keep namespaced ownership, renderer trust, error/unload source fallback and the 4000px guard. Observe both the clamp and its content so asynchronous growth past 4000px remains detectable. Update the SDK types, contract documentation, E2E scenario and a proposed ADR.

This PR contains only the host/SDK support needed by streaming GenUI. It does not bundle GenUI, change renderer privileges or introduce automatic model actions. The JSX runtime work from #1644 is already in the base.

Draft / maintainer scope decision requested: this is a feature proposal. The repository currently limits external landing candidates to fix/perf; this draft is not a claim of a policy exception or approval to merge. Please confirm whether this additive plugin contract is in scope before considering landing.

Validation on head f15df3f08aa9846de4f38887a6bbc0984c6cc1e4, based on upstream main b6e439437769b7763e9a51b78725a3534a52ab8f:

  • SDK index tests: 66 passed.
  • Desktop block-renderer, import-map and action-slot tests: 14 passed.
  • node scripts/e2e-streaming-plugin-fences.mjs: passed in isolated sandboxed Electron, covering growing source, stable local state, unchanged-source terminal update, original identity, legacy props-once, unload, asynchronous 4000→4001px overflow and render-error fallback.
  • SDK TypeScript check, Biome lint, style-token checks and diff whitespace checks: passed.
  • Desktop TypeScript check: passed using temporary paths to the request worktree's shared/SDK/i18n sources. The normal invocation encountered stale workspace build artifacts in the reused host dependency tree; no unrelated source was changed to accommodate them.
  • Base ancestry checks passed against upstream/main and origin/main.

Full workspace/release builds and installed-GenUI Desktop acceptance have not been run. No live user Desktop instance or real provider was used. GenUI plugin publishing remains separate.

Let explicitly opted-in plugins render growing fenced content and receive
terminal lifecycle updates with original transcript identity. Preserve
closed-fence props-once behavior for existing registrations.

Observe asynchronous content growth without weakening the source fallback
or renderer trust boundaries. Cover routing, stable local state, completion,
unload and overflow using public host modules in isolated Electron.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 03:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Tioit-Wang

Copy link
Copy Markdown
Collaborator

需要解决所有ci问题

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants