fix: respawn controller stuck after AI check and AI check PATH discovery

Two bugs fixed:

1. Respawn controller got stuck after AI check returned WORKING/ERROR.
   The pre-filter and no-output timers fired once but were never restarted,
   leaving the controller in a dead 'watching' state with no retry mechanism.
   Now restarts both timers after any non-IDLE AI check result and on
   cooldown expiry. Also seeds the controller's terminal buffer from the
   session's existing output so the first AI check has context.

2. AI idle checker couldn't find the claude binary in restricted environments
   (systemd service). The spawned screen ran `claude -p` without PATH
   augmentation. Now exports getAugmentedPath() from session.ts and prepends
   it in the AI checker's bash command.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-24 20:19:55 +01:00
co-authored by Claude Opus 4.5
parent 6025edd0b5
commit 5ce95ee1ba
3 changed files with 25 additions and 2 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ let _augmentedPath: string | null = null;
* prepends its directory to the current PATH if not already present.
* Result is cached for subsequent calls.
*/
function getAugmentedPath(): string {
export function getAugmentedPath(): string {
if (_augmentedPath) return _augmentedPath;
const currentPath = process.env.PATH || '';