Files
anomalyco_opencode/packages/opencode/test
Kit Langton 5719a13cbf refactor(session): effectify SessionPrompt service
Migrate SessionPrompt to the Effect service pattern (Interface, Service,
Layer, InstanceState, makeRuntime + async facades).

Key design decisions:

- Fiber-based cancellation replaces manual AbortController management.
  Effect.promise((signal) => ...) derives AbortSignals automatically;
  cancel() interrupts fibers and signals propagate to the AI SDK,
  shell processes, and tool execution.

- Deferred queue replaces Promise callback queue. Concurrent loop()
  callers get a Deferred that resolves when the running fiber finishes.
  On cancel or error, queued callers now receive proper errors instead
  of hanging forever.

- Separate loops/shells maps in InstanceState replace the single shared
  state object, with shell-to-loop handoff preserved: if callers queue
  a loop while a shell is running, shellE cleanup starts the loop.

- Heavy helper functions (createUserMessage, handleSubtask, shellImpl,
  resolveCommand, insertReminders, ensureTitle) stay as plain async
  functions called via Effect.promise, keeping the migration incremental.

- resolveTools and createStructuredOutputTool are unchanged (deeply tied
  to AI SDK tool callbacks).
2026-03-29 12:21:56 -04:00
..
2026-03-29 00:27:27 +01:00
2026-03-20 16:11:21 +00:00
2026-03-26 15:49:53 +00:00
2026-03-26 18:42:59 +00:00
2025-11-06 13:03:12 -05:00
2026-03-27 15:24:30 -05:00
2026-03-27 15:00:26 +01:00
2025-09-09 23:44:04 -04:00
2025-12-11 19:20:23 +01:00