Uh oh!
There was an error while loading. Please reload this page.
refactor(session): effectify SessionPrompt service - #19483
Merged
Conversation
kitlangtonforce-pushed
the
worktree-effectify-session-prompt
branch
from
March 28, 2026 03:17
efc458f to
530e1f4Comparekitlangtonforce-pushed
the
worktree-effectify-session-prompt
branch
from
March 28, 2026 16:29
530e1f4 to
83c9adcComparekitlangtonforce-pushed
the
worktree-effectify-session-prompt
branch
4 times, most recently
from
March 28, 2026 17:26
3ba3c31 to
4c5b6b6Comparekitlangtonforce-pushed
the
worktree-effectify-session-prompt
branch
3 times, most recently
from
March 28, 2026 18:08
7e3f89d to
dbb4913Comparekitlangtonforce-pushed
the
worktree-effectify-session-prompt
branch
from
March 29, 2026 01:09
2abd60e to
ea147aeCompareYield ToolRegistry.Service in the layer instead of going through Effect.promise(() => ToolRegistry.tools(...)). Add layer type annotation to registry.ts to fix tsgo circular inference.
kitlangtonforce-pushed
the
worktree-effectify-session-prompt
branch
from
March 30, 2026 18:55
e570bbb to
1497bd5ComparePull the anonymous init return type into a named Tool.Def interface, replacing Awaited<ReturnType<...>> casts across tool registry. Use Option.isNone instead of tag check in prompt file resolution.
Use fsys.isDir instead of Filesystem.stat and fsys.readFile instead of Filesystem.readBytes. Remove unused Filesystem import.
Tests that spawn /bin/sh with Unix commands (printf, sleep, trap) fail on Windows. Use a unix() helper to skip them, matching the existing codebase pattern (e.g. worktree.test.ts).
Replace async lastModelImpl with Effect-based lastModel, removing three Effect.promise wrappers. Use agents.get directly instead of Agent facade in command(). Remove unused Fiber import.
Yield Truncate.Service in the layer instead of going through Effect.promise(() => Truncate.output(...)).
Add Effect.onInterrupt to the subtask execute call so the tool part and assistant message are properly finalized when the session is cancelled mid-subtask.
Replace the done/onExit/catchCauseIf approach with the simpler three-concern pattern: .catch() for execution errors, onInterrupt for cancellation cleanup, sequential code for normal finalization.
kitlangton
enabled auto-merge (squash)
March 30, 2026 20:06
Uh oh!
There was an error while loading. Please reload this page.
rekram1-node
commented
Mar 31, 2026
Collaborator
/review Do u see any regressions in this commit? Anything breaking with tool call or otherwise metadata? |
Contributor
lgtm |
This was referenced Apr 1, 2026
vicary pushed a commit
to vicary/opencode
that referenced
this pull request
Apr 6, 2026
balcsida pushed a commit
to balcsida/opencode
that referenced
this pull request
Apr 8, 2026
xywsxp pushed a commit
to xywsxp/opencode
that referenced
this pull request
Apr 24, 2026
Rwanbt pushed a commit
to Rwanbt/unifia
that referenced
this pull request
May 5, 2026
AIALRA-0 pushed a commit
to AIALRA-0/opencode-turn-engine
that referenced
this pull request
Jun 10, 2026
AIALRA-0 pushed a commit
to AIALRA-0/opencode-turn-engine
that referenced
this pull request
Jun 10, 2026
avion23 pushed a commit
to avion23/opencode
that referenced
this pull request
Jun 10, 2026
Rwanbt pushed a commit
to Rwanbt/unifia
that referenced
this pull request
Jun 14, 2026
MarsQiu007 referenced
this pull request
in MarsQiu007/openNovel
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Effectify SessionPrompt — convert from async functions to the Effect service pattern.
src/effect/runner.ts): a per-session 4-state actor (Idle / Running / Shell / ShellThenRun) with Deferred-based coordination — concurrentloop()callers share results,cancel()interrupts fibers cleanlyEffect.Effect<X, unknown>narrowed:assertNotBusy→Session.BusyError, rest →never; Runner.Cancelled absorbed internallyEffect.fnUntracedfor callback generators, remove unused importsTest plan
bun typecheck— 0 errors across all 13 packages