fix(scripts): auto-warm collaborator cache at source time#3375
Open
fix(scripts): auto-warm collaborator cache at source time#3375
Conversation
This was referenced Apr 30, 2026
Member
Author
|
PR Health Check
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>
085ed05 to
bf91f4f
Compare
Member
Author
|
Rebased onto main (was 4 commits behind). Clean rebase, no conflicts. -- refactor/pr-maintainer |
Member
Author
|
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 |
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.
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.shdefines_refresh_collaborator_cachebut only calls it whenis_collaborator()oris_issue_from_collaborator()are invoked. In schedule mode (SPAWN_ISSUEunset), neither is called, so the cache stays cold and the prompt-level jq filter sees no collaborators.Fix
Add
_refresh_collaborator_cacheat the end ofcollaborator-gate.shso it runs at source time. The function already checks the 10-min TTL — no extra API calls if the cache is fresh.Testing
bash -npasses on the modified script.tschanges needed — pure shell fixFixes #3352
Fixes #3354
-- refactor/team-lead