Skip to content

Adopt immutable TanStack client snapshots in the SDK - #353

Merged
mintuhouse merged 3 commits into
mainfrom
codex/ai-client-snapshots
Oct 23, 2026
Merged

mintuhouse merged 3 commits into
mainfrom
codex/ai-client-snapshots

Conversation

@mintuhouse

@mintuhouse mintuhouse commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
  • Replace SDK message and status callbacks with TanStack client snapshots, removing mutations of library-owned messages.
  • Project saved attachment and widget metadata immutably, preserve download and render identities through streaming and hydration, and reuse unchanged messages and parts.
  • Preserve the selected conversation and widget identities across immediate React Strict Mode restarts. Reuse client replacement with the current snapshot when history loading was cancelled, keeping submissions behind the history read.
  • Make the headless messages array readonly and update read-only consumers and the existing consumer guide. This is an intentional breaking TypeScript API change.
  • Keep regression coverage focused on observable state, identity, cancellation, and recovery while removing duplicate fixtures and internal call-count assertions.
  • Chrome walkthroughs using deterministic local responses:
    • Product flows from the initial snapshot migration: Chrome snapshot migration walkthrough with deterministic local responses
    • Saved-session restart and submission on the final implementation: Chrome saved-session restart lifecycle proof

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T14:25:08.776282Z 2c4b828 New commits
🔒 Security Review ✅ Completed 2026-10-23T09:33:29.975475Z 2d9c4cd PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

mintuhouse commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Validation results for 2c4b828fb87c3a90efcc0b56dd915b5aedaae62e

  • Review follow-up: preserved selected conversations and saved widgets across immediate restarts, renewed authentication before attachment, and reused client replacement with the readonly snapshot for interrupted history. Removed the custom retry handler and 20 lines. The production review fix is now three net lines beyond the original PR. Simplified fixtures and assertions while retaining cancellation, recovery, widget identity, and structural-sharing coverage.
  • Local SDK validation: 96 focused session, persistence, and widget tests passed. Type checking, scoped lint/format checks, SDK build, and git diff --check passed. A negative control during review confirmed the restart-concurrency regression detects premature submission.
  • Fresh deterministic Chrome public-SDK lifecycle proof on the simplified implementation: 2/2 passed in 13.4s. Saved widgets restore exactly once; interrupted history recovers; both flows verify the actual outgoing request and accepted reply. The attached GIF uses six screened browser screenshots, with videos, traces, and request assertions retained outside the repository.
  • Final post-push product browser suites on this exact head: Platform passed 14/14 in 5.0m; Todos passed 66/66 in 3.7m. Hosted checks: all 11 passed. Automated code review completed on this head with no findings, and there are no unresolved review threads. The earlier security review is recorded against the original 2d9c4cd head, not this follow-up.
  • Earlier baseline evidence on 2d9c4cd: SDK ready passed with 183 tests; Chrome comparison against main 334195c3d passed all 22 Todos behavior scenarios and five Platform flows. The original product-flow GIF remains in the PR description. Those results are historical, not the new head's post-push results.
  • The preceding 87da9532e browser run passed Platform 14/14. Todos passed 65/66, with the inherited directory-cache.spec.ts:207 mock teardown race (Response has been disposed) after its final assertions passed. The same failure appears in prior PR Scope sandbox ownership and make cleanup reliable #344/Recover sandbox cleanup after process crashes #348 logs, and this code is unchanged. Its trace is retained separately; no unrelated harness changes were added.
  • Evidence is local and deterministic. No live-model, deployed SDK, or new-provider validation is claimed.

Current logs, lifecycle recordings and request assertions: /tmp/astralbeam-pr353-review-20261023.SE7pfP/. Earlier comparison evidence: /tmp/astralbeam-snapshots-20261023.yhShSz/.

Chrome saved-session restart lifecycle proof

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
www-astralbeam-ai 2c4b828 Commit Preview URL

Branch Preview URL
Oct 23 2026, 02:24 PM

@mintuhouse

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2c4b828. Configure here.

@mintuhouse
mintuhouse merged commit 0789aeb into main Oct 23, 2026
12 checks passed
@mintuhouse
mintuhouse deleted the codex/ai-client-snapshots branch October 23, 2026 14:57
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.

1 participant