Skip to content

fix(log-watcher): remove branch filter; fold high-cost alert into primary report#19

Merged
adamhenson merged 3 commits into
mainfrom
fix/log-watcher-trigger-and-dedup
May 29, 2026
Merged

fix(log-watcher): remove branch filter; fold high-cost alert into primary report#19
adamhenson merged 3 commits into
mainfrom
fix/log-watcher-trigger-and-dedup

Conversation

@adamhenson
Copy link
Copy Markdown
Contributor

Addresses two issues flagged in #18:

High - branch filter removed

The branches: [main] filter on the workflow_run trigger caused the watcher to silently skip all PR-branch agent runs, which is the common case for gh-aw. Removing the filter means the workflow fires for any branch, matching the behavior of the Cost Tracker and the rest of the agentics sample pack.

Medium - double-issue removed

Step 8 previously created a second issue for high-cost failures even when Step 7 had already opened a primary diagnosis issue (the no-PR path). This violated the "One report per run" guideline and would spam notifications. The high-cost callout is now folded into the body of the report that Step 7 already posts, keeping exactly one comment or issue per triggering run.

Closes the two bot findings on #18.

@github-actions
Copy link
Copy Markdown

Finding

  • workflows/log-watcher.md:10 removes the branches: main filter from the workflow_run trigger. That means the watcher will now fire for every completed agent-implement / agent-pr-fix run on any branch. If those workflows run on feature or release branches, this will generate extra diagnosis comments/issues for runs you likely meant to ignore, and can create duplicate noise for the same logical agent run. Keep the branch filter unless cross-branch monitoring is intentional.

No other correctness issues stood out in this diff. The Step 8 change is directionally good because it avoids creating a second issue for high-cost failures.

@adamhenson
Copy link
Copy Markdown
Contributor Author

Fair point - both concerns are valid and the real answer is that this should be user-configurable. Updated in 03ccd95: the branches filter is now a commented-out example with a note explaining the trade-off (omit to watch all branches including PRs, uncomment to restrict). The default behavior is correct for the common gh-aw case without silently surprising users who want branch filtering.

@github-actions

This comment was marked as resolved.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Review Summary

This documentation change correctly addresses both issues from #18:

Branch filter removal - Clear comment with trade-off explanation
High-cost alert consolidation - Properly folded into Step 7's report to maintain "one report per run"

Found one minor clarity issue with variable naming consistency between Step 4 and Step 8. Otherwise the changes are clear, accurate, and achieve the stated goals.

Generated by Agent: Code Review for issue #19

Comment thread workflows/log-watcher.md
@adamhenson adamhenson merged commit d30dba7 into main May 29, 2026
4 checks passed
@adamhenson adamhenson deleted the fix/log-watcher-trigger-and-dedup branch May 29, 2026 18:36
@github-actions
Copy link
Copy Markdown

Findings:

  • src/run.ts:71 and src/inputs.ts:19: workflow_run_id mode still treats the status input as the source of truth for rawConclusion, but that input defaults to success. If a caller follows the companion-workflow docs and omits status, failed/cancelled runs will be ingested as success. In this mode, read github.event.workflow_run.conclusion directly or make status required.

  • src/token-extractor.ts:148 and src/comment.ts:160: the Codex JSONL path uses total_token_usage.input_tokens and also cached_input_tokens. Your own type/comment says cached_input_tokens is a subset of input_tokens, so cached prompt tokens get counted twice in cost calculations and also distort the cache-hit-rate math. Subtract cached tokens from the billable input bucket before pricing, or store uncached input separately.

Overall the rest of the flow looks solid, but I couldn’t run the test suite in this checkout because dependencies are not installed.

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.

1 participant