Skip to content

Watch: shared issue fetch across capabilities to reduce API rate limit usage #923

Closed

Description

@tamirdresher

Feature: Shared issue fetch across capabilities in watch rounds

Problem

Each capability (execute, two-pass, wave-dispatch, board, etc.) independently calls gh issue list during a watch round. Running 7 capabilities × 4 repos = 28+ GraphQL calls per round. This burns through the 5000/hr rate limit fast — especially when polling every 10-15 minutes.

Observed calls in a single round:

Check:         gh issue list --label squad --limit 20
two-pass:      gh issue list --label squad --limit 200
execute:       gh issue list --label squad --limit 50
wave-dispatch: gh issue list --label squad --limit 50
board:         gh project item-list ...

Proposed fix

Fetch issues once per round at the top of the cycle, then pass the result to all capabilities as shared context. Each capability filters the shared data instead of making its own API call.

Something like:

// In the round runner
const issues = await fetchSquadIssues(repo, 200); // one call
const projectItems = await fetchProjectBoard(owner); // one call

for (const capability of enabledCapabilities) {
  await capability.run({ issues, projectItems, ...context });
}

Impact

Would reduce API calls from ~5-7 per round to ~2 per round (issues + board). Critical for multi-repo setups.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions