Skip to content

Add cost-tracker workflow for agent spend observability#319

Open
adamhenson wants to merge 3 commits intogithubnext:mainfrom
adamhenson:feat/cost-tracker
Open

Add cost-tracker workflow for agent spend observability#319
adamhenson wants to merge 3 commits intogithubnext:mainfrom
adamhenson:feat/cost-tracker

Conversation

@adamhenson
Copy link
Copy Markdown

Summary

  • Add workflows/cost-tracker.md — fires on workflow_run: completed, downloads the agent-artifacts artifact written by gh-aw's firewall, parses token-usage.jsonl, calculates per-model cost, and posts a spend summary on the associated pull request or creates a cost report issue when no PR is found
  • Add docs/cost-tracker.md — installation instructions, mermaid flow diagram, and configuration guide (modelled after docs/ci-doctor.md)
  • Update README.md — add Cost Tracker to the Fault Analysis Workflows section

Closes #315. Related to #297.

Notes

  • Silent on non-agent runs: if no agent-artifacts artifact exists the workflow produces no output
  • Supports Claude, GPT, and Gemini models with a conservative fallback for unknown models
  • Optional high-spend alert issue when a single run exceeds a configurable threshold (default $1.00)
  • Token data comes from token-usage.jsonl written by gh-aw's firewall — no extra setup needed beyond enabling the firewall (the default)

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.

Sample workflow: agent spend tracker (token cost observability)

1 participant