Skip to content

fix(runtime): start actor effects eagerly - #53

Merged
cevr merged 1 commit into
mainfrom
fix/eager-actor-effects
Sep 1, 2026
Merged

fix(runtime): start actor effects eagerly#53
cevr merged 1 commit into
mainfrom
fix/eager-actor-effects

Conversation

@cevr

@cevr cevr commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

Start state and background Effects eagerly. Complete their synchronous setup before actor state becomes visible to subscribers.

Closes #52.

Changes

  • Start .spawn(), .task(), .timeout(), and .background() Effect setup in the actor lifecycle turn.
  • Keep state scope and actor scope as the only Effect lifetime owners.
  • Register deferred ask replies before state Effect setup.
  • Preserve the original cause for synchronous state Effect defects.
  • Keep supervised startup defects under supervisor ownership.
  • Add direct actor, task, Atom, defect, reply, cleanup, order, and supervision tests.

Compatibility

A task that completes in its first Effect slice can enqueue its result before a caller sends its next event. A caller that must observe a transient state must start its wait before it sends the event.

Inspector handlers remain ordered and awaited. A suspending Inspector can delay Effect setup.

Test plan

  • bun run gate
  • 332 package tests
  • Typecheck
  • Effect lint
  • Format
  • Build
  • Core example gate
  • React example gate
  • Solid example gate

Design review

Counsel selected the internal eager-start design. It rejected a public option and a second readiness protocol. Review receipt: /tmp/counsel/rifts-bite-18966-a73c67f5/20260901-121525-codex-to-claude-865753/claude.md.

@cevr
cevr merged commit 8eba481 into main Sep 1, 2026
1 check passed
@github-actions github-actions Bot mentioned this pull request Sep 1, 2026
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.

Start actor Effects before publishing their lifecycle state

1 participant