Skip to content

refactor: add Effect-returning versions of MessageV2 functions#20374

Open
kitlangton wants to merge 1 commit intodevfrom
worktree-effectify-message-v2
Open

refactor: add Effect-returning versions of MessageV2 functions#20374
kitlangton wants to merge 1 commit intodevfrom
worktree-effectify-message-v2

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • Extract sync cores (partsSync, getSync, pageSync) from MessageV2 DB functions that were unnecessarily async (all Database.use calls are synchronous)
  • Add 6 new Effect.fn exports: partsEffect, getEffect, pageEffect, streamEffect, filterCompactedEffect, toModelMessagesEffect
  • Replace all 16 Effect.promise(() => MessageV2.*) call sites with direct yield* calls across processor, prompt, compaction, session index, and tests

Test plan

  • bun run test -- test/session/processor-effect — 10/10 pass
  • bun run test -- test/session/prompt-effect — 25/25 pass
  • bun run test -- test/session/ — 180/180 pass (4 skipped)
  • Typecheck passes across all 13 packages

Extract sync cores (partsSync, getSync, pageSync) from MessageV2 DB
functions and add Effect.fn wrappers: partsEffect, getEffect, pageEffect,
streamEffect, filterCompactedEffect, toModelMessagesEffect.

Replace all Effect.promise(() => MessageV2.*) call sites in processor,
prompt, compaction, session index, and tests with direct yield* calls.
@kitlangton kitlangton force-pushed the worktree-effectify-message-v2 branch from 428e2cd to af3f77f Compare April 1, 2026 01:33
@kitlangton kitlangton added the beta label Apr 1, 2026
opencode-agent bot added a commit that referenced this pull request Apr 1, 2026
opencode-agent bot added a commit that referenced this pull request Apr 1, 2026
opencode-agent bot added a commit that referenced this pull request Apr 1, 2026
opencode-agent bot added a commit that referenced this pull request Apr 1, 2026
opencode-agent bot added a commit that referenced this pull request Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant