Skip to content

docs: add status-values.md and update README status input#16

Merged
adamhenson merged 5 commits intomainfrom
fix/workflow-run-fallbacks
Mar 29, 2026
Merged

docs: add status-values.md and update README status input#16
adamhenson merged 5 commits intomainfrom
fix/workflow-run-fallbacks

Conversation

@adamhenson
Copy link
Copy Markdown
Contributor

Summary

  • New docs/status-values.md documenting how the status input works:
    • How status is determined in companion vs inline mode
    • Built-in GitHub conclusion mapping table (normalizeConclusion)
    • Custom statuses with needs_human example (conditional YAML expression)
    • Full table of all valid AgentMeter status values and which are settable
  • Updated README inputs table status row to reference the new doc and mention needs_human

Test plan

  • CI passes
  • AgentMeter inline test fires on this PR

Made with Cursor

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 29, 2026

⚡ AgentMeter

# Workflow Model Status Cost Duration
1 Agent: Code Review claude-sonnet-4-5 $0.00 2m
2 Agent: Code Review (Codex) gpt-5.4-mini $0.09 34s
3 AgentMeter — Inline Test claude-sonnet-4-5 $0.01 11s
4 Agent: Code Review claude-sonnet-4-5 $0.35 5m
5 Agent: Code Review (Codex) gpt-5.4-mini $0.24 48s
Total $2.31
All 15 runs
# Workflow Model Status Cost Duration
1 Agent: Code Review claude-sonnet-4-5 $0.00 2m
2 Agent: Code Review (Codex) gpt-5.4-mini $0.09 34s
3 AgentMeter — Inline Test claude-sonnet-4-5 $0.01 11s
4 Agent: Code Review claude-sonnet-4-5 $0.35 5m
5 Agent: Code Review (Codex) gpt-5.4-mini $0.24 48s
6 Agent: Code Review claude-sonnet-4-5 🚫 $0.00 1m
7 Agent: Code Review (Codex) gpt-5.4-mini $0.27 58s
8 AgentMeter — Inline Test claude-sonnet-4-5 $0.01 10s
9 AgentMeter — Inline Test claude-sonnet-4-5 $0.01 12s
10 Agent: Code Review claude-sonnet-4-5 $0.32 5m
11 Agent: Code Review (Codex) gpt-5.4-mini $0.53 2m
12 AgentMeter — Inline Test claude-sonnet-4-5 $0.01 12s
13 Agent: Code Review claude-sonnet-4-5 $0.29 4m
14 Agent: Code Review (Codex) gpt-5.4-mini $0.17 52s
15 AgentMeter — Inline Test claude-sonnet-4-5 $0.01 11s
Total $2.31
Token breakdown
Type Tokens Cost
Input 0 $0.00
Output 0 $0.00
Cache writes 0 $0.00
Cache reads 0 $0.00

Model: claude-sonnet-4-5

View in AgentMeter →

@github-actions
Copy link
Copy Markdown

  • High: docs/status-values.md:11-18 and README.md:284 claim workflow_run_id makes status resolve automatically from the triggering workflow. The implementation does not do that: src/run.ts:69-83 still passes inputs.status, and src/inputs.ts:18 defaults missing status to success. If users follow the new docs and omit status, failed companion runs will be recorded as success. Please either change the code to read github.event.workflow_run.conclusion internally or correct the docs to require status: ${{ github.event.workflow_run.conclusion }}.

Otherwise the status mapping table looks consistent with normalizeConclusion().

cache_writes are tokens processed fresh to populate the cache and
belong in the denominator alongside input_tokens. Previous formula
ignored them, inflating the hit rate (e.g. 100% instead of ~69%).

New formula: reads / (reads + writes + input)

Made-with: Cursor
@github-actions
Copy link
Copy Markdown

Two issues:

  • High: src/run.ts and src/workflow-run.ts can produce blank ingest data when getWorkflowRun fails. The fallback path sets resolvedWorkflowName to '' and serializes missing timestamps as '', so the API/comment can end up with empty workflow names and invalid dates instead of a clean fallback or skip. Keep the companion workflow name when the run lookup fails, and avoid sending empty timestamp strings.

  • Medium: src/run.ts marks token data as approximate based on baseTokens, even when explicit token inputs override the extracted values. If a caller supplies exact token counts alongside agent_output, the final payload/comment can still be labeled approximate. Derive isApproximate from the final merged source of each field, or force it to false when all token counts are explicitly provided.

Core flow otherwise looks solid.

@github-actions
Copy link
Copy Markdown

No blocking issues found in the patch.

The cache-hit-rate change in src/comment.ts is internally consistent, and the new tests in tests/comment.test.ts cover the new denominator. I couldn’t run the suite locally because the workspace is missing installed dependencies, so the only residual risk is runtime integration rather than an obvious code defect.

@adamhenson adamhenson merged commit 3b74d7d into main Mar 29, 2026
4 checks passed
@adamhenson adamhenson deleted the fix/workflow-run-fallbacks branch March 29, 2026 20:51
@github-actions
Copy link
Copy Markdown

No correctness or production issues found in action.yml. Removing author is metadata-only and does not affect runtime behavior.

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