Skip to content

fix(ai): count prompt cache reads and writes in Anthropic and Bedrock input tokens - #3662

Merged
Erik Osterman (Cloud Posse) (osterman) merged 1 commit into
cloudposse:mainfrom
Haarris:fix/ai-usage-input-includes-cache
Nov 17, 2026
Merged

Erik Osterman (Cloud Posse) (osterman) merged 1 commit into
cloudposse:mainfrom
Haarris:fix/ai-usage-input-includes-cache

Conversation

@Haarris

@Haarris Haris Farooq (Haarris) commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

what

  • Anthropic and Bedrock: InputTokens (and TotalTokens) now include prompt cache reads and writes, as they already do for the OpenAI-compatible and Gemini providers. The conversion is in one shared helper, base.UsageFromAnthropic, used by both clients.
  • Usage is kept when a reply reports only cached input (input_tokens: 0), instead of being dropped.
  • Comments on types.Usage and formatter.TokenUsage, and the atmos ai exec docs, say that cached and cache_creation are parts of prompt.

why

  • Follow-up to the review discussion on fix(ai): send the system prompt and ATMOS.md to Bedrock, with prompt caching #3626. The Anthropic API and Claude on Bedrock count cache reads and writes outside input_tokens: total input = input_tokens + cache_read_input_tokens + cache_creation_input_tokens. OpenAI's prompt_tokens and Gemini's promptTokenCount already include cached tokens.
  • So with caching on, Anthropic and Bedrock reported only the uncached tail as input. For a reply with input_tokens 90, output_tokens 12 and 5,526 tokens read from the cache, the footer showed ↑ 90 · ↓ 12 · cache: 5.5k and now shows ↑ 5.6k · ↓ 12 · cache: 5.5k; tokens.prompt in atmos ai exec --format json is 5,616 instead of 90. That matches what the docs example already implies (cached 890 within prompt 1,234).
  • CacheReadTokens / CacheCreationTokens are unchanged, and nothing else reads InputTokens (checked: chat footer and session totals, atmos ai exec JSON, session export).

Tests:

  • pkg/ai/agent/base/usage_test.go: no cache, cache read only, cache write only, both, whole prompt from cache, output only, no tokens (nil); cache counts never exceed InputTokens.
  • Anthropic and Bedrock parser tests updated for the new totals, plus a cache-read-only reply for each. The old TestUsageCalculations "With cache tokens" case now expects input 900 / total 1,100.

go vet, gofumpt and golangci-lint (v2.13.2, repo config) are clean on the changed packages, go build ./... passes, and go test passes for every package that imports the changed code.

references

Summary by CodeRabbit

  • Bug Fixes

    • Token usage totals now include prompt-cache reads and writes in input token counts, including responses where cached tokens are the only reported input. Total token counts reflect these cache tokens alongside output tokens.
  • Documentation

    • Clarified that prompt token counts include cache-read and cache-write tokens, and that cache-specific counts are included in prompt totals and omitted when zero.

… input tokens

The Anthropic API and Claude on Bedrock report cache reads and writes
outside input_tokens (total input = input_tokens +
cache_read_input_tokens + cache_creation_input_tokens). The
OpenAI-compatible and Gemini clients already put cached tokens inside
InputTokens, so the same field meant different things per provider,
and with caching on the Anthropic and Bedrock prompt counts in the chat
footer and `atmos ai exec` JSON showed only the uncached tail.

Add base.UsageFromAnthropic, used by both clients, so InputTokens and
TotalTokens include cache reads and writes, and keep usage when a reply
reports only cached input. Document that the cache counts are part of
the prompt count.
@Haarris
Haris Farooq (Haarris) requested a review from a team as a code owner November 10, 2026 06:42
@atmos-pro

atmos-pro Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

@github-actions github-actions Bot added the size/m Medium size PR label Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

CI timing summary

Latest completed GitHub Actions runs for 3e94fd9e27b4.

  • PR wall-clock time: 56h 26m 23s
  • Aggregate runner time: 15h 50m 06s
  • Included: 14 workflows, 131 jobs (including matrix jobs)

Wall-clock time spans the earliest included workflow creation through the latest completion. Aggregate runner time adds each job's execution time, so concurrent jobs are counted separately.

Workflow Elapsed Runner time Jobs
❌ Tests 56h 26m 23s 13h 38m 31s 113
✅ Benchmarks 56h 06m 09s 33m 11s 1
✅ Website Preview Build 55h 54m 02s 20m 59s 1
✅ Pre-commit 55h 38m 42s 5m 42s 1
✅ Dependency Review 55h 36m 41s 3m 42s 1
✅ TruffleHog secret scan 55h 33m 55s 56s 1
✅ Verify Repository Symlinks 55h 33m 30s 27s 1
✅ Validate Codeowners 55h 33m 27s 29s 1
✅ autofix.ci 55h 33m 17s 20s 1
⏭️ atmos.ci 55h 32m 55s 0s 1
✅ CodeQL 46m 11s 1h 05m 14s 6
✅ Release Documentation Check 42s 32s 1
✅ Quality Gate Signal 12s 3s 1
⏭️ landing-demos 10s 0s 1
Longest jobs (top 10)
Job Workflow Duration Conclusion
govulncheck CodeQL 46m 00s ✅ success
Acceptance Tests (windows, shard 1/10) Tests 35m 16s ✅ success
benchmark Benchmarks 33m 11s ✅ success
Template compatibility (macos) Tests 24m 18s ✅ success
[race] non-acceptance test suite (shard 1/4) Tests 24m 07s ✅ success
website-deploy-preview Website Preview Build 20m 59s ✅ success
[race] non-acceptance test suite (shard 2/4) Tests 20m 08s ✅ success
Acceptance Tests (macos, shard 1/10) Tests 19m 28s ✅ success
Acceptance Tests (windows, shard 4/10) Tests 19m 23s ✅ success
[race] non-acceptance test suite (shard 4/4) Tests 18m 57s ✅ success

Updated automatically when a PR workflow finishes.

@github-actions github-actions Bot added the quality:not-ready One or more Quality Gate requirements are pending or failing label Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Quality Gate   Quality Gate passed

Readiness

✅ Ready for review

✅ No merge conflicts

✅ Release label and milestone

✅ Verified commit signatures

✅ Fewer than 150 changed files

Reviews

✅ CodeRabbit approval (current head)

✅ Review threads resolved or dismissed

Measures

✅ All CI checks and workflows

✅ Codecov (current head)

✅ Benchmark results

View job summary

Current commit: 3e94fd9e27b4fce716decdc9ebbbf43fd97b57b7 · quality:ready

Quality Gate details
Gate Status Evidence
Ready for review Passed Marked ready for review
No merge conflicts Passed No merge conflicts with the target branch
Release label and milestone Passed patch fits next release 1.235.0 (published baseline v1.234.1)
All CI checks and workflows Passed 152 current PR CI results passed or were skipped/neutral
Codecov (current head) Passed codecov/patch: success; codecov/project: success
CodeRabbit approval (current head) Passed APPROVED
Verified commit signatures Passed 1/1 commits have GitHub-verified signatures
Review threads resolved or dismissed Passed 0 unresolved review threads (outdated threads still count)
Fewer than 150 changed files Passed 9 changed files; maximum 149
Benchmark results Passed No benchmark report processing error recorded for this head
🤖 Next steps for this PR
PR: https://github.com/cloudposse/atmos/pull/3662
Head: 3e94fd9e27b4fce716decdc9ebbbf43fd97b57b7

1. Investigate the advisory performance warning: reproduce the flagged workload with go tool mage bench:run, then bench:fetch and bench:compare. Compare the same candidate against each main snapshot independently. Use bench:fieldTest for a known-good/bad revision pair. Inspect backend-read counts and timing variability before attributing a slowdown. Performance warnings do not block readiness.

Atmos performance

No significant regressions detected against the newest compatible snapshot.

  • warning: 2 metrics against snapshot 3bc8c259c7a0d5e3955e8a26cda3c763c4df3791 (Nov 07 05:55 UTC).
  • warning: 12 metrics against snapshot 731728e80f66bda0dffa2d4c8bc106f32374c7b0 (Nov 06 19:42 UTC).
Describe affected
Benchmark / metric Main snapshot (UTC) Main Current PR PR change Significance
tests/benchmarks/CLI/DescribeAffected/Dependents/instances=1000-2 (sec/op) 86264f7f7f73 Nov 10 04:19 4.9904 4.9893 -0.02% p=0.7959
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=dependents-2 (sec/op) 86264f7f7f73 Nov 10 04:19 2.0218 1.9867 -1.74% p=0.00105
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=none-2 (sec/op) 86264f7f7f73 Nov 10 04:19 1.5333 1.5113 -1.43% p=0.04326
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=target-2 (sec/op) 86264f7f7f73 Nov 10 04:19 1.5279 1.5043 -1.54% p=0.002879
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (backend-reads/op) 86264f7f7f73 Nov 10 04:19 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (sec/op) 86264f7f7f73 Nov 10 04:19 1.7535 1.7346 -1.07% p=0.002089
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (backend-reads/op) 86264f7f7f73 Nov 10 04:19 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (sec/op) 86264f7f7f73 Nov 10 04:19 1.513 1.5226 +0.63% p=0.03546
tests/benchmarks/CLI/DescribeAffected/instances=100/change=catalog-2 (sec/op) 86264f7f7f73 Nov 10 04:19 0.60347 0.60326 -0.03% p=0.8534
tests/benchmarks/CLI/DescribeAffected/instances=100/change=component-2 (sec/op) 86264f7f7f73 Nov 10 04:19 0.60119 0.60504 +0.64% p=0.2176
tests/benchmarks/CLI/DescribeAffected/instances=100/change=none-2 (sec/op) 86264f7f7f73 Nov 10 04:19 0.59769 0.60097 +0.55% p=0.315
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=catalog-2 (sec/op) 86264f7f7f73 Nov 10 04:19 3.4589 3.422 -1.07% p=0.005196
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=component-2 (sec/op) 86264f7f7f73 Nov 10 04:19 3.4431 3.4289 -0.41% p=0.123
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=none-2 (sec/op) 86264f7f7f73 Nov 10 04:19 3.4362 3.4006 -1.04% p=0.008931
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=catalog-2 (sec/op) 86264f7f7f73 Nov 10 04:19 33.436 34.389 +2.85% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=component-2 (sec/op) 86264f7f7f73 Nov 10 04:19 33.792 34.673 +2.61% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=none-2 (sec/op) 86264f7f7f73 Nov 10 04:19 33.51 33.586 +0.23% p=0.6842
tests/benchmarks/CLI/DescribeAffected/Dependents/instances=1000-2 (sec/op) b44d99b64a75 Nov 10 03:42 5.0613 4.9893 -1.42% p=0.0001299
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=dependents-2 (sec/op) b44d99b64a75 Nov 10 03:42 2.0483 1.9867 -3.01% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=none-2 (sec/op) b44d99b64a75 Nov 10 03:42 1.5664 1.5113 -3.51% p=0.002879
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=target-2 (sec/op) b44d99b64a75 Nov 10 03:42 1.5658 1.5043 -3.92% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (backend-reads/op) b44d99b64a75 Nov 10 03:42 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (sec/op) b44d99b64a75 Nov 10 03:42 1.7665 1.7346 -1.81% p=7.578e-05
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (backend-reads/op) b44d99b64a75 Nov 10 03:42 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (sec/op) b44d99b64a75 Nov 10 03:42 1.5265 1.5226 -0.26% p=0.393
tests/benchmarks/CLI/DescribeAffected/instances=100/change=catalog-2 (sec/op) b44d99b64a75 Nov 10 03:42 0.61962 0.60326 -2.64% p=7.578e-05
tests/benchmarks/CLI/DescribeAffected/instances=100/change=component-2 (sec/op) b44d99b64a75 Nov 10 03:42 0.61612 0.60504 -1.80% p=0.0001299
tests/benchmarks/CLI/DescribeAffected/instances=100/change=none-2 (sec/op) b44d99b64a75 Nov 10 03:42 0.61833 0.60097 -2.81% p=0.0002057
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=catalog-2 (sec/op) b44d99b64a75 Nov 10 03:42 3.4447 3.422 -0.66% p=0.03546
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=component-2 (sec/op) b44d99b64a75 Nov 10 03:42 3.484 3.4289 -1.58% p=0.002089
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=none-2 (sec/op) b44d99b64a75 Nov 10 03:42 3.4443 3.4006 -1.27% p=0.001505
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=catalog-2 (sec/op) b44d99b64a75 Nov 10 03:42 33.534 34.389 +2.55% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=component-2 (sec/op) b44d99b64a75 Nov 10 03:42 33.686 34.673 +2.93% p=2.165e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=none-2 (sec/op) b44d99b64a75 Nov 10 03:42 33.619 33.586 -0.10% p=0.9705
tests/benchmarks/CLI/DescribeAffected/Dependents/instances=1000-2 (sec/op) 4ad39a28e54b Nov 10 00:07 5.0373 4.9893 -0.95% p=0.0003248
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=dependents-2 (sec/op) 4ad39a28e54b Nov 10 00:07 2.0117 1.9867 -1.24% p=0.0007253
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=none-2 (sec/op) 4ad39a28e54b Nov 10 00:07 1.5458 1.5113 -2.23% p=0.0115
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=target-2 (sec/op) 4ad39a28e54b Nov 10 00:07 1.5388 1.5043 -2.24% p=0.0003248
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (backend-reads/op) 4ad39a28e54b Nov 10 00:07 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (sec/op) 4ad39a28e54b Nov 10 00:07 1.7544 1.7346 -1.12% p=0.003886
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (backend-reads/op) 4ad39a28e54b Nov 10 00:07 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (sec/op) 4ad39a28e54b Nov 10 00:07 1.5337 1.5226 -0.73% p=0.03546
tests/benchmarks/CLI/DescribeAffected/instances=100/change=catalog-2 (sec/op) 4ad39a28e54b Nov 10 00:07 0.60319 0.60326 +0.01% p=1
tests/benchmarks/CLI/DescribeAffected/instances=100/change=component-2 (sec/op) 4ad39a28e54b Nov 10 00:07 0.60663 0.60504 -0.26% p=0.7394
tests/benchmarks/CLI/DescribeAffected/instances=100/change=none-2 (sec/op) 4ad39a28e54b Nov 10 00:07 0.6071 0.60097 -1.01% p=0.08921
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=catalog-2 (sec/op) 4ad39a28e54b Nov 10 00:07 3.4758 3.422 -1.55% p=7.578e-05
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=component-2 (sec/op) 4ad39a28e54b Nov 10 00:07 3.4703 3.4289 -1.19% p=0.001505
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=none-2 (sec/op) 4ad39a28e54b Nov 10 00:07 3.4574 3.4006 -1.64% p=0.0002057
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=catalog-2 (sec/op) 4ad39a28e54b Nov 10 00:07 33.838 34.389 +1.63% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=component-2 (sec/op) 4ad39a28e54b Nov 10 00:07 34.073 34.673 +1.76% p=0.0001299
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=none-2 (sec/op) 4ad39a28e54b Nov 10 00:07 33.791 33.586 -0.61% p=0.5787
tests/benchmarks/CLI/DescribeAffected/Dependents/instances=1000-2 (sec/op) 2c4b3139177a Nov 09 15:00 5.0384 4.9893 -0.97% p=0.02323
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=dependents-2 (sec/op) 2c4b3139177a Nov 09 15:00 2.0629 1.9867 -3.70% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=none-2 (sec/op) 2c4b3139177a Nov 09 15:00 1.5687 1.5113 -3.66% p=0.003886
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=target-2 (sec/op) 2c4b3139177a Nov 09 15:00 1.5751 1.5043 -4.49% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (backend-reads/op) 2c4b3139177a Nov 09 15:00 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (sec/op) 2c4b3139177a Nov 09 15:00 1.7723 1.7346 -2.12% p=7.578e-05
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (backend-reads/op) 2c4b3139177a Nov 09 15:00 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (sec/op) 2c4b3139177a Nov 09 15:00 1.5386 1.5226 -1.04% p=0.0115
tests/benchmarks/CLI/DescribeAffected/instances=100/change=catalog-2 (sec/op) 2c4b3139177a Nov 09 15:00 0.60573 0.60326 -0.41% p=0.5288
tests/benchmarks/CLI/DescribeAffected/instances=100/change=component-2 (sec/op) 2c4b3139177a Nov 09 15:00 0.60581 0.60504 -0.13% p=0.1903
tests/benchmarks/CLI/DescribeAffected/instances=100/change=none-2 (sec/op) 2c4b3139177a Nov 09 15:00 0.60768 0.60097 -1.10% p=0.2799
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=catalog-2 (sec/op) 2c4b3139177a Nov 09 15:00 3.4901 3.422 -1.95% p=0.0001299
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=component-2 (sec/op) 2c4b3139177a Nov 09 15:00 3.4992 3.4289 -2.01% p=7.578e-05
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=none-2 (sec/op) 2c4b3139177a Nov 09 15:00 3.4635 3.4006 -1.82% p=0.0002057
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=catalog-2 (sec/op) 2c4b3139177a Nov 09 15:00 33.552 34.389 +2.49% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=component-2 (sec/op) 2c4b3139177a Nov 09 15:00 33.508 34.673 +3.48% p=4.33e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=none-2 (sec/op) 2c4b3139177a Nov 09 15:00 33.914 33.586 -0.97% p=0.5787
tests/benchmarks/CLI/DescribeAffected/Dependents/instances=1000-2 (sec/op) 85578cdf99da Nov 09 14:38 5.0516 4.9893 -1.23% p=4.33e-05
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=dependents-2 (sec/op) 85578cdf99da Nov 09 14:38 2.0776 1.9867 -4.38% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=none-2 (sec/op) 85578cdf99da Nov 09 14:38 1.5676 1.5113 -3.59% p=0.002089
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=target-2 (sec/op) 85578cdf99da Nov 09 14:38 1.5662 1.5043 -3.95% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (backend-reads/op) 85578cdf99da Nov 09 14:38 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (sec/op) 85578cdf99da Nov 09 14:38 1.7636 1.7346 -1.64% p=0.0002057
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (backend-reads/op) 85578cdf99da Nov 09 14:38 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (sec/op) 85578cdf99da Nov 09 14:38 1.5258 1.5226 -0.21% p=0.1431
tests/benchmarks/CLI/DescribeAffected/instances=100/change=catalog-2 (sec/op) 85578cdf99da Nov 09 14:38 0.61125 0.60326 -1.31% p=0.06301
tests/benchmarks/CLI/DescribeAffected/instances=100/change=component-2 (sec/op) 85578cdf99da Nov 09 14:38 0.61603 0.60504 -1.78% p=0.00105
tests/benchmarks/CLI/DescribeAffected/instances=100/change=none-2 (sec/op) 85578cdf99da Nov 09 14:38 0.60671 0.60097 -0.95% p=0.08921
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=catalog-2 (sec/op) 85578cdf99da Nov 09 14:38 3.501 3.422 -2.26% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=component-2 (sec/op) 85578cdf99da Nov 09 14:38 3.5379 3.4289 -3.08% p=4.33e-05
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=none-2 (sec/op) 85578cdf99da Nov 09 14:38 3.4919 3.4006 -2.62% p=4.33e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=catalog-2 (sec/op) 85578cdf99da Nov 09 14:38 34.317 34.389 +0.21% p=0.5288
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=component-2 (sec/op) 85578cdf99da Nov 09 14:38 34.216 34.673 +1.33% p=0.00105
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=none-2 (sec/op) 85578cdf99da Nov 09 14:38 34.216 33.586 -1.84% p=0.2176
tests/benchmarks/CLI/DescribeAffected/Dependents/instances=1000-2 (sec/op) a57df53d8db2 Nov 09 14:16 4.934 4.9893 +1.12% p=0.0002057
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=dependents-2 (sec/op) a57df53d8db2 Nov 09 14:16 1.9589 1.9867 +1.42% p=0.0002057
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=none-2 (sec/op) a57df53d8db2 Nov 09 14:16 1.4498 1.5113 +4.24% p=0.00105
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=target-2 (sec/op) a57df53d8db2 Nov 09 14:16 1.4552 1.5043 +3.38% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (backend-reads/op) a57df53d8db2 Nov 09 14:16 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (sec/op) a57df53d8db2 Nov 09 14:16 1.6988 1.7346 +2.11% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (backend-reads/op) a57df53d8db2 Nov 09 14:16 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (sec/op) a57df53d8db2 Nov 09 14:16 1.4843 1.5226 +2.58% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=100/change=catalog-2 (sec/op) a57df53d8db2 Nov 09 14:16 0.56324 0.60326 +7.11% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=100/change=component-2 (sec/op) a57df53d8db2 Nov 09 14:16 0.56623 0.60504 +6.85% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=100/change=none-2 (sec/op) a57df53d8db2 Nov 09 14:16 0.56687 0.60097 +6.02% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=catalog-2 (sec/op) a57df53d8db2 Nov 09 14:16 3.3442 3.422 +2.33% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=component-2 (sec/op) a57df53d8db2 Nov 09 14:16 3.3208 3.4289 +3.25% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=none-2 (sec/op) a57df53d8db2 Nov 09 14:16 3.3537 3.4006 +1.40% p=0.0004871
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=catalog-2 (sec/op) a57df53d8db2 Nov 09 14:16 32.731 34.389 +5.06% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=component-2 (sec/op) a57df53d8db2 Nov 09 14:16 32.781 34.673 +5.77% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=none-2 (sec/op) a57df53d8db2 Nov 09 14:16 32.758 33.586 +2.53% p=4.33e-05
tests/benchmarks/CLI/DescribeAffected/Dependents/instances=1000-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 4.878 4.9893 +2.28% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=dependents-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 1.9379 1.9867 +2.52% p=0.0007253
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=none-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 1.4686 1.5113 +2.91% p=0.0002057
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=target-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 1.4831 1.5043 +1.43% p=0.04326
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (backend-reads/op) 1f0e555e68d7 Nov 08 23:20 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 1.684 1.7346 +3.01% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (backend-reads/op) 1f0e555e68d7 Nov 08 23:20 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 1.4946 1.5226 +1.87% p=0.0007253
tests/benchmarks/CLI/DescribeAffected/instances=100/change=catalog-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 0.58448 0.60326 +3.21% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=100/change=component-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 0.57739 0.60504 +4.79% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=100/change=none-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 0.5823 0.60097 +3.21% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=catalog-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 3.4315 3.422 -0.28% p=0.393
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=component-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 3.3721 3.4289 +1.68% p=0.07526
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=none-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 3.4036 3.4006 -0.09% p=0.9118
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=catalog-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 32.957 34.389 +4.34% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=component-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 33.33 34.673 +4.03% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=none-2 (sec/op) 1f0e555e68d7 Nov 08 23:20 32.886 33.586 +2.13% p=0.002089
tests/benchmarks/CLI/DescribeAffected/Dependents/instances=1000-2 (sec/op) ce64f07caf12 Nov 07 19:06 4.9401 4.9893 +1.00% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=dependents-2 (sec/op) ce64f07caf12 Nov 07 19:06 1.964 1.9867 +1.16% p=0.002879
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=none-2 (sec/op) ce64f07caf12 Nov 07 19:06 1.4787 1.5113 +2.21% p=0.001505
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=target-2 (sec/op) ce64f07caf12 Nov 07 19:06 1.4876 1.5043 +1.12% p=0.002089
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (backend-reads/op) ce64f07caf12 Nov 07 19:06 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (sec/op) ce64f07caf12 Nov 07 19:06 1.6999 1.7346 +2.04% p=0.00105
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (backend-reads/op) ce64f07caf12 Nov 07 19:06 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (sec/op) ce64f07caf12 Nov 07 19:06 1.4888 1.5226 +2.27% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=100/change=catalog-2 (sec/op) ce64f07caf12 Nov 07 19:06 0.56689 0.60326 +6.42% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=100/change=component-2 (sec/op) ce64f07caf12 Nov 07 19:06 0.57408 0.60504 +5.39% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=100/change=none-2 (sec/op) ce64f07caf12 Nov 07 19:06 0.57069 0.60097 +5.31% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=catalog-2 (sec/op) ce64f07caf12 Nov 07 19:06 3.3825 3.422 +1.17% p=0.001505
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=component-2 (sec/op) ce64f07caf12 Nov 07 19:06 3.4023 3.4289 +0.78% p=0.008931
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=none-2 (sec/op) ce64f07caf12 Nov 07 19:06 3.3537 3.4006 +1.40% p=0.008931
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=catalog-2 (sec/op) ce64f07caf12 Nov 07 19:06 33.134 34.389 +3.79% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=component-2 (sec/op) ce64f07caf12 Nov 07 19:06 33.062 34.673 +4.87% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=none-2 (sec/op) ce64f07caf12 Nov 07 19:06 33.127 33.586 +1.38% p=0.001505
tests/benchmarks/CLI/DescribeAffected/Dependents/instances=1000-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 4.7882 4.9893 +4.20% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=dependents-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 1.8979 1.9867 +4.68% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=none-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 1.4355 1.5113 +5.28% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=target-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 1.4319 1.5043 +5.06% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (backend-reads/op) 3bc8c259c7a0 Nov 07 05:55 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 1.6641 1.7346 +4.24% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (backend-reads/op) 3bc8c259c7a0 Nov 07 05:55 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 1.4546 1.5226 +4.67% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=100/change=catalog-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 0.55402 0.60326 +8.89% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=100/change=component-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 0.54944 0.60504 +10.12% p=1.083e-05; warning
tests/benchmarks/CLI/DescribeAffected/instances=100/change=none-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 0.5586 0.60097 +7.58% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=catalog-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 3.2864 3.422 +4.12% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=component-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 3.2777 3.4289 +4.61% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=none-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 3.2851 3.4006 +3.51% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=catalog-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 32.3 34.389 +6.47% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=component-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 32.266 34.673 +7.46% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=none-2 (sec/op) 3bc8c259c7a0 Nov 07 05:55 32.258 33.586 +4.12% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/Dependents/instances=1000-2 (sec/op) 731728e80f66 Nov 06 19:42 4.5148 4.9893 +10.51% p=1.083e-05; warning
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=dependents-2 (sec/op) 731728e80f66 Nov 06 19:42 1.8358 1.9867 +8.22% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=none-2 (sec/op) 731728e80f66 Nov 06 19:42 1.4098 1.5113 +7.20% p=0.001505
tests/benchmarks/CLI/DescribeAffected/FunctionsRepeated/instances=200/change=target-2 (sec/op) 731728e80f66 Nov 06 19:42 1.3993 1.5043 +7.51% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (backend-reads/op) 731728e80f66 Nov 06 19:42 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreCallerStacks/stacks=20/keys=11-2 (sec/op) 731728e80f66 Nov 06 19:42 1.581 1.7346 +9.72% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (backend-reads/op) 731728e80f66 Nov 06 19:42 22 22 +0.00% p=1
tests/benchmarks/CLI/DescribeAffected/StoreRepeated/calls=2200/keys=11-2 (sec/op) 731728e80f66 Nov 06 19:42 1.4078 1.5226 +8.15% p=1.083e-05
tests/benchmarks/CLI/DescribeAffected/instances=100/change=catalog-2 (sec/op) 731728e80f66 Nov 06 19:42 0.5296 0.60326 +13.91% p=1.083e-05; warning
tests/benchmarks/CLI/DescribeAffected/instances=100/change=component-2 (sec/op) 731728e80f66 Nov 06 19:42 0.53448 0.60504 +13.20% p=1.083e-05; warning
tests/benchmarks/CLI/DescribeAffected/instances=100/change=none-2 (sec/op) 731728e80f66 Nov 06 19:42 0.53405 0.60097 +12.53% p=1.083e-05; warning
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=catalog-2 (sec/op) 731728e80f66 Nov 06 19:42 3.0807 3.422 +11.08% p=1.083e-05; warning
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=component-2 (sec/op) 731728e80f66 Nov 06 19:42 3.0968 3.4289 +10.72% p=1.083e-05; warning
tests/benchmarks/CLI/DescribeAffected/instances=1000/change=none-2 (sec/op) 731728e80f66 Nov 06 19:42 3.0859 3.4006 +10.20% p=1.083e-05; warning
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=catalog-2 (sec/op) 731728e80f66 Nov 06 19:42 31.021 34.389 +10.86% p=1.083e-05; warning
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=component-2 (sec/op) 731728e80f66 Nov 06 19:42 31.038 34.673 +11.71% p=1.083e-05; warning
tests/benchmarks/CLI/DescribeAffected/instances=10000/change=none-2 (sec/op) 731728e80f66 Nov 06 19:42 30.383 33.586 +10.54% p=1.083e-05; warning
All other benchmarks
Benchmark / metric Main snapshot (UTC) Main Current PR PR change Significance
internal/exec/DeferredStoreRepeated-2 (B/op) 86264f7f7f73 Nov 10 04:19 4.5688e+07 4.5688e+07 -0.00% p=0.6698
internal/exec/DeferredStoreRepeated-2 (allocs/op) 86264f7f7f73 Nov 10 04:19 1.6287e+05 1.6287e+05 -0.00% p=0.6977
internal/exec/DeferredStoreRepeated-2 (sec/op) 86264f7f7f73 Nov 10 04:19 0.05705 0.056576 -0.83% p=0.2176
internal/exec/FindAffectedParallel-2 (B/op) 86264f7f7f73 Nov 10 04:19 1.6622e+05 1.6629e+05 +0.05% p=0.002089
internal/exec/FindAffectedParallel-2 (allocs/op) 86264f7f7f73 Nov 10 04:19 1848.5 1850 +0.08% p=0.002879
internal/exec/FindAffectedParallel-2 (sec/op) 86264f7f7f73 Nov 10 04:19 0.00069471 0.00069159 -0.45% p=0.02323
internal/exec/LocalsRepeated-2 (B/op) 86264f7f7f73 Nov 10 04:19 2.4648e+05 2.4648e+05 +0.00% p=1
internal/exec/LocalsRepeated-2 (allocs/op) 86264f7f7f73 Nov 10 04:19 1881 1881 +0.00% p=1
internal/exec/LocalsRepeated-2 (sec/op) 86264f7f7f73 Nov 10 04:19 0.00028335 0.00028449 +0.40% p=0.393
internal/exec/ResolutionContextPushPop-2 (B/op) 86264f7f7f73 Nov 10 04:19 448 448 +0.00% p=1
internal/exec/ResolutionContextPushPop-2 (allocs/op) 86264f7f7f73 Nov 10 04:19 10 10 +0.00% p=1
internal/exec/ResolutionContextPushPop-2 (sec/op) 86264f7f7f73 Nov 10 04:19 6.823e-07 6.9015e-07 +1.15% p=1.083e-05
internal/exec/TemplateProcessingComplex-2 (B/op) 86264f7f7f73 Nov 10 04:19 2.4277e+05 2.4277e+05 +0.00% p=0.5913
internal/exec/TemplateProcessingComplex-2 (allocs/op) 86264f7f7f73 Nov 10 04:19 497 497 +0.00% p=1
internal/exec/TemplateProcessingComplex-2 (sec/op) 86264f7f7f73 Nov 10 04:19 0.00028971 0.00029254 +0.98% p=4.33e-05
pkg/list/CollectInstances-2 (B/op) 86264f7f7f73 Nov 10 04:19 53120 53120 +0.00% p=1
pkg/list/CollectInstances-2 (allocs/op) 86264f7f7f73 Nov 10 04:19 355 355 +0.00% p=1
pkg/list/CollectInstances-2 (sec/op) 86264f7f7f73 Nov 10 04:19 3.5443e-05 3.6911e-05 +4.14% p=7.578e-05
pkg/list/SortInstances-2 (B/op) 86264f7f7f73 Nov 10 04:19 9896 9896 +0.00% p=1
pkg/list/SortInstances-2 (allocs/op) 86264f7f7f73 Nov 10 04:19 4 4 +0.00% p=1
pkg/list/SortInstances-2 (sec/op) 86264f7f7f73 Nov 10 04:19 2.181e-05 2.2075e-05 +1.22% p=1.083e-05
pkg/merge/DeepCopyMap-2 (B/op) 86264f7f7f73 Nov 10 04:19 1224 1224 +0.00% p=1

