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 }}
This repository was archived by the owner on Nov 7, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 7, 2026. It is now read-only.
fix(cli): non-interactive run can exit before printing its turn in two cases #50
Found by GPT-6 Sol during review of #49 (round 3). Both are existing opencode run (non-interactive) behavior, inherited from upstream and not introduced by #49.
run --attach returns as soon as the HTTP request completes.finish() skips awaiting the event loop in attach mode (if (args.attach) return, added upstream in fix(opencode): await run event loop anomalyco/opencode#31389, "await run event loop", with no stated reason for the attach exception). The event stream is a separate connection, so the process can exit before the loop prints the answer or a provider error, and can exit 0 after an error.
run --session <id> against a session still finishing an earlier turn. The loop breaks on the first session.status: idle for the session. That turn's idle can arrive after server.connected but before the new prompt starts, leaving the new request with no listener: output is lost, and a failed request falls back to the generic 500.
Why this isn't in #49: both change the completion contract of upstream-owned code, and the attach exception probably exists to avoid a hang (an attached event stream may never report idle for the directory scope). A fix needs to (a) find out why anomalyco#31389 excluded attach, then wait for the session's terminal event in attach mode too and propagate its error to the exit code, and (b) only treat idle as completion after the newly sent turn has been observed running.
Tests to add: a successful serve + run --attach with delayed event delivery; a run --session on a session with a turn in flight.
Closing as won't-fix. Fixing it would mean changing completion logic in inherited run.ts (attach mode was deliberately excluded from waiting upstream in anomalyco#31389), which adds divergence for a path no swXtch workflow currently relies on: plain in-process opencode run is unaffected. Reopen if a workflow comes to depend on non-interactive run --attach or --session.
Activity
fix(cli): address round 3 of cross-model review on --effort
fix(cli): make --effort work and fail loudly everywhere (#49)
brentyates-swx commentedon Sep 26, 2026
Closing as won't-fix. Fixing it would mean changing completion logic in inherited
run.ts(attach mode was deliberately excluded from waiting upstream in anomalyco#31389), which adds divergence for a path no swXtch workflow currently relies on: plain in-processopencode runis unaffected. Reopen if a workflow comes to depend on non-interactiverun --attachor--session.