Skip to content

fix: snapshot AI streaming preview and task PR flow#4902

Merged
zbeyens merged 9 commits intomainfrom
codex/4900-ai-streaming-history
Mar 27, 2026
Merged

fix: snapshot AI streaming preview and task PR flow#4902
zbeyens merged 9 commits intomainfrom
codex/4900-ai-streaming-history

Conversation

@zbeyens
Copy link
Member

@zbeyens zbeyens commented Mar 26, 2026

This fixes the insert-mode AI streaming history path from #4900 by snapshotting the pre-stream editor state, streaming preview chunks outside undo history, and committing the accepted result as one fresh undo step. It also syncs the local task skill so tracked GitHub work opens or updates the PR before posting the issue comment, then includes the PR URL in that comment.

Closes #4900.

What changed

  • added aiStreamSnapshot helpers and wired insert-mode accept, undo, and reset flows to the snapshot path
  • switched the editor AI kit preview stream to withoutSaving and refreshed the generated registry artifacts
  • added regression coverage for stream history and documented the pattern in the solution doc
  • updated the task skill source and generated SKILL.md with PR-before-comment tracker sync rules

Verification

  • pnpm check
  • targeted bun test packages/ai/src/react/ai-chat/utils/aiChatActions.spec.ts
  • browser verification on /blocks/editor-ai

Compound Engineering vunknown
🤖 Generated with GPT-5 Codex (unknown context, medium reasoning) via Codex

@zbeyens zbeyens requested a review from a team March 26, 2026 16:24
@codesandbox
Copy link

codesandbox bot commented Mar 26, 2026

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@changeset-bot
Copy link

changeset-bot bot commented Mar 26, 2026

🦋 Changeset detected

Latest commit: eaaf967

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@platejs/ai Patch
@platejs/slate Patch
@platejs/core Patch
platejs Patch
@platejs/test-utils Patch
@platejs/utils Patch
@platejs/code-drawing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Mar 26, 2026
@vercel
Copy link

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
plate Ready Ready Preview, Comment Mar 27, 2026 10:24am

Request Review

@dosubot dosubot bot added patch Bugfix & documentation PR plugin:ai labels Mar 26, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3099f6111

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

keep insert preview accept/cancel local
preserve selection through accept undo redo
stabilize ai chat specs on shared mocks
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Mar 26, 2026
@zbeyens zbeyens merged commit add1ac6 into main Mar 27, 2026
5 checks passed
@zbeyens zbeyens deleted the codex/4900-ai-streaming-history branch March 27, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bugfix & documentation PR plugin:ai size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Streaming with withAIBatch accumulates operations and may slow undo

1 participant