Repository navigation
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Capture and validate prompt estimates src/server/responses/sidecar-execution.ts, tests/responses/responses-sidecar-usage.test.ts, docs-site/src/content/docs/reference/adapters.md, structure/transports/responses.md, scripts/test-layout/layout-usage.json, scripts/test-layout/layout.json, tests/fixtures/test-layout-expected.json |
The image-bridge and web-search callbacks copy numeric input-token estimates into the usage log. Tests check request, attempt, daily, and model input-token usage for requests with no sidecar, web search, and image generation. Documentation and test-layout mappings describe and register this coverage. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Merge Risk: 
Minimal · up to 3d4c2
-
No concrete merge-blocking risk remains in the reviewed change.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title clearly and concisely describes the main change: preserving Kiro prompt estimates when hosted tool paths process requests. This matches the updates in src/server/responses/sidecar-execution.ts, the usage tests, and the documentation.
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. Analyzed 2 functions across 2 files. (3 skipped: 3 unsupported.)
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Comment @coderabbitai help to get the list of available commands.
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. |
|
Triage note (2026-10-24, against Needs fixes before this can land: move the new test registration into an explicit shard, preserve the fixture mapping, then obtain successful executable CI. Still needed on dev: yes. Both callbacks still record reasoning/tier without copying Exact-head CI at triage time: Please refresh onto current |
619d328 to
3d4c284
Compare
Hosted web-search and image/video sidecar paths now record the adapter's usageLog.inputTokens estimate, so Kiro usage and daily activity include replayed prompt history. Carries #7620. Co-authored-by: Martin Becerra <197874+martinbcg@users.noreply.github.com>
|
Release triage for v2.93.0: carried and merged. Your change landed on The source change is identical to this PR's diff. The only difference is that the new test is registered in the existing |
Summary
AdapterRequest.usageLog.inputTokenswhen the Responses hosted web-search and image/video paths build a request. The callbacks already recorded reasoning and service-tier metadata, but omitted the adapter's prompt estimate beforeonAttemptSendand final usage logging.web_searchorimage_generationcould previously trigger the undercount even when the model did not call the tool.Reproduction
Send a Kiro Responses request containing a long earlier user message, an assistant reply, and a short new user message, with a function tool and either
web_searchorimage_generationdeclared. Before the fix, the ordinary route persisted more than 20,000 prompt tokens while both hosted-tool routes persisted only 4 input tokens for the same history. The new regression verifies the persisted request, its physical attempt, model totals, and daily totals.The change forwards the adapter's existing estimate; it does not reinterpret
contextTotalTokensas request spend, change client compaction accounting, or rewrite historical ledger entries. Kiro tokens remain estimated and provider credits remain separate.Verification
Verified on current head
3d4c28417745736ada723bdf75c03f96db2e644e, rebased onto current upstreamdevat488d5f13ef9fe0edd37100d31e129d136a2b4629after the maintainer's 2026-10-24 triage note.bun scripts/test.ts tests/responses/responses-sidecar-usage.test.ts tests/responses/responses-sidecar-context-overflow.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts— 40 passed, 0 failed.bun run typecheck— passed.bun run privacy:scan— passed.bun run structure:check— passed.docs-site/,bun install --frozen-lockfileandbun run build— passed; 593 pages built and 84,861 internal links checked.git diff upstream/dev...HEAD --check— passed.Full-suite scope exception (AGENTS.md, Commands): the repository contains 2,608 test files, which is disproportionate to this two-line propagation of existing numeric usage metadata. The focused integration regression exercises all three dispatch paths through persisted request/attempt usage and daily/model aggregation; the adjacent context-overflow tests and test-layout checks also passed. The commands and exact-head results are recorded above. All listed tests, typecheck, privacy scan, structure check, and the documentation build were rerun after the rebase and shard-registration change and passed. The full suite and broader import-graph selection were not run; executable upstream CI remains pending maintainer approval.
Maintainer triage follow-up (2026-10-24)
responses-sidecar-usage.test.tsout of the inlineexplicitmap intoscripts/test-layout/layout-usage.json, registered throughexplicitShards.responsesmapping intests/fixtures/test-layout-expected.json; both layout/oracle regression files pass.devat488d5f13ef9fe0edd37100d31e129d136a2b4629.3d4c28417745736ada723bdf75c03f96db2e644eand isaction_required, with no executable jobs started. The contributor account has repositoryREADpermission, so an upstream maintainer must approve the run. This is pending CI evidence, not a successful run.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit