Skip to content

[Bug]: collaborator cache not refreshed on schedule-triggered runs #3352

@la14-1

Description

@la14-1

Context

Follow-up from #3351. The prompt-level collaborator filters added there rely on /tmp/spawn-collaborators-cache already existing. On a schedule-triggered run (where SPAWN_ISSUE is unset), that cache may be stale or missing entirely, because:

  • refactor.sh / security.sh / qa.sh source collaborator-gate.sh, but only call is_collaborator when SPAWN_ISSUE is set
  • is_collaborator is what triggers _refresh_collaborator_cache
  • So on schedule runs, the cache is never warmed before Claude starts — and the jq filter in each prompt returns an empty list

Failure mode

Strictly safer than the alternative (empty list vs. prompt-injection risk), so this is not a security regression. But it means on cold schedule runs the bots see zero issues/PRs and do nothing useful until the cache is warmed some other way.

Fix

In refactor.sh, security.sh, and qa.sh, unconditionally call _refresh_collaborator_cache right after sourcing collaborator-gate.sh — before Claude spawns. Something like:

if [[ -f "${GATE_SCRIPT}" ]]; then
    source "${GATE_SCRIPT}"
    _refresh_collaborator_cache  # warm before Claude runs
fi

This makes every run, scheduled or issue-triggered, start with a fresh (or cache-valid) collaborator list.

Related

Filed from Slack by SPA

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingin-progressIssue is being actively worked onunder-reviewIssue is being reviewed by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions