Skip to content

fix: token optimizer's self-exclusion bug#135

Merged
mnkiefer merged 2 commits into
mainfrom
fix/token-optimizer-self-exclusion
Jun 14, 2026
Merged

fix: token optimizer's self-exclusion bug#135
mnkiefer merged 2 commits into
mainfrom
fix/token-optimizer-self-exclusion

Conversation

@mnkiefer

@mnkiefer mnkiefer commented Jun 14, 2026

Copy link
Copy Markdown
Contributor
  • Closes Token Optimizer self-exclusion never matches: guard checks for "Token" in a name that is "AIC Usage Optimizer/Audit" #119

  • Fixes the token optimizer's self-exclusion bug. The optimizer currently tells itself to exclude workflows with "Token" in the name, but gh aw logs reports the optimizer and audit workflows by display name:

    • Agentic Workflow AIC Usage Optimizer
    • Daily Agentic Workflow AIC Usage Audit
  • Neither display name contains "Token", so the guard never matches. In practice that leaves the monitoring workflows in the ranking pool, and the optimizer can end up selecting itself or its sibling audit instead of a genuinely expensive target.

@mnkiefer mnkiefer self-assigned this Jun 14, 2026
@mnkiefer mnkiefer requested a review from Copilot June 14, 2026 08:29
@mnkiefer mnkiefer changed the title fix: stop token-optimizer self-targeting the AIC monitoring family fix: token optimizer's self-exclusion bug Jun 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the token optimizer’s self-exclusion logic so the optimizer/audit “AIC monitoring family” cannot end up as optimization targets when ranking workflows by AI credit spend.

Changes:

  • Pre-filters all-runs.json to remove runs belonging to the optimizer/audit workflows (by workflow_path and workflow_name) before aggregating candidate rankings.
  • Updates the Phase 1 selection guardrail text to explicitly exclude the monitoring family by correct identifiers (rather than the non-matching "Token" substring).
Show a summary per file
File Description
.github/workflows/agentic-token-optimizer.md Adds explicit pre-filtering of monitoring-family runs from the candidate pool and updates the selection guardrail text.
.github/workflows/agentic-token-optimizer.lock.yml Regenerated lock workflow reflecting the updated log download + filtering logic.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread .github/workflows/agentic-token-optimizer.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Token Optimizer self-exclusion never matches: guard checks for "Token" in a name that is "AIC Usage Optimizer/Audit"

2 participants