You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8c0bc32
Browse filesBrowse the repository at this point in the historyBrowse files
tsouth89
committed
fix(server): keep provider notification consumers alive past startSession
CursorAdapter, GrokAdapter and CodexAdapter fork their notification consumer
with Effect.forkChild inside startSession. forkChild makes it a child of the
calling fiber, and Effect interrupts a fiber's children when that fiber
completes, so the consumer dies the moment startSession returns and every
notification the provider streams afterwards is dropped.
The user-visible symptom is a thread that sits on "Working" forever: the
request succeeds, the provider streams its whole turn, and nothing is
projected.
Each adapter already builds the scope this belongs in. Cursor and Grok create
a session scope, store it on the session context and close it during teardown;
Codex does the same with a local sessionScope. Only the fork target was wrong.
CodexSessionRuntime one layer down already uses Effect.forkIn(runtimeScope), so
this makes the adapters consistent with the pattern the codebase already
follows.
The existing tests could not catch this. They call startSession directly from
the test fiber, which never completes, so the consumer stays alive and the bug
is invisible. Each new test runs startSession in a fiber it then joins, which
is what production does, and asserts a notification arriving afterwards is
still projected. Verified by mutation: restoring forkChild in any one adapter
fails that adapter's test in about 10 seconds, and the suites pass with the
fix.
The tests run on the live clock. Under the default test clock the timeouts wait
on virtual time that never advances, so a regression would hang until the suite
timeout instead of failing where the assertion is.
Fixes#5781
0 commit comments