fix(engine): a stalled database can no longer hang a turn on 'Thinking' #94

Merged
james.maes merged 1 commits from fix/turn-watchdog-never-hangs into release/0.1 2026-11-09 15:54:39 +00:00
Owner

Dev showed 'Thinking...' for 13+ minutes after two tool calls with no log line and no finalise. Root causes: heartbeat() synchronized with database I/O on the same monitor finish() needs, the deadline/force-finalize ran after two database reads in the watchdog, finish() persisted before emitting message.end, and no INFO phase logging. Fix: deadline first with no database access, bounded abandonable housekeeping worker, finalize guard that ends the stream with an error event, phase logging. New StalledDatabaseTurnsTest: 3 tests fail before the fix, pass after; full ./mvnw verify BUILD SUCCESS. Generated with Claude Code

Dev showed 'Thinking...' for 13+ minutes after two tool calls with no log line and no finalise. Root causes: heartbeat() synchronized with database I/O on the same monitor finish() needs, the deadline/force-finalize ran after two database reads in the watchdog, finish() persisted before emitting message.end, and no INFO phase logging. Fix: deadline first with no database access, bounded abandonable housekeeping worker, finalize guard that ends the stream with an error event, phase logging. New StalledDatabaseTurnsTest: 3 tests fail before the fix, pass after; full ./mvnw verify BUILD SUCCESS. Generated with Claude Code
james.maes added 1 commit 2026-11-09 15:48:52 +00:00
fix(engine): a stalled database can no longer hang a turn on 'Thinking'
maven / build (push) Successful in 5m3s
build / maven (push) Successful in 5m3s
0a65702dab
The watchdog ran the deadline logic after two database reads and heartbeat() was synchronized on the monitor that finish() needs, so one blocked database call stopped the deadline, the force-finalize and the final message.end. The deadline now runs first with no database access, housekeeping runs on a bounded abandonable worker, finish() has a guard that ends the stream with an error event, and every phase logs at INFO.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
james.maes merged commit ba21b72188 into release/0.1 2026-11-09 15:54:39 +00:00
Sign in to join this conversation.