Skip to content

effectify Plugin service internals#19365

Merged
kitlangton merged 4 commits intodevfrom
effect/plugin-native
Mar 27, 2026
Merged

effectify Plugin service internals#19365
kitlangton merged 4 commits intodevfrom
effect/plugin-native

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • Replace the monolithic Effect.promise in Plugin's state initializer with granular native Effect calls
  • Yield Config.Service directly instead of calling Config.get() / Config.waitForDependencies() async facades
  • Use bus.publish() (yielded service) for error reporting instead of Bus.publish() async facade
  • Convert BunProc.install, plugin loading, and plugin init to individual Effect.tryPromise calls with proper error handling via Effect.catchAll
  • Convert trigger's Effect.promise loop to per-hook Effect.promise yields

Test plan

  • bun run typecheck passes (no new errors vs baseline)
  • Manual verification that plugins load and trigger correctly
  • Plugin tests pass once test environment module resolution is fixed (pre-existing zod resolution issue)

…alls

Convert the Plugin service's internal Effect.promise blocks to native
Effect operations:

- Yield Config.Service directly instead of calling Config.get() async facade
- Use config.get() and config.waitForDependencies() as Effect yields
- Use bus.publish() for error reporting instead of Bus.publish() async facade
- Replace monolithic Effect.promise with granular Effect.tryPromise calls
  for BunProc.install, plugin loading, and plugin initialization
- Convert trigger's Effect.promise loop to individual Effect.promise yields
- Add Config.defaultLayer to Plugin's defaultLayer dependency chain
@kitlangton kitlangton force-pushed the effect/plugin-native branch from 1be4f5f to e82e280 Compare March 27, 2026 02:40
@kitlangton kitlangton marked this pull request as ready for review March 27, 2026 13:50
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
#
# Conflicts:
#	packages/opencode/src/plugin/index.ts
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
#
# Conflicts:
#	packages/opencode/src/plugin/index.ts
@kitlangton kitlangton enabled auto-merge (squash) March 27, 2026 14:18
@kitlangton kitlangton marked this pull request as draft March 27, 2026 14:41
auto-merge was automatically disabled March 27, 2026 14:41

Pull request was converted to draft

@kitlangton kitlangton marked this pull request as ready for review March 27, 2026 14:41
@kitlangton kitlangton enabled auto-merge (squash) March 27, 2026 15:04
@kitlangton kitlangton merged commit e528ed5 into dev Mar 27, 2026
8 checks passed
@kitlangton kitlangton deleted the effect/plugin-native branch March 27, 2026 15:20
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