Skip to content

fix(scripts): auto-warm collaborator cache at source time#3375

Open
la14-1 wants to merge 1 commit intomainfrom
fix/collaborator-cache-warmup
Open

fix(scripts): auto-warm collaborator cache at source time#3375
la14-1 wants to merge 1 commit intomainfrom
fix/collaborator-cache-warmup

Conversation

@la14-1
Copy link
Copy Markdown
Member

@la14-1 la14-1 commented Apr 30, 2026

Why: On schedule-triggered runs, the collaborator cache was never warmed before Claude started — causing the jq collaborator filter to return an empty list and bots to see zero issues/PRs and do nothing useful.

Root cause

collaborator-gate.sh defines _refresh_collaborator_cache but only calls it when is_collaborator() or is_issue_from_collaborator() are invoked. In schedule mode (SPAWN_ISSUE unset), neither is called, so the cache stays cold and the prompt-level jq filter sees no collaborators.

Fix

Add _refresh_collaborator_cache at the end of collaborator-gate.sh so it runs at source time. The function already checks the 10-min TTL — no extra API calls if the cache is fresh.

Testing

  • bash -n passes on the modified script
  • No .ts changes needed — pure shell fix

Fixes #3352
Fixes #3354

-- refactor/team-lead

@la14-1
Copy link
Copy Markdown
Member Author

la14-1 commented May 1, 2026

PR Health Check

  • Mergeable: Yes (no conflicts)
  • CI: All checks pass (ShellCheck, Biome Lint, Mock Tests, Unit Tests, macOS Compatibility)
  • Status: Awaiting review approval

This PR is clean and ready for review. No action needed from maintainer side.

-- refactor/pr-maintainer

On schedule-triggered runs (SPAWN_ISSUE unset), collaborator-gate.sh
was sourced but _refresh_collaborator_cache was never called — only
is_issue_from_collaborator called it, and only in issue mode.

Fix: call _refresh_collaborator_cache at source time (end of file) so
every script that sources the gate always starts with a warm cache.
The function checks the 10-min TTL before making an API call, so
eager invocation is safe and idempotent.

Fixes #3352
Fixes #3354

Agent: team-lead
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@la14-1 la14-1 force-pushed the fix/collaborator-cache-warmup branch from 085ed05 to bf91f4f Compare May 3, 2026 14:19
@la14-1
Copy link
Copy Markdown
Member Author

la14-1 commented May 3, 2026

Rebased onto main (was 4 commits behind). Clean rebase, no conflicts.

-- refactor/pr-maintainer

@la14-1
Copy link
Copy Markdown
Member Author

la14-1 commented May 4, 2026

Verified in worktree: tests pass (2236/2238, same 2 pre-existing failures as main), lint clean (biome 0 errors). PR is mergeable and ready for review.

-- refactor/pr-maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: collaborator cache fix blocked by off-limits infrastructure boundary [Bug]: collaborator cache not refreshed on schedule-triggered runs

2 participants