Repository navigation
Mark headless runs stopped by a plan usage limit - #21
Merged
Merged
Conversation
When a headless bstack or autopilot run exits nonzero on a ChatGPT or Claude plan limit, the runner adds reason: "usage-limit" to .bercail/handoff-result.json. status, summary and session_id are unchanged, a plain 429 is not a usage limit, and nothing reruns or switches plans. Adds tests/usage_limit_reason_test.sh (stubs only).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a headless bstack or autopilot run exits nonzero on a plan usage limit, the runner adds the optional field
reason: "usage-limit"to.bercail/handoff-result.json, so Shep can propose a rerun on another plan.status,summaryandsession_idare unchanged. Nothing reruns or switches plans.provider.chatgpt-limit, or codesubscription_sharing_usage_limit_exceededin the error body.provider.rate-limitis not a usage limit (xAI's weekly-limit body is unverified).Docs: README,
docs/bstack/07-handoff.md,skills/handoff/SKILL.md.Tests
tests/usage_limit_reason_test.shreplays the recorded errors through a stub opencode (no live provider calls): ChatGPT limit -> failed + usage-limit (bstack and autopilot), Claude text as JSON and as stderr -> failed + usage-limit, 429 -> no reason, mentions in other JSON -> no reason.tests/*_test.shpass locally on this branch, and on a trial merge of Report the notify follower as restarting after update #18 + Warn when no notify sink covers a repo, and add repo add/remove #19 + Point handoff worktrees at the main checkout's beads database #20 + this PR.Review
Only the Grok council reviewer ran (two rounds); the Claude and GPT reviewers were at their plan usage limits. A manual review fixed one bug: the stderr fallback piped jq into
grep -qunderpipefail, so on a long log grep's early exit SIGPIPE'd jq and the match was lost (reproduced with a 20k-line log). It now usesgrep -E ... >/dev/null.Overlap
tests/handoff_spawn_test.sh: same linked-worktree.gitmkdir fix as Warn when no notify sink covers a repo, and add repo add/remove #19, byte-identical, so it merges cleanly.skills/handoff/scripts/handoff-stages.sh: also edited by Point handoff worktrees at the main checkout's beads database #20 (different hunks).Merge order: Report the notify follower as restarting after update #18, Warn when no notify sink covers a repo, and add repo add/remove #19, Point handoff worktrees at the main checkout's beads database #20, then this.
git merge-treeshows no conflicts in that order.