fix(ai-sandbox): compare snapshot transcript by role and content - #1168
Conversation
After persist-structured-output, chat stores assistant id and createdAt on the completed turn. The portable snapshot test compared the full message object, so main failed. Compare role and content only.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe snapshot lifecycle test now compares checkpoint conversation messages using only their ChangesSnapshot lifecycle assertions
Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to This change only narrows the snapshot assertion to the assistant message role and content while preserving checkpoint fields; it does not alter published or runtime behavior, and no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit f6e9581
☁️ Nx Cloud last updated this comment at |
@tanstack/ai
@tanstack/ai-acp
@tanstack/ai-angular
@tanstack/ai-anthropic
@tanstack/ai-bedrock
@tanstack/ai-byteplus
@tanstack/ai-claude-code
@tanstack/ai-client
@tanstack/ai-code-mode
@tanstack/ai-code-mode-snippets
@tanstack/ai-codex
@tanstack/ai-cohere
@tanstack/ai-devtools-core
@tanstack/ai-durable-stream
@tanstack/ai-elevenlabs
@tanstack/ai-event-client
@tanstack/ai-fal
@tanstack/ai-gemini
@tanstack/ai-grok
@tanstack/ai-grok-build
@tanstack/ai-groq
@tanstack/ai-isolate-cloudflare
@tanstack/ai-isolate-daytona
@tanstack/ai-isolate-node
@tanstack/ai-isolate-quickjs
@tanstack/ai-isolate-quickjs-bun
@tanstack/ai-mcp
@tanstack/ai-memory
@tanstack/ai-mistral
@tanstack/ai-ollama
@tanstack/ai-openai
@tanstack/ai-opencode
@tanstack/ai-openrouter
@tanstack/ai-perplexity
@tanstack/ai-persistence
@tanstack/ai-preact
@tanstack/ai-react
@tanstack/ai-react-ui
@tanstack/ai-sandbox
@tanstack/ai-sandbox-cloudflare
@tanstack/ai-sandbox-daytona
@tanstack/ai-sandbox-docker
@tanstack/ai-sandbox-local-process
@tanstack/ai-sandbox-sprites
@tanstack/ai-sandbox-vercel
@tanstack/ai-solid
@tanstack/ai-solid-ui
@tanstack/ai-svelte
@tanstack/ai-utils
@tanstack/ai-vercel-gateway
@tanstack/ai-vue
@tanstack/ai-vue-ui
@tanstack/openai-base
@tanstack/preact-ai-devtools
@tanstack/react-ai-devtools
@tanstack/solid-ai-devtools
commit: |
After #1126,
chat()stores the completed assistant turn withidandcreatedAt. The portable snapshot test compared the full message object, so@tanstack/ai-sandbox:test:libfailed onmain.This PR compares
roleandcontentonly. The checkpoint still stores the extra fields.🎯 Changes
The snapshot lifecycle test no longer requires the assistant message to have only
roleandcontent.No docs update. This is a test assertion, not a user-facing change.
No changeset. Published packages did not change.
✅ Checklist
pnpm run test:pr.docs/for this change, or this change is not user-facing.pnpm changeset), or this PR does not change a published package.🚀 Release Impact
Testing
Commands run:
pnpm --filter @tanstack/ai-persistence buildpnpm --filter @tanstack/ai-sandbox buildpnpm --filter @tanstack/ai-sandbox test:lib— 971 passedSkipped
pnpm test:pr(full affected CI set). The red job onmainis only@tanstack/ai-sandbox:test:lib.Manual test:
main, runpnpm --filter @tanstack/ai-sandbox test:libpersists the completed transcript, files, and artifacts after completionfail because the assistant message hasidandcreatedAtHow this PR makes testing easy: the failing unit test is the coverage. No extra command or example app change.
Risk / rollback
Low. One assertion. Revert the PR to undo.
Summary by CodeRabbit