Feature/ait 1090 ait release 0 4 0#3454
Merged
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
mschristensen
commented
Jul 1, 2026
5501041 to
5642380
Compare
5642380 to
9d1030e
Compare
9d1030e to
861643d
Compare
861643d to
5c6737f
Compare
Target the upcoming @ably/ai-transport v0.4.0 release across the AI Transport docs. The version registry drives both the page version badge and the code-accuracy baseline, so the samples updated in this PR align with the v0.4.0 surface. AIT-1090
5c6737f to
1ef2fab
Compare
1ef2fab to
f333de2
Compare
f333de2 to
a566726
Compare
a566726 to
3025171
Compare
3025171 to
23e9ad2
Compare
23e9ad2 to
4e5b1bf
Compare
v0.4.0 replaces the removed ClientSessionOptions.messages seed with a seam-reconciliation model: View.loadUntil pages the channel back to the newest stored message and returns the not-yet-stored tail, and the new useMessagesWithSeed React hook composes a persisted seed with the live view. - Add features/database-hydration.mdx covering the seam model, agent and client hydration, turn persistence (run.messages), and edge cases. - Add api/react/core/use-messages-with-seed.mdx for the new hook. - Register both pages in the AI Transport nav and the API reference hub. AIT-1090
Update the concept tier for the v0.4.0 run read-model and the input-event watcher that replaces the history-scan lookup. - runs.mdx: ActiveRun -> ClientRun; runId is now synchronous (empty until run-start), awaited via the new `started`; add a "Read a Run from either side" section for the shared BaseRun read-model (runId/status/error/ messages) and the per-side verbs; the agent rehydrates by draining run.view rather than loadConversation; note one input per send. - invocations.mdx: ClientRun naming; AgentRun.start awaits the input-event watcher (live or channel history) instead of a rewind+live lookup. - connections.mdx: branch navigation via branchSelection().select. AIT-1090
client-session.mdx:
- View -> ClientView surface; branchSelection().select replaces
selectSibling; loadOlder now resolves to the revealed page and loadUntil
is documented; send/regenerate/edit return ClientRun and take one new
message per send.
- Drop the removed ClientSessionOptions.messages seed; add historyPageSize.
- ActiveRun -> ClientRun; runId is synchronous (empty until run-start),
awaited via started.
agent-session.mdx:
- Run -> AgentRun extending BaseRun (runId/status/error/messages); add the
leaf-pinned run.view and located; rewrite start() around the input-event
watcher (no more inputEventLookupTimeoutMs / InputEventNotFound 104010).
- Remove the already-removed addEvents/EventsNode, loadProjection, and
loadConversation/LoadConversationOptions surfaces; rewrite conversation
hydration to drain run.view.
- Replace the onError option with on('error'); historyPageSize replaces the
input-event lookup/buffer/rewind options; close() is async.
AIT-1090
v0.4.0 removes ErrorCode.InputEventNotFound (104010): the input-event
watcher replaces the timed history-scan lookup, so there is no lookup
timeout to fail. Remove the 104010 row, and document non-fatal session
errors as delivered through session.on('error') on both the client and the
agent, replacing the removed AgentSessionOptions.onError option.
AIT-1090
- use-view.mdx / use-create-view.mdx: ViewHandle.loadOlder now resolves to
the revealed page; branchSelection returns a BranchHandle whose select()
replaces the removed selectSibling; send/regenerate/edit return ClientRun
and take one new message per send; View -> ClientView; pagination counts
codecMessages.
- providers.mdx: drop the removed ClientSessionOptions.messages seed prop;
document channelModes and historyPageSize.
use-client-session.mdx is unchanged: its hook source did not change in
v0.4.0 and it already documents session.on('error').
AIT-1090
- chat-transport.mdx: drop the removed messages seed from the client
options and the removed onError / inputEventLookupTimeoutMs /
inputEventBufferLimit / rewindWindow from the agent options; add
historyPageSize and channelModes; point session errors at on('error').
- chat-transport-provider.mdx: drop the removed messages seed prop; add
historyPageSize.
- use-message-sync.mdx: document the new messages seed option that
reconciles a useChat seed with the live channel.
- run-outcome.mdx: rebuild the model context by draining run.view instead
of the removed loadConversation; await the now-async session.close().
AIT-1090
v0.4.0 removes Run.loadConversation; the agent rebuilds model context by draining its leaf-pinned run.view. Replace the loadConversation call inline across the agent-route examples (concurrent-turns, chain-of-thought, agent-presence, token-streaming, push-notifications, branching), feeding the drained run.view.getMessages() to the model. Also on these pages: ActiveRun -> ClientRun with synchronous runId awaited via started (concurrent-turns), and branch navigation via the branchSelection handle's select() rather than the removed selectSibling (branching). AIT-1090
- history.mdx: loadOlder now resolves to the revealed page (drop the
Promise<void> claim and the FAQ that defended it); note historyPageSize;
cross-link database hydration for longer-than-retention storage.
- multi-device.mdx: ActiveRun -> ClientRun (runId populated after started);
link database hydration.
- interruption.mdx: ActiveRun -> ClientRun.
reconnection-and-recovery, optimistic-updates, and human-in-the-loop
already match v0.4.0 (they use session.on('error') and wire-only
tool-approval-response inputs), so they are unchanged.
AIT-1090
- core-sdk.mdx / vercel-ai-sdk.mdx: rebuild the model context by draining run.view instead of the removed loadConversation; view.send returns a ClientRun (toInvocation via clientRun). - core-sdk.mdx: drop selectSibling from the useView surface list and the branching pointer in favour of the branchSelection handle's select; ClientView naming. authentication.mdx is unchanged: it only uses useClientSession, which did not change in v0.4.0. AIT-1090
- transport-patterns.mdx: replace the input-event lookup section (rewind + inputEventLookupTimeoutMs + inputEventBufferLimit + InputEventNotFound) with the input-event watcher armed by createRun and awaited via run.located; ActiveRun -> ClientRun with started. - wire-protocol.mdx: AgentRun.start awaits run.located (no rewindWindow / lookup timeout / InputEventNotFound); ActiveRun.runId -> clientRun.runId populated after started. - conversation-tree.mdx: branch navigation via the branchSelection handle's select (BranchSelection -> BranchHandle); ClientRun naming. AIT-1090
Run.addEvents and the EventsNode type were removed from the public API. A late tool result is delivered as a tool-result input addressed to the original message on a continuation (the pattern already shown above on the page), not via a cross-run addEvents call. Drop the obsolete section and fix the edge-case bullet that referenced it. AIT-1090
Link integrity: - errors.mdx: Ably error codes link -> /docs/platform/errors/codes. - chain-of-thought.mdx: codec link -> api/javascript/core/codec. - vercel-ai-sdk-ui.mdx: Vercel API link -> the chat-transport page. - repoint the anchorless client-session#view links to #properties (connections, invocations, runs, core-sdk, client-session). - troubleshooting.mdx: branching#branch-navigation -> #navigate. - run-outcome.mdx: reference the VercelRunOutcome table inline so it renders. Code accuracy (SendOptions is { forkOf, parent, runId } only): - use-view.mdx: remove the fabricated SendOptions.inputEventId row. - invocations.mdx: drop the false "override inputEventId/codecMessageId via SendOptions" claim. - transport-patterns.mdx / troubleshooting.mdx: run.end takes a RunEndParams object, so run.end({ reason }), not the positional run.end(reason). AIT-1090
run.start() awaits run.located, and on a cold start the triggering input only folds into the tree once the caller pages run.view — so draining after start() can hang. Reorder every agent example to drain (loadOlder loop) and build the conversation before calling run.start(), matching the SDK's own v0.4.0 docs (streaming.md, database-hydration.md) and the AgentRun.start contract. Affects agent-session, run-outcome, the agent-route feature pages, both frameworks pages, and both getting-started guides. database-hydration already used the correct loadUntil-then-start order. Also: chain-of-thought used "turn" for the Run lifecycle unit (abort signal, stream multiplexing, post-completion) inconsistently with the rest of the page — align to "Run". Fix "client-side React hooks" casing on the Vercel AI SDK UI page. AIT-1090
4e5b1bf to
ce248e5
Compare
zknill
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aligns the AI Transport docs with
@ably/ai-transportv0.4.0 (the changes merged to the SDK'smainsince0.3.0). v0.4.0 reworks the run read-model and how an agent rebuilds conversation history, so this is largely a breaking-API sweep plus two net-new pages.The headline change: agents drain
run.viewinstead ofloadConversationRun.loadConversation()is gone. An agent now rebuilds the model context by draining its leaf-pinnedrun.view— and it must do so beforerun.start():Ordering matters:
run.start()awaitsrun.located, and on a cold start (agent attaches after the client published) the triggering input only folds into the tree once the caller pagesrun.view. Draining afterstart()can hang with no timeout. Database-backed hydration uses the same shape withrun.view.loadUntil(seam)instead of a full drain.run.messagesno longer means "the whole conversation" — it's now this run's own turn (its triggering input + streamed output), the unit you persist.Breaking changes swept through the docs
ActiveRun→ClientRun;Run(agent) →AgentRun; both extend a sharedBaseRun(runId,status,error,messages).ClientRun.runIdis now synchronous (empty until run-start); await the newClientRun.started, then read it. (await run.runId→await run.started; run.runId.)Viewsplit into a read baseView+ writableClientView;View.selectSibling(id, i)→view.branchSelection(id).select(i)(BranchSelection→BranchHandle).View.loadOlder()now resolves to the revealed page (wasPromise<void>); newView.loadUntil().ClientSessionOptions.messagesseed removed; newhistoryPageSize.AgentSession.on('error')(removedAgentSessionOptions.onError); removedinputEventLookupTimeoutMs/inputEventLookbackMs/inputEventBufferLimit/rewindWindow— replaced by the passive input-event watcher andAgentRun.located.104010 InputEventNotFoundremoved.Run.addEvents/EventsNode,loadProjection,RunView,MessageNode.New pages
features/database-hydration.mdx— the seam-reconciliation model (View.loadUntil+useMessagesWithSeed) that replaces the removed seed option: persist completed runs, reconcile stored history with the live channel on reload.api/react/core/use-messages-with-seed.mdx— the new hook.Both are registered in the nav and API hub.
For reviewers
origin/main.d.ts, its in-repo docs, and theuse-chat-dbdemo. A fulldocs-review-allpass (all five concerns) is green; the notable catch was the drain-before-start()ordering above.use-client-session,reconnection-and-recovery,optimistic-updates,human-in-the-loop,authentication).features/database-hydration.mdxships prose-only (a flow diagram is a design follow-up); a pre-existingrun.end(reason)positional call on the unchangedfeatures/cancellation.mdxwas left out of scope.Relates to AIT-1090.