You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4. Compute an overall summary: total runs, total tokens, total action minutes.
134
133
5. Sort workflows descending by `total_tokens`.
135
134
6. Save the result to `/tmp/gh-aw/token-audit/audit_snapshot.json` with this shape:
136
135
@@ -141,7 +140,6 @@ Write a Python script to `/tmp/gh-aw/token-audit/process_audit.py` and run it. T
141
140
"overall": {
142
141
"total_runs": N,
143
142
"total_tokens": N,
144
-
"total_cost": F,
145
143
"total_action_minutes": F
146
144
},
147
145
"workflows": [
@@ -150,8 +148,6 @@ Write a Python script to `/tmp/gh-aw/token-audit/process_audit.py` and run it. T
150
148
"run_count": N,
151
149
"total_tokens": N,
152
150
"avg_tokens": N,
153
-
"total_cost": F,
154
-
"avg_cost": F,
155
151
"total_turns": N,
156
152
"avg_turns": F,
157
153
"total_action_minutes": F,
@@ -163,15 +159,15 @@ Write a Python script to `/tmp/gh-aw/token-audit/process_audit.py` and run it. T
163
159
}
164
160
```
165
161
166
-
Handle null/missing `token_usage`and `estimated_cost`by treating them as 0.
162
+
Handle null/missing `token_usage` by treating them as 0.
167
163
168
164
## Phase 2 — Persist Snapshot to Repo-Memory
169
165
170
166
1. Read the snapshot from `/tmp/gh-aw/token-audit/audit_snapshot.json`.
171
167
2. Copy it to `/tmp/gh-aw/repo-memory/default/YYYY-MM-DD.json` (today's UTC date).
172
168
3. This file is what the optimizer workflow reads to identify high-usage workflows.
173
169
174
-
Also maintain a rolling summary file at `/tmp/gh-aw/repo-memory/default/rolling-summary.json` that contains an array of daily overall totals (date, total_tokens, total_cost, total_runs, total_action_minutes) for the last 90 entries. Load the existing file, append today's entry, trim to 90, and save.
170
+
Also maintain a rolling summary file at `/tmp/gh-aw/repo-memory/default/rolling-summary.json` that contains an array of daily overall totals (date, total_tokens, total_runs, total_action_minutes) for the last 90 entries. Load the existing file, append today's entry, trim to 90, and save.
175
171
176
172
Do not append a synthetic zero-valued entry to `rolling-summary.json` when either of these conditions is true:
177
173
@@ -218,15 +214,14 @@ Create an issue with these sections:
218
214
- **Period**: last 24 hours (YYYY-MM-DD to YYYY-MM-DD)
219
215
- **Total runs**: N
220
216
- **Total tokens**: N (formatted with commas)
221
-
- **Total cost**: $X.XX
222
217
- **Total Actions minutes**: X.X min
223
218
- **Active workflows**: N
224
219
225
220
### 🏆 Top 5 Workflows by Token Usage
226
221
227
-
| Workflow | Runs | Total Tokens | Avg Tokens | Total Cost | Avg Cost |
228
-
|---|---|---|---|---|---|
229
-
| ... | ... | ... | ... | ... | ... |
222
+
| Workflow | Runs | Total Tokens | Avg Tokens |
223
+
|---|---|---|---|
224
+
| ... | ... | ... | ... |
230
225
231
226
### 📈 Trends
232
227
@@ -236,7 +231,7 @@ Embed chart images using uploaded asset URLs when available:
You are the Agentic Workflow Token Optimizer. Pick one high-cost workflow, audit recent runs, and create a conservative optimization issue with measurable savings. Your recommendations may include prompt, tool, reliability, setup-prefix, and inline sub-agent improvements when the evidence supports them.
112
+
You are the Agentic Workflow Token Optimizer. Pick one high-token workflow, audit recent runs, and create a conservative optimization issue with measurable improvements. Your recommendations may include prompt, tool, reliability, setup-prefix, and inline sub-agent improvements when the evidence supports them.
115
113
116
114
## Objectives
117
115
@@ -154,7 +152,7 @@ Prefer `--jq` on `gh api` calls over a separate `| jq` step when the filter is s
0 commit comments