Commit b65066b
committed
fix(provider): raise explicit error when interrupting inactive session so reactor force-clears
Follow-up to 5a63be9. The previous change silenced the error but also
broke the reactor's catchCause path: `interruptTurn` would return
successfully when no active session existed (isActive === false), which
meant the reactor NEVER ran its force-clear code, and the "Working"
indicator stayed stuck on any thread whose provider session was
orphaned between restarts.
Raise a specific `ProviderValidationError` from `interruptTurn` when
the routed session is inactive, so the reactor's existing catchCause
handler always runs, always dispatches a `thread.session.set` with
status="interrupted", and always surfaces the visible "Turn
force-stopped" activity. The contract's `Effect<void, ProviderServiceError>`
return type is preserved — the failure is exactly what the reactor
already knows how to handle.
User-reported repro: thread `013848ab-2305-4125-92b9-9ed3c6faeffe` stuck
on "Working" for hours; clicking Stop now correctly transitions the
thread to an interrupted/error-free state so the user can send a new
message to re-establish the provider session.
Verified:
- Typecheck: 9/9 packages clean
- @marcode/server: 995 pass, 5 skipped (24 ProviderCommandReactor,
26 ProviderService).
- @marcode/web: 1074 pass.1 parent 5a63be9 commit b65066b
1 file changed
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
481 | 482 | | |
482 | 483 | | |
483 | 484 | | |
| |||
490 | 491 | | |
491 | 492 | | |
492 | 493 | | |
493 | | - | |
494 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
495 | 499 | | |
| 500 | + | |
496 | 501 | | |
497 | 502 | | |
498 | 503 | | |
| |||
0 commit comments