docs(ai-chat): slim-wire HITL continuations + field-level merge contract#3721
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (2)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🧰 Additional context used📓 Path-based instructions (1)docs/**/*.mdx📄 CodeRabbit inference engine (docs/CLAUDE.md)
Files:
🧠 Learnings (2)📚 Learning: 2026-03-10T12:44:14.176ZApplied to files:
📚 Learning: 2026-04-30T20:30:29.458ZApplied to files:
🔇 Additional comments (2)
WalkthroughThis PR updates ai-chat documentation for the May 23, 2026 (4.5.0-rc.2) release. It documents HITL continuation behavior where assistant tool-part payloads are slim (only resolved tool-part state plus minimal identity), the runtime overlays tool-state advances onto hydrated messages by id, and hydrateMessages examples switch to an id-based upsert (upsertIncomingMessage) to avoid duplicate assistant rows. It tightens tool-approval payload examples to a single slim message shape. It also clarifies /in/append sizing: documents a 1 MiB body ceiling (with S2 per-record metering guidance) and that 413 responses include CORS headers. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
Summary
Updates the AI chat docs to match the slim-wire + field-level merge behavior shipped in #3719 and the precise
.in/appendcap + CORS-readable 413 shipped in #3720. No behavior changes here — code is correct inmain; the docs were lagging on three patterns customers copy out of the page.What changed
hydrateMessagesexamples upsert by id (inlifecycle-hooks.mdx,patterns/database-persistence.mdx, andpatterns/persistence-and-replay.mdx). The previousstored.push(newMsg)pattern duplicated the assistant id on HITL continuations and caused the LLM to receive a tool call with noarguments. The new examples include the rationale inline.onValidateMessagesexample filters to user messages (lifecycle-hooks.mdx). The previous example calledvalidateUIMessages({ messages, tools })directly, which now throws on HITL slim wires (the AI SDK schema requiresinputon resolved tool parts). New example shows the filter pattern, with a Warning callout explaining why.lifecycle-hooks.mdx). The old wording said incoming messages are "auto-merged" / "replaced"; the new description explains the actual field-level overlay (state advances only).client-protocol.mdx). Shows the minimum shape the agent reads —state+approval(oroutput/errorTextfor HITL). Notes that the built-in transports ship this slim shape by default and that fuller shapes are still accepted./in/append413 row and FAQ updated (client-protocol.mdx,patterns/trusted-edge-signals.mdx). Reflects the new precise S2 cap and the CORS-readable 413.changelog.mdxcovering all of the above.The historical
## 512 KiB ceiling removedentry further down the changelog is left as-is (it's a snapshot of the prior transition), and the v4.5 upgrade-guide section is skipped — the merge contract is backwards compatible.Test plan
/ai-chat/lifecycle-hooks#hydratemessages,/ai-chat/lifecycle-hooks#onvalidatemessages,/ai-chat/patterns/database-persistence#alternative-hydratemessages,/ai-chat/client-protocol#step-3-send-messages-stops-and-actions,/ai-chat/patterns/large-payloads)