Skip to content

fix(kiro): restore estimated prompt-cache usage - #658

Merged
caigee-cmd merged 2 commits into
mainfrom
feat/kiro-cache-response-investigation
Dec 4, 2026
Merged

caigee-cmd merged 2 commits into
mainfrom
feat/kiro-cache-response-investigation

Conversation

@caigee-cmd

@caigee-cmd caigee-cmd commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Restore Kiro's local prompt-cache estimate that v0.8.2 removed.
  • Kiro still does not send cache reads or writes. The gateway fingerprints prompt prefixes per account for five minutes and reports the repeated part as cache_read_tokens / cache_write_tokens (and prompt_tokens_details.cached_tokens).
  • Failed streams do not seed the next request. Usage without a cache tracker still omits those fields.
  • Pin two check-in tests to the UTC+8 calendar so they do not fail between 00:00 and 02:00 Beijing.

Test Plan

  • go test ./internal/providers/kiro (includes restored prompt_cache_test.go)
  • go test ./internal/gateway
  • go test ./internal/providers/trae -run TestCheckin
  • go test ./internal/runtime -run TestSyncCheckinStatusUnknownKeepsRealLocalSuccess
  • After merge, /v1/messages and /v1/chat/completions on a Kiro account show cache fields on the second turn of a long prompt

Kiro still does not send cache reads or writes. Put the local prefix
tracker back so usage reports estimated cache_read_tokens and
cache_write_tokens the way it did before v0.8.2.
Trae claim-already and local-success status tests assumed wall-clock
"today" in UTC. Between 00:00 and 02:00 Beijing they failed and blocked CI.
@caigee-cmd
caigee-cmd merged commit 2cd9b44 into main Dec 4, 2026
6 checks passed
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