Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/agent-mention-router.yml
Comment thread
seonghobae marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:

- name: Route trusted local agent mention
run: >-
python3 scripts/ci/agent_mention_router.py
python3 -u scripts/ci/agent_mention_router.py
--event-path "${RUNNER_TEMP}/agent-mention-event.json"

sweep-organization-agent-mentions:
Expand All @@ -83,7 +83,7 @@ jobs:
OPENCODE_REPOSITORY_DISPATCH_TARGETS: ${{ vars.OPENCODE_REPOSITORY_DISPATCH_TARGETS }}
LOOKBACK_HOURS: ${{ vars.AGENT_MENTION_LOOKBACK_HOURS || '168' }}
MAX_DISPATCHES: ${{ vars.AGENT_MENTION_MAX_DISPATCHES || '20' }}
TIME_BUDGET_SECONDS: ${{ vars.AGENT_MENTION_TIME_BUDGET_SECONDS || '600' }}
TIME_BUDGET_SECONDS: ${{ vars.AGENT_MENTION_TIME_BUDGET_SECONDS || '480' }}
DRY_RUN: "false"
steps:
- name: Exchange OpenCode app token for sibling-repository comments
Expand Down Expand Up @@ -186,4 +186,4 @@ jobs:
if [ "$DRY_RUN" = "true" ]; then
args+=(--dry-run)
fi
python3 scripts/ci/agent_mention_sweep.py "${args[@]}"
python3 -u scripts/ci/agent_mention_sweep.py "${args[@]}"
23 changes: 16 additions & 7 deletions scripts/ci/agent_mention_sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,22 @@
REPOSITORY_RE = re.compile(r"^ContextualWisdomLab/[A-Za-z0-9_.-]+$")
REPOSITORY_SOURCES = frozenset({"organization", "installation"})
REPOSITORY_ROTATION_SECONDS = 5 * 60
# The sweep-organization-agent-mentions job has a 15-minute GitHub Actions
# timeout; a forced cancellation on that deadline loses the run's log tail
# and metrics. Stop dispatching new work with margin to spare so the sweep
# exits cleanly and reports what it completed. GitHubClient's rate-limit
# retry can now cost up to ~75s of backoff per failing repository, so this
# margin must absorb several such retries, not just normal per-call latency.
DEFAULT_TIME_BUDGET_SECONDS = 600.0
# The sweep-organization-agent-mentions job has a 900s (15-minute) GitHub
# Actions timeout; a forced cancellation on that deadline loses the run's
# log tail and metrics. Stop dispatching new work with margin to spare so
# the sweep exits cleanly and reports what it completed.
#
# Returning early only stops NEW work: list_recent_pull_requests' generator
# cleanup still blocks (executor.shutdown(wait=True)) until every currently
# RUNNING repository fetch finishes on its own. GitHubClient's rate-limit
# retry costs up to ~255s worst case for one repository (six attempts, each
# up to the 30s subprocess timeout, plus ~75s of backoff between them), and
# up to max_workers of those can be running concurrently at the moment the
# deadline trips (bounded by that ceiling, not multiplied by it, since they
# run in parallel). Budget = 900s job timeout - ~60s setup/checkout
# overhead - ~255s worst-case cleanup wait, with a further margin still
# unspent.
DEFAULT_TIME_BUDGET_SECONDS = 480.0


@dataclass
Expand Down
Loading