Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

Context Summarization when context window not full

Open walmsles opened this issue 4 days ago • 0 comments

Before opening, please confirm:

Operating System

MacOs 15.7.2

Kiro Version

IDE: 0.8.0

Bug Description

Kiro is suddenly summarizing context whent he context windows is not full. Screenshot shows context at 56% (notice circle is not full). I have also had summarization kick in at 33% when I have just started a new spec session.

Conversation id: 548d3a64-ebc4-497e-8304-112cab961879

Steps to Reproduce

  1. Open Kiro with in spec mode (with a project spec). My spec takes up approx. 30% context window.
  2. Execute a property test task in the spec flow (this is where it started for me)
  3. Open a new spec window and get Kiro to fix failing tests

Expected Behavior

Expect that Kiro will use the full session context before summarising - it seems to be premature and when the context rolls over.

Conversation ID

548d3a64-ebc4-497e-8304-112cab961879

Additional Context

Image

Here is the message log showing it already started a new session (it was summarized after 80% context window fill):

Message: I'll continue working on fixing the failing property-based security tests. Let me first read the current state of the test file and security implementation to understand the audit log isolation issues.

Now let me run the tests to see the current failure state and understand what's happening with the audit log isolation:

I can see the issues clearly now. The tests are still failing because:

  1. Property 27: The audit log is getting mixed up between test runs - the test expects the latest event to be from the current test run, but it's getting events from previous runs.

  2. Property 28: Similar issue - the audit log is not being properly isolated between tests.

  3. Property 30: The audit log is getting the wrong operation type in the latest event.

  4. Property 26: Same audit log isolation issue.

The core problem is that the audit log is a shared singleton instance that persists across test runs. Even though we're setting securityService.auditLog = [] in beforeEach, the audit log is getting corrupted during the test execution.

Let me implement a more robust solution:

Now let me also fix the specific test issues. The main problem is that the tests are checking for the wrong events in the audit log. Let me examine the specific failures:

  1. Property 27: Expected userId 'A00-0' but got 'tr-DisP' - this suggests the audit log is getting events from different test runs mixed up.

  2. Property 28: Expected resourceId 'different-tenant/knowledge-base/000' but got 'different-tenant/document/ref' - similar issue.

Let me add better audit log filtering to ensure we get the right events:

I need to find the exact text for the encryption events check. Let me search for it:

Now let's run the tests again to see if the audit log isolation fixes have resolved the issues:

walmsles avatar Jan 06 '26 00:01 walmsles