Files
multica/server/pkg
76dfd4a58b MUL-8186: treat process exit as terminal signal on OpenCode 2.x (#9463)
* fix(opencode): treat process exit as the terminal signal on 2.x

OpenCode 2.x stops consuming step events once the session settles, so the
final step_finish is routinely never written. The daemon failed those
completed runs as 'step still open at EOF' / 'continuation never started',
classified them provider_network and auto-retried, repeating side effects.

On built-in 2.x runtimes, waive the two step-bracketing guards and let the
process outcome decide: exit code, error events, prompt write, cancel /
timeout and scanner errors still fail the run. The void-step guard stays.
1.x and custom runtimes are unchanged.

Also decode the 2.x error payload ({type, message}) so failures surface
their real cause instead of 'unknown opencode error'.

Refs #8892, #9456

Co-authored-by: multica-agent <[email protected]>

* fix(opencode): address review on 2.x terminal-signal relaxation

- Clear the void-step flag on 2.x once later text or a tool call shows the
  run recovered, since the recovering step may never report step_finish.
  1.x still requires that step to close.
- Never report stream-level completion (sawTerminalSignal) on 2.x: an
  intermediate step_finish is not proof the run finished, so a failed
  prompt write keeps failing the run.

Refs #9463

Co-authored-by: multica-agent <[email protected]>

---------

Co-authored-by: Multica Eve <[email protected]>
Co-authored-by: multica-agent <[email protected]>
2026-10-23 14:45:50 +08:00
..