Document sessions on deferred functions - #1832
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Solid, well-scoped docs addition — the new content is accurate and consistent with the sessions doc and other reference pages (types, defaults, ?ref= anchors all line up). One small formatting slip worth a fix before merge.
Re-review (2026-08-07): Reviewed only the commits added since the last review (sessionPropagation client option, meta.sessions on step.invoke(), and the sessions note on step.sendEvent()). These are consistent with the previously-reviewed deferred-functions docs (same type signature, same override/clear semantics, correct anchors) and introduce no new issues. The previously flagged open nit (missing --- divider before ## Sessions in deferred-functions.mdx) still applies and isn't repeated here.
| } | ||
| ``` | ||
|
|
||
| ## Sessions |
There was a problem hiding this comment.
nit: every other ## section in this file is preceded by a --- divider, but this new ## Sessions heading isn't (the divider was only added after it, before ## Attributing scores). Add a --- before ## Sessions to match the rest of the page's section separators.
Deferred runs inherit the sessions of the run that deferred them, and `defer()` now accepts `meta.sessions` to set or override them. Adds a Sessions section to both the feature page and the reference, plus the `meta.sessions` property under `defer(id, options)`. Also notes that an invalid session value is a call-site error: `normalizeEventMeta` runs synchronously in `buildDefer`, so a bad value silently drops the entire `defer()` call rather than just the metadata. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Documents the client-level toggle that controls whether events created during a run inherit the run's sessions. Sessions set explicitly in `meta.sessions` are sent regardless of the setting. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Neither reference documented `meta` at all, so this adds the `meta.sessions` property to `step.invoke()` and a note on the `step.sendEvent()` payload that events sent from within a run inherit that run's sessions. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2ad45dc to
47777e9
Compare
I recommend reviewing with these links to the preview:
defer()callmeta.sessionsproperty ondefer(id, options)sessionPropagationoptionstep.invoke()— newmeta.sessionspropertystep.sendEvent()— note that events sent from a run inherit its sessionsNotes: