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
4 changes: 2 additions & 2 deletions .github/workflows/agentic-token-optimizer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 23 additions & 1 deletion .github/workflows/agentic-token-optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,28 @@ steps:
echo '{"runs":[],"summary":{}}' > /tmp/gh-aw/token-audit/all-runs.json
fi

BEFORE_COUNT=$(jq '(.runs // []) | length' /tmp/gh-aw/token-audit/all-runs.json)
jq '
(.runs // [])
| map(select(
(.workflow_path // "") != ".github/workflows/agentic-token-optimizer.lock.yml"
and (.workflow_path // "") != ".github/workflows/agentic-token-audit.lock.yml"
and (.workflow_name // "") != "Agentic Workflow AIC Usage Optimizer"
and (.workflow_name // "") != "Daily Agentic Workflow AIC Usage Audit"
)) as $runs
| {
summary: {
total_runs: ($runs | length),
total_tokens: ($runs | map(.token_usage // 0) | add // 0),
total_aic: ($runs | map(.aic // 0) | add // 0)
},
runs: $runs
}
' /tmp/gh-aw/token-audit/all-runs.json > /tmp/gh-aw/token-audit/all-runs.filtered.json
mv /tmp/gh-aw/token-audit/all-runs.filtered.json /tmp/gh-aw/token-audit/all-runs.json
AFTER_COUNT=$(jq '(.runs // []) | length' /tmp/gh-aw/token-audit/all-runs.json)
echo "🚫 Excluded AIC monitoring family from candidate pool: $((BEFORE_COUNT - AFTER_COUNT)) run(s) removed"

- name: Aggregate top workflows by AIC usage
run: |
set -euo pipefail
Expand Down Expand Up @@ -199,7 +221,7 @@ Treat missing numeric fields (`aic`, `token_usage`, `turns`, `action_minutes`) a

- Start from `top-workflows.json`.
- Exclude workflows optimized in the last 14 days (use `optimization-log.json`).
- Exclude workflows with "Token" in the name to avoid self-targeting.
- 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.
- Choose the highest AI-credit-spend workflow that remains.
- If no snapshot/history exists, derive candidates directly from `all-runs.json`.

Expand Down