Repository navigation
Description
Context
PR #1646 (fixes #1645) found that scripts/forge/github/pr-list.sh ran gh straight into a
jq pipe. POSIX sh has no pipefail, so the pipeline reports jq's exit status — a
rate-limited or unauthenticated gh looked like a successful empty result, and its stderr,
the only place the reason is named, was discarded.
That matters beyond cosmetics: Tower's rate-limit suspension (#1645) is driven entirely by a
concept command's exit status and stderr. A concept that swallows them gets negative caching
but can never trigger a suspension and never reports rate-limited — it just returns
empty lists forever while the forge refuses it.
#1646 fixed the concepts on the overview's hot path:
github/pr-list.shgitlab/pr-list.shgitea/issue-list.sh,gitea/recently-closed.sh
(gitea/pr-list.sh, gitea/recently-merged.sh and gitea/user-identity.sh already did this
correctly — with a comment naming the pipefail issue, so the pattern was known.)
What is left
These still pipe their CLI or curl straight into jq:
gitea/_lib.sh gitea/issue-view.sh gitea/issue-search.sh
gitea/pr-create.sh gitea/pr-view.sh
gitlab/issue-view.sh gitlab/issue-search.sh gitlab/pr-exists.sh gitlab/pr-view.sh
linear/issue-list.sh linear/recently-closed.sh linear/issue-view.sh
linear/issue-search.sh linear/issue-comment.sh linear/user-identity.sh
The Linear ones are the reason this is a separate issue rather than more of #1646: their
curl invocation already nests $(jq -n …) inside a -d "…" argument, so the
capture-into-a-variable rewrite needs care with quoting and cannot be done mechanically. An
attempt during #1646 produced a syntax error and was reverted rather than shipped unverified.
What to build
For each script, capture then pipe:
OUT="$(the-cli --args)" || exit $?
printf '%s' "$OUT" | jq '…'- Verify every edited script with
sh -n, and prefer running one against a real forge where
possible — these are not covered by the unit suite. - Where the rewrite makes the first substantive line an assignment, add a
# forge-executable: <tool>declaration: the executable heuristic reads the first
substantive line, so without itcodev doctorstarts reporting the wrong CLI (pr-create is not a forge concept: gh pr create is hardcoded in the skeleton prompts, so non-GitHub forges need a gh shim #1455 — this
exact trap was hit in Fix #1645: cache forge failures and suspend on rate limit #1646). - Consider a test that asserts no concept script pipes a CLI directly into
jq, so the class
cannot come back.
Activity
Fix #1645: unblock the REST identity call; drop a vacuous test and it…
waleedkadous commentedon Sep 8, 2026
Correction: #1646 was superseded, not merged
This issue's body says PR #1646 shipped part of the fix. It did not — #1646 was closed
unmerged on 2026-09-08 and the core is being rebuilt on a fresh branch (architect decision;
ten rounds of fix-on-fix, and one commit whose message described changes it did not contain).
So the behaviour this issue builds on does not exist yet. Read the body as describing the
design that #1645's rebuild will land, not the current state of
main.The specific invariants are captured as one-line testable statements in the rebuild's pitfall
list (
/tmp/bugfix-1645-pitfalls.md, attached to the #1645 lane), including the ones thisissue depends on. Sequence this work after the rebuild lands.