run-plan: per-session timeout (SESSION_MAX, default 90 min)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-26 03:12:26 -07:00
co-authored by Claude Opus 5.5
parent 5ce625be33
commit c8d0e2b44a
+3 -2
View File
@@ -45,9 +45,10 @@ for task in "$plan"/[0-9][0-9]-*.md; do
# shellcheck disable=SC2086
# </dev/null: OpenCode 1.15 reads a piped stdin as extra prompt and waits for EOF, so a
# backgrounded driver would hang before the first model request (2026-09-25).
if ! opencode run -m "$model" $flags --title "$milestone/$name" "$prompt" </dev/null \
# timeout: a looping session (P5a task 06 ran 3 h) ends at SESSION_MAX seconds (default 90 min).
if ! timeout "${SESSION_MAX:-5400}" opencode run -m "$model" $flags --title "$milestone/$name" "$prompt" </dev/null \
> "$runs/$name.log" 2>&1; then
echo "run-plan: opencode exited with an error in $name; see $runs/$name.log" >&2
echo "run-plan: opencode exited with an error (or hit SESSION_MAX) in $name; see $runs/$name.log" >&2
exit 1
fi
echo "=== $milestone/$name: session ended $(date '+%H:%M:%S')"