From bf91f4fdb529f56f4c7b5c29e186e7876866c80e Mon Sep 17 00:00:00 2001 From: B <6723574+louisgv@users.noreply.github.com> Date: Thu, 30 Apr 2026 00:23:42 +0000 Subject: [PATCH] fix(scripts): auto-warm collaborator cache at source time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .claude/scripts/collaborator-gate.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.claude/scripts/collaborator-gate.sh b/.claude/scripts/collaborator-gate.sh index 6785c0834..3d699ee53 100644 --- a/.claude/scripts/collaborator-gate.sh +++ b/.claude/scripts/collaborator-gate.sh @@ -79,3 +79,8 @@ is_issue_from_collaborator() { author=$(gh issue view "$issue_num" --repo "$_COLLAB_REPO" --json author --jq '.author.login' 2>/dev/null) || return 1 is_collaborator "$author" } + +# Auto-warm cache at source time so schedule-triggered runs always start with a fresh list. +# is_collaborator() calls _refresh_collaborator_cache, but only on issue-mode runs. +# This ensures schedule-mode runs also get a warm cache before Claude starts. +_refresh_collaborator_cache