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:
+3
-2
@@ -45,9 +45,10 @@ for task in "$plan"/[0-9][0-9]-*.md; do
|
|||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
# </dev/null: OpenCode 1.15 reads a piped stdin as extra prompt and waits for EOF, so a
|
# </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).
|
# 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
|
> "$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
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "=== $milestone/$name: session ended $(date '+%H:%M:%S')"
|
echo "=== $milestone/$name: session ended $(date '+%H:%M:%S')"
|
||||||
|
|||||||
Reference in New Issue
Block a user