t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: OpenCode abort timeout does not enable Force stop

Open nima20002000 opened this issue 3 weeks ago • 0 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

Code-derived reproduction, not executed:

  1. Start an OpenCode turn and wait until prompt admission has completed.
  2. Keep the turn active and withhold terminal events.
  3. Configure client.session.abort to remain pending until its request is cancelled.
  4. Request Stop and allow the adapter’s 10-second abort timeout to expire.
  5. Keep the same behavior for subsequent interrupt attempts.

Expected behavior

A timed-out abort should mark Stop unresponsive and offer Force stop.

Actual behavior

The adapter’s timeout fails before the session manager’s 15-second timeout. While the turn remains unfinalized, the adapter resets turn.interrupted and wraps the failure in ProviderAdapterInterruptError.

ProviderTurnControlService does not classify that error as unresponsive. The interrupt effect follows generic failure/retry handling, rather than enabling Force stop.

Impact

Minor bug or occasional failure

A provider that never answers abort can leave Stop unresolved without offering the intended Force stop recovery action. It needs a provider that doesn't confirm the stop (or the timing described above), so it is occasional rather than constant.

Version or commit

main @ 9e85538535

Environment

OpenCode adapter with a controlled SDK endpoint. Runtime environment not tested.

Where


Found by reading the code while porting the Stop / Force stop changes (6b1245cced, 5f2c27e706) into a fork. Derived from the code at 9e85538535; not reproduced at runtime.

nima20002000 avatar Nov 04 '26 16:11 nima20002000