Skip to content

Sessions: drop the SDK's explicitRecovery option from session handlers - #56

Merged
slinkydeveloper merged 1 commit into
mainfrom
sessions-drop-explicit-recovery-option
Dec 3, 2026
Merged

slinkydeveloper merged 1 commit into
mainfrom
sessions-drop-explicit-recovery-option

Conversation

@slinkydeveloper

Copy link
Copy Markdown
Collaborator

Session handlers spread restate.internal.explicitRecovery() into their SDK handler options, but nothing reads it on a path a session object takes:

  • The SDK reads the flag in one place only: when it builds its own WasmVM for an invocation (endpoint/handlers/generic.js). It is not in the discovery manifest.
  • On every NodeEndpoint (restate.endpoint(), serve, connect), endpoint.ts routes a session object's invocation to our own explicit recovery VM. The SDK's VM is never built.
  • On a fetch endpoint, the SDK's handler is wrap(...), which fails with a TerminalError straight away, flag or not.

So this removes the recovery helper and the spread, and rewords the README paragraph that said every handler carries the option.

Formatting checked locally. Typecheck shows no errors in packages/sessions. The 47 errors elsewhere are the same on main, from missing packages in the local node_modules. CI runs the tests.

🤖 Generated with Claude Code

The SDK reads it only when it builds its own VM for an invocation, which a
session object's never reaches: endpoint.ts routes it to our own explicit
recovery VM, and a fetch endpoint fails it with a TerminalError either way.
It is not in the discovery manifest either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog 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.

✅ No new issues found.

Approach: sound. The flag was dead weight. Session invocations never reach a code path that reads it, so dropping it is simpler than keeping a decoration that implies the SDK does the recovery.

Reviewed changes

I checked the removal against SDK 1.18.2's handling of the option and against this package's endpoint routing.

  • recovery() helper removed: handlerOf now passes the entry's own options to restate.handlers.object.{shared,exclusive}. This confirms the PR's claims: the SDK keys the option on a symbol (endpoint/components.js) and reads it only when it constructs WasmVM (endpoint/handlers/generic.js:114), so the option never reached the discovery manifest. routing() in endpoint.ts sends every session object invocation to serveSession or answers it directly with 401/415, and never falls through to the SDK. On other endpoints, wrap() throws. No other code referenced recovery.
  • README "No journal replay" paragraph: it now names shared-core's explicit recovery VM as the reason a retried attempt skips the journal, instead of a per-handler option.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@slinkydeveloper
slinkydeveloper merged commit c7bc08f into main Dec 3, 2026
10 checks passed
@slinkydeveloper
slinkydeveloper deleted the sessions-drop-explicit-recovery-option branch December 3, 2026 10:49
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.

1 participant