Oi,Wtf: remount on statewait failure

This commit is contained in:
Levi Neely 2026-06-15 13:42:09 +02:00
parent 98f0a5b28e
commit aecd2b658d
2 changed files with 8 additions and 6 deletions

View File

@ -85,9 +85,10 @@ else
fi
# Wait for agent to finish, then print response
while [ "$(cat "$NAV_PATH/statewait")" = "idle" ]; do :; done
while [ "$(cat "$NAV_PATH/statewait")" != "idle" ]; do :; done
waitstate() { cat "$NAV_PATH/statewait" 2>/dev/null || { ollie-remount && cat "$NAV_PATH/statewait"; } || die "mount lost"; }
while [ "$(waitstate)" = "idle" ]; do :; done
while [ "$(waitstate)" != "idle" ]; do :; done
sleep 0.1
offset=$(cat "$NAV_PATH/offset")
tail -c +$((offset + 1)) "$NAV_PATH/chat"
offset=$(try cat "$NAV_PATH/offset") || die "cannot read offset"
try tail -c +$((offset + 1)) "$NAV_PATH/chat"
printf '\n%s\n' "$NAV_NAME"

View File

@ -79,8 +79,9 @@ fi
printf '%b' "$context\n\nWhat does this code do?" | try tee "$NAV_PATH/prompt" >/dev/null
# Wait for agent to finish, then print response
while [ "$(cat "$NAV_PATH/statewait")" = "idle" ]; do :; done
while [ "$(cat "$NAV_PATH/statewait")" != "idle" ]; do :; done
waitstate() { cat "$NAV_PATH/statewait" 2>/dev/null || { ollie-remount && cat "$NAV_PATH/statewait"; } || die "mount lost"; }
while [ "$(waitstate)" = "idle" ]; do :; done
while [ "$(waitstate)" != "idle" ]; do :; done
sleep 0.1
offset=$(cat "$NAV_PATH/offset")
tail -c +$((offset + 1)) "$NAV_PATH/chat"