From 84d842bfcc7850cb6048bbb516a7309f64e70242 Mon Sep 17 00:00:00 2001 From: adamhenson Date: Fri, 29 May 2026 14:19:01 -0400 Subject: [PATCH 1/3] fix(log-watcher): remove branch filter; fold high-cost alert into primary report --- workflows/log-watcher.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/workflows/log-watcher.md b/workflows/log-watcher.md index 0936fdc..0eecf64 100644 --- a/workflows/log-watcher.md +++ b/workflows/log-watcher.md @@ -10,8 +10,6 @@ on: workflows: ["agent-implement", "agent-pr-fix"] # Edit to match your agent workflow names types: - completed - branches: - - main permissions: read-all @@ -194,14 +192,18 @@ run is degraded or failed, the most likely cause. **If no PR was found**: create an issue using `create_issue` with title: `[log-watcher] #${{ github.event.workflow_run.run_number }}: $HEALTH` -### Step 8: Critical anomaly alert (optional) +### Step 8: High-cost failure callout (optional) -If health is ❌ **Failed** AND total tokens exceed 50 000 (high-cost failure), create a -second issue using `create_issue` with title: -`[log-watcher] High-cost failure: run #${{ github.event.workflow_run.run_number }}` +If health is ❌ **Failed** AND total tokens exceed 50 000, add the following callout +**inside** the report you are already posting (comment or issue from Step 7) - do not +create a separate issue: -Include the full diagnosis and a direct link to the run. Adjust the 50 000-token threshold -in the workflow to match your budget. +```markdown +> ⚠️ **High-cost failure** - this run consumed $TOTAL_TOKENS tokens. Review the token +> breakdown above. Adjust the 50 000-token threshold in the workflow to match your budget. +``` + +This keeps one report per run as required by the guidelines below. ## Guidelines From 03ccd95b31c4dc075e2c1b57594d800b1e9b4dc0 Mon Sep 17 00:00:00 2001 From: adamhenson Date: Fri, 29 May 2026 14:29:21 -0400 Subject: [PATCH 2/3] docs(log-watcher): document optional branch filter with trade-off comment --- workflows/log-watcher.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/workflows/log-watcher.md b/workflows/log-watcher.md index 0eecf64..d3c8d83 100644 --- a/workflows/log-watcher.md +++ b/workflows/log-watcher.md @@ -10,6 +10,9 @@ on: workflows: ["agent-implement", "agent-pr-fix"] # Edit to match your agent workflow names types: - completed + # branches: [main] # Uncomment to restrict to specific branches. + # # Omit (default) to watch all branches, including PR branches, + # # which is the common gh-aw case. permissions: read-all From aae19cea77cd4c70fcbcf601826118860f72e5f5 Mon Sep 17 00:00:00 2001 From: adamhenson Date: Fri, 29 May 2026 14:35:58 -0400 Subject: [PATCH 3/3] docs(log-watcher): define $TOTAL_TOKENS capture in Step 4 for use in Step 8 --- workflows/log-watcher.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/workflows/log-watcher.md b/workflows/log-watcher.md index d3c8d83..5a99345 100644 --- a/workflows/log-watcher.md +++ b/workflows/log-watcher.md @@ -133,6 +133,10 @@ Calculate the following metrics across all lines: Flagged metrics are anomalies - include them in the diagnosis. +Capture the total token count as `$TOTAL_TOKENS` (sum of all `input_tokens`, `output_tokens`, +`cache_read_input_tokens`, and `cache_creation_input_tokens` across all lines) for use in +Step 8. + ### Step 5: Determine run health Assign one of three health levels: