[Bug]: Codex reports Stop completed when an acknowledged interrupt never ends the turn
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:
- Start a Codex turn using a protocol fixture that emits the normal turn-start notification.
- Configure
turn/interruptto acknowledge immediately, while leaving the native turn running and withholding its terminal notification. - Use a turn with no descendants, tracked command processes, or pending tool cleanup, so those operations do not extend Stop.
- Request Stop and allow the adapter’s 10-second terminal-confirmation wait to expire.
Expected behavior
An acknowledged interrupt without turn completion should leave Stop pending, mark the agent unresponsive after the timeout, and offer Force stop.
Actual behavior
The adapter logs its interrupt-timeout warning, then synthesizes an interrupted terminal update for the still-active turn. It returns successfully without terminating the provider runtime. This completes before the session manager’s 15-second interrupt timeout, so that timeout does not produce the error used to mark Stop unresponsive.
Impact
Minor bug or occasional failure
Under this failure condition, the application reports interruption without confirmation that native execution stopped, and the Stop banner does not offer Force stop. 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
Codex app-server adapter; controlled protocol fixture. Runtime environment not tested.
Where
- apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts:7650–7677: the 10-second wait expires into a warning, followed by
finalizeRemainingInterruptLineage. - CodexAdapterV2.ts:7507–7514: remaining active contexts are finalized with status
"interrupted". Lines 6214–6220 emit the corresponding provider-turn update. - apps/server/src/orchestration-v2/ProviderSessionManager.ts:1877–1893: the outer timeout applies only while the adapter call remains pending.
- apps/server/src/orchestration-v2/ProviderTurnControlService.ts:229–241: only
ProviderAdapterInterruptTimeoutErrorbecomesunresponsive: true.
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.