GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(kiro): report context pressure for compaction by coseung2 · Pull Request #439 · lidge-jun/opencodex Conversation
|
|
✅ Target branch corrected This pull request now targets The |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughKiro now estimates and propagates absolute context totals through streaming and bounded fallback parsing. The Responses bridge serializes those totals without double-counting output tokens, with coverage for metadata, history, SSE output, and request logging. ChangesContext total token accounting
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Request as Kiro request
participant Adapter as createKiroAdapter
participant Parser as parseKiroStream
participant Attempt as parseKiroAttempt
participant Bridge as responsesUsage
participant Log as RequestLogEntry
Request->>Adapter: Build request and estimate context input
Adapter->>Parser: Pass contextInputEstimate
Parser->>Attempt: Parse initial stream attempt
Parser->>Attempt: Parse bounded fallback attempt
Attempt-->>Parser: Return contextTotalTokens
Parser-->>Bridge: Provide merged usage
Bridge-->>Request: Emit input_tokens and total_tokens
Bridge-->>Log: Preserve absolute context checkpoint
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
tests/kiro-stream.test.ts (1)
827-841: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a bounded-retry context-pressure regression test.
These tests cover metadata, percentage floors, history, and request-log estimates, but not the fallback request whose context grows after assistant continuation. Add a test that forces the retry and verifies that per-turn usage is summed while
contextInputTokensis the maximum across both attempts.As per path instructions, behavior changes in
src/should have a focused regression test near the existing subsystem tests.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/kiro-stream.test.ts` around lines 827 - 841, Add a focused test near the existing Kiro stream usage tests that triggers the bounded retry after assistant continuation, then assert per-turn input/output usage is summed across both attempts while contextInputTokens equals the maximum context usage observed. Use the existing adapter, request-building, event-frame, and doneUsage helpers, and preserve the established estimated-usage assertions where applicable.Source: Path instructions
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/adapters/kiro.ts`:
- Line 1062: Update the fallback result and second parse flow so the retry’s
computed contextInputTokens is returned from the fallback and passed to the
retry parse instead of the original estimate. Adjust the relevant fallback
result shape and the parse call near contextInputTokens, preserving the existing
retry estimate calculation and ensuring mergeKiroUsage receives the larger retry
context pressure.
---
Outside diff comments:
In `@tests/kiro-stream.test.ts`:
- Around line 827-841: Add a focused test near the existing Kiro stream usage
tests that triggers the bounded retry after assistant continuation, then assert
per-turn input/output usage is summed across both attempts while
contextInputTokens equals the maximum context usage observed. Use the existing
adapter, request-building, event-frame, and doneUsage helpers, and preserve the
established estimated-usage assertions where applicable.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 57ab3ac0-50d7-4287-81d9-a57a803927f6
src/adapters/kiro.tssrc/bridge.tssrc/types.tstests/bridge.test.tstests/kiro-stream.test.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 46e3745556
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…/kiro-context-usage-reporting
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/request-log.test.ts`:
- Around line 755-782: Update responseWithDeferredRequestLog and its deferred
persistence path to carry raw OcxUsage separately from the Responses compaction
projection. Keep the SSE input_tokens value at 49,900, but persist and bill the
upstream current-turn inputTokens value of 58 instead of the projected
context-pressure value.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d2d4eec0-5ead-42ca-ab60-7b32cea2245e
src/adapters/kiro.tssrc/bridge.tssrc/types.tstests/bridge.test.tstests/kiro-stream.test.tstests/request-log.test.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c0b4f89da
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: aec4df8339
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: f44da01a95
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f1dd35c87
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/adapters/kiro.ts`:
- Around line 1145-1162: Preserve checkpoint growth for reasoning-only fallback
attempts by deriving one carried-growth flag from firstResult.assistantText or
firstResult.sawReasoning, then passing it to all three mergeKiroUsage calls in
the fallback handling of src/adapters/kiro.ts lines 1145-1162. Add an upstream
context-percentage frame and assert the exact checkpoint equals 50,000 plus
finalOutputTokens in tests/kiro-stream.test.ts lines 391-407.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a3b03513-3dc8-4e2b-b707-f8e1d34d0e28
src/adapters/kiro.tstests/kiro-stream.test.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e21e64016
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
🔒 Maintainer integration in progress — please hold off on merging@lidge-jun (maintainer) is actively integrating this PR into What is happening This PR is being integrated on the maintainer branch What this means for you
This PR will be closed with a merge receipt (integration commit SHA, verification output, Integration tracker: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR #439 (head e78e846, author coseung2)를 통합하고 활성화 공백을 메우는 회귀 2건을 추가한다. Kiro는 attempt별 usage만 보고해서 클라이언트가 실제 컨텍스트 점유를 알 수 없었고 compaction 시점을 판단할 수 없었다. 이제 payload estimate, upstream 사용률, authoritative turn usage 중 최댓값을 절대 checkpoint로 삼아 streaming, fallback, bridge 직렬화, cache-detail clamping, deferred logging 전 경로로 전달한다. 추가한 회귀 2건: - 첫 attempt progress가 클수록 rebuilt fallback checkpoint도 커진다 (기존 assertion은 mergeKiroUsage의 floor만으로 만족되어 stale estimate 퇴행을 잡지 못했다) - non-stream parseResponse가 buildRequest로 설치된 contextInputEstimate closure를 실제로 활성화하고 절대 checkpoint를 전달한다 Co-authored-by: coseung2 <[email protected]>
✅ Integrated into
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closing: integrated into |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR lidge-jun#439 (head e78e846, author coseung2)를 통합하고 활성화 공백을 메우는 회귀 2건을 추가한다. Kiro는 attempt별 usage만 보고해서 클라이언트가 실제 컨텍스트 점유를 알 수 없었고 compaction 시점을 판단할 수 없었다. 이제 payload estimate, upstream 사용률, authoritative turn usage 중 최댓값을 절대 checkpoint로 삼아 streaming, fallback, bridge 직렬화, cache-detail clamping, deferred logging 전 경로로 전달한다. 추가한 회귀 2건: - 첫 attempt progress가 클수록 rebuilt fallback checkpoint도 커진다 (기존 assertion은 mergeKiroUsage의 floor만으로 만족되어 stale estimate 퇴행을 잡지 못했다) - non-stream parseResponse가 buildRequest로 설치된 contextInputEstimate closure를 실제로 활성화하고 절대 checkpoint를 전달한다 Co-authored-by: coseung2 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.