Skip to content
Merged
Changes from 1 commit
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
13 changes: 12 additions & 1 deletion .github/workflows/agents-issue-optimizer.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: Agents Issue Optimizer

# The recursion guard below correlates prior runs by issue number via `displayTitle`.
# workflow_dispatch runs otherwise display the bare workflow name, so the guard matched
# nothing and reported 0 for an issue it was re-running every minute. Pin the issue
# number into the run name so both trigger types are correlatable.
run-name: >-
Agents Issue Optimizer #${{
github.event.issue.number || inputs.issue_number }}
Comment on lines +7 to +9

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Apply the recursion guard fix to the consumer template

This changes only the Workflows-local copy, but the manifest compiler's workflow ownership policy selects templates/consumer-repo/.github/workflows/agents-issue-optimizer.yml for consumer sync; that template still lacks run-name, uses the 20-run default, and filters with contains. Consequently, the sync workflow will continue distributing the ineffective recursion guard to Fine-Art-Archive and the other consumers, leaving the runaway loop this commit targets unfixed there. Mirror these changes into the consumer template before syncing.

AGENTS.md reference: AGENTS.md:L60-L66

Useful? React with 👍 / 👎.

Comment on lines +7 to +9

on:
issues:
types: [labeled]
Expand Down Expand Up @@ -140,14 +148,17 @@ jobs:
'+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null \
|| date -u -v-1H '+%Y-%m-%dT%H:%M:%SZ')

# `gh run list` defaults to 20 runs, which a tight loop exhausts inside the
# window; ask for enough history to actually see the recursion.
# shellcheck disable=SC2016
count=$(gh run list \
--workflow=agents-issue-optimizer.yml \
--limit 100 \
Comment on lines +152 to +156
--json conclusion,createdAt,displayTitle \
| jq --arg cutoff "$one_hour_ago" \
--arg issue "#$ISSUE_NUMBER" \
'[.[] | select(.createdAt > $cutoff
and (.displayTitle | contains($issue)))
and (.displayTitle | endswith($issue)))
] | length')

echo "Optimizer runs for issue #$ISSUE_NUMBER in last hour: $count"
Expand Down
Loading