Full results are available in the comparison artifacts.

Measurements and workflow · Full comparison artifacts

@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Anthropic and Bedrock response parsing now includes cache-read and cache-creation tokens in input and total usage. Tests cover these calculations, and usage documentation describes how cache counts contribute to prompt totals.

Changes: Prompt-cache token usage

Layer / File(s) Summary
Shared usage calculation
pkg/ai/agent/base/usage.go, pkg/ai/agent/base/usage_test.go
Added UsageFromAnthropic to combine input, cache-read, and cache-creation counts, calculate total usage, and return nil when all counts are nonpositive. Tests cover these cases.
Provider parsing and coverage
pkg/ai/agent/anthropic/client.go, pkg/ai/agent/anthropic/client_test.go, pkg/ai/agent/bedrock/client.go, pkg/ai/agent/bedrock/cache_test.go
Anthropic and Bedrock parsers use the shared helper. Tests verify that cache counts contribute to input and total usage, including when ordinary input is zero.
Usage field and output documentation
pkg/ai/formatter/formatter.go, pkg/ai/types/response.go, website/docs/cli/commands/ai/exec.mdx
Comments and CLI JSON documentation specify that cache-read and cache-creation counts are included in prompt input totals.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related issues

  • cloudposse/atmos#3625 — This change includes Bedrock cache-read and cache-creation counts in input and total usage; the issue also mentions missing system prompt and cache markers, which are not addressed here.
  • cloudposse/atmos#3652 — This change includes Bedrock cache counts in usage totals reported for the chat footer.

