Skip to content

Document sessions on deferred functions - #1832

Merged
scottnuma merged 3 commits into
scott/propagated-sessions-docfrom
scott-defer-sessions-docs
Aug 7, 2026
Merged

Document sessions on deferred functions#1832
scottnuma merged 3 commits into
scott/propagated-sessions-docfrom
scott-defer-sessions-docs

Conversation

@scottnuma

@scottnuma scottnuma commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
  • Document sessions outside of the main sessions page.

I recommend reviewing with these links to the preview:

Notes:

  • Do not merge until sessions propagation is released with opt-out
  • EXE-2035

@scottnuma
scottnuma requested a review from djfarrelly as a code owner August 6, 2026 21:23
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
website Ready Ready Preview Aug 7, 2026 4:31pm

Request Review

@gester-bot gester-bot 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.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

scottnuma and others added 3 commits August 7, 2026 09:27
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>
@scottnuma
scottnuma force-pushed the scott-defer-sessions-docs branch from 2ad45dc to 47777e9 Compare August 7, 2026 16:27
@scottnuma
scottnuma merged commit 3ae73da into main Aug 7, 2026
8 checks passed
@scottnuma
scottnuma deleted the scott-defer-sessions-docs branch August 7, 2026 16:55
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.

2 participants