Repository navigation
Description
Context
#1645 fixed the runaway: Tower no longer re-spawns forge commands on every 2.5 s dashboard
poll, and it now suspends on a rate limit. Steady state came down from ≈9,090 gh
spawns/hour to 52 per watched workspace per hour.
What #1645 deliberately did not do is item 4 of its prescribed fix — collapse the
per-workspace overview fetch into a single GraphQL request. It was left out because it
does not fit BUGFIX: it is a change to the forge abstraction shipped to adopters, not a
localized fix.
What is left to do
OverviewCache makes four GitHub-API-backed calls per workspace per refresh window:
| concept | command | cost |
|---|---|---|
pr-list |
gh pr list --json … |
1 GraphQL request |
issue-list |
gh issue list --limit 200 --json … |
2 pages |
recently-closed |
gh issue list --state closed --search 'closed:>…' --limit 1000 |
multi-page search |
recently-merged |
gh pr list --state merged --search 'merged:>…' --limit 1000 |
multi-page search |
All four ask the same repo for overlapping data. One gh api graphql query can return
open PRs, open issues, and both 24 h search windows in a single request, taking the
per-workspace cost from ~4 calls (and well over 4 points) to 1.
Why it needs AIR rather than BUGFIX
It is not a one-file change:
- a new forge concept (
overview-bundleor similar) added toKNOWN_CONCEPTS; - a GitHub script issuing the combined query, plus the response-shape mapping;
- a contract type in
forge-contracts.ts, since the concept returns a composite
rather than one of the existing list shapes; - fallback behaviour for gitlab/gitea/linear and for any project that overrides or
disables the concept —OverviewCachemust still work by making the four calls; codev doctorconcept reporting and the spend projection in
servers/overview-budget.tsboth need updating;- tests on both the bundle path and the fallback path.
Correction to carry forward
#1645's text suggested moving the two --search calls to REST gh api search/issues for
"a separate 5,000 budget". That is wrong and should not be done — the GitHub search
resource is 30 requests per minute, not 5,000 per hour (measured on this account:
{"limit":30,"remaining":30}). Collapsing into one GraphQL query is the right direction.
Acceptance
- One forge call per workspace per refresh window on GitHub.
- Non-GitHub forges, and any project that disables the concept, keep working via the
existing four calls. projectHourlyForgeCallsreflects the new call count, andcodev doctorreports it.
Activity
waleedkadous commentedon Nov 29, 2026
Closing: this was a deliberate copy of the one-call Tower overview issue (#1647), which PR #2004 has now delivered (merged as 75a2ed4). PR #2005, built against this copy, is closed unmerged.