Possibly related PRs

  • cloudposse/atmos#3565 — Both changes address cache-token usage reporting; this PR includes cache counts in input usage totals.
  • cloudposse/atmos#3626 — This PR uses the Bedrock cache counts in input and total usage after they are parsed into Usage.

Suggested labels: patch

Suggested reviewers: aknysh

Merge Risk: Minimal · up to 3e94f

Cached input is included in prompt-token totals for Anthropic and Bedrock. No actionable merge-blocking risk remains after normal checks.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: counting prompt-cache reads and writes in Anthropic and Bedrock input tokens.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 8 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

Custom ast-grep rule coverage is incomplete: one or more packages are unavailable or not authorized for this review.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a0cfec2 and 3e94fd9.

Files selected for processing: 9

  • pkg/ai/agent/anthropic/client.go
  • pkg/ai/agent/anthropic/client_test.go
  • pkg/ai/agent/base/usage.go
  • pkg/ai/agent/base/usage_test.go
  • pkg/ai/agent/bedrock/cache_test.go
  • pkg/ai/agent/bedrock/client.go
  • pkg/ai/formatter/formatter.go
  • pkg/ai/types/response.go
  • website/docs/cli/commands/ai/exec.mdx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@osterman Erik Osterman (Cloud Posse) (osterman) added the patch A minor, backward compatible change label Nov 12, 2026
@github-actions github-actions Bot mentioned this pull request Nov 12, 2026
@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.28%. Comparing base (a0cfec2) to head (3e94fd9).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3662      +/-   ##
==========================================
- Coverage   87.30%   87.28%   -0.02%     
==========================================
  Files        3041     3042       +1     
  Lines      276938   276946       +8     
==========================================
- Hits       241769   241745      -24     
- Misses      24956    24976      +20     
- Partials    10213    10225      +12     
Flag Coverage Δ
unittests 87.28% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/ai/agent/anthropic/client.go 99.14% <100.00%> (-0.01%) ⬇️
pkg/ai/agent/base/usage.go 100.00% <100.00%> (ø)
pkg/ai/agent/bedrock/client.go 49.62% <100.00%> (-0.19%) ⬇️
pkg/ai/formatter/formatter.go 100.00% <ø> (ø)

... and 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added quality:ready All Quality Gate requirements pass for the current PR head and removed quality:not-ready One or more Quality Gate requirements are pending or failing labels Nov 13, 2026
@atmos-pro

atmos-pro Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

Merged via the queue into cloudposse:main with commit feb0556 Nov 17, 2026
268 of 269 checks passed
@atmos-pro

atmos-pro Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

@github-actions

Copy link
Copy Markdown

These changes were released in v1.235.0-nightly.43989067298.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch A minor, backward compatible change quality:ready All Quality Gate requirements pass for the current PR head size/m Medium size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants