Skip to content

Commit 1909791

Browse files
committed
fix: stop token-optimizer self-targeting the AIC monitoring family
1 parent 635ac65 commit 1909791

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/agentic-token-optimizer.lock.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/agentic-token-optimizer.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,19 @@ steps:
9595
echo '{"runs":[],"summary":{}}' > /tmp/gh-aw/token-audit/all-runs.json
9696
fi
9797
98+
BEFORE_COUNT=$(jq '(.runs // []) | length' /tmp/gh-aw/token-audit/all-runs.json)
99+
jq '
100+
.runs |= map(select(
101+
(.workflow_path // "") != ".github/workflows/agentic-token-optimizer.lock.yml"
102+
and (.workflow_path // "") != ".github/workflows/agentic-token-audit.lock.yml"
103+
and (.workflow_name // "") != "Agentic Workflow AIC Usage Optimizer"
104+
and (.workflow_name // "") != "Daily Agentic Workflow AIC Usage Audit"
105+
))
106+
' /tmp/gh-aw/token-audit/all-runs.json > /tmp/gh-aw/token-audit/all-runs.filtered.json
107+
mv /tmp/gh-aw/token-audit/all-runs.filtered.json /tmp/gh-aw/token-audit/all-runs.json
108+
AFTER_COUNT=$(jq '(.runs // []) | length' /tmp/gh-aw/token-audit/all-runs.json)
109+
echo "🚫 Excluded AIC monitoring family from candidate pool: $((BEFORE_COUNT - AFTER_COUNT)) run(s) removed"
110+
98111
- name: Aggregate top workflows by AIC usage
99112
run: |
100113
set -euo pipefail
@@ -199,7 +212,7 @@ Treat missing numeric fields (`aic`, `token_usage`, `turns`, `action_minutes`) a
199212

200213
- Start from `top-workflows.json`.
201214
- Exclude workflows optimized in the last 14 days (use `optimization-log.json`).
202-
- Exclude workflows with "Token" in the name to avoid self-targeting.
215+
- Exclude the AIC monitoring family — the `agentic-token-optimizer` and `agentic-token-audit` workflows (display names "Agentic Workflow AIC Usage Optimizer" and "Daily Agentic Workflow AIC Usage Audit") — to avoid self-targeting. These workflows are pre-filtered from `all-runs.json` and `top-workflows.json`, but never select them even if a stale snapshot still lists them.
203216
- Choose the highest AI-credit-spend workflow that remains.
204217
- If no snapshot/history exists, derive candidates directly from `all-runs.json`.
205218

0 commit comments

Comments
 (0)