Skip to content

v0.27.0

Choose a tag to compare

@ya-luotao ya-luotao released this 31 Jul 08:24
· 559 commits to main since this release

Added

  • Fiber-native SessionStore adapters (#47 phase 3): an adapter whose IO is entirely Fiber-scheduler-aware can declare it by defining an optional callback_scheduling method returning :inline. Every timeout-bounded store call the SDK makes (mirror-batcher appends; resume-materialization loads and the listing methods) then runs in place on the reactor fiber under a cooperative timeout — interrupted at the next suspension point with ensure blocks running — instead of on a throwaway thread with a hard Thread#join bound.
    • The timeout guarantee is never lost: undeclared adapters are byte-for-byte unchanged; declared adapters outside a reactor still get the hard thread-hop bound; nested timeout scopes use per-invocation cancellation classes and cannot consume each other's deadline; an adapter's rescue StandardError cannot swallow the deadline.
    • Timed-out appends are not retried in either mode (cancellation reaches only the adapter's own fiber — offloaded work may still land, and a retry would race it). A cancelled append may remain permanently half-applied in the store; the drop is surfaced (MirrorErrorMessage, batches_dropped?) and the local transcript remains the source of truth.
    • Invalid or raising declarations fail fast at construction; conformance kit contract 17 validates the declaration.

Usage

class MyAsyncStore < ClaudeAgentSDK::SessionStore
  def callback_scheduling = :inline   # all IO is scheduler-aware
  # append / load / list_* ...
end

# Or opt in a third-party fiber-native adapter you don't own:
def store.callback_scheduling = :inline

See "Fiber-native adapters" in docs/sessions.md. This completes the issue #47 sequencing (phase 1 callback_scheduling: :inline in v0.25.0, phase 2 callback_wrapper in v0.26.0).

What's changed

  • #50 Fiber-native SessionStore adapters via callback_scheduling declaration (#47 phase 3) — @ya-luotao

Full Changelog: v0.26.0...v0.27.0


gem install claude-agent-sdk -v 0.27.0