Skip to content

[P2c] feat: session.compacting E2E tests #106

Description

@four-bytes-robby

Purpose

Validate that experimental.session.compacting correctly processes compaction signals, injects compaction prompts, and manages session state.

Technical Details

  • Mock ctx.client.session.summarize to track calls
  • Fixture: session state with signal (compact_now, compact_soon, no_compact)
  • Assert: compact_now triggers summarize() call with correct args
  • Assert: compact_soon adds context lines but no summarize
  • Assert: no_compact returns early (no output.context mutation)
  • Assert: signal is cleared after compaction
  • Assert: CC_COMPACTION_TRIGGER env var is cleaned up

Files to Create

  • test/e2e/session-compacting.test.ts
  • Extend test/fixtures/mock-plugin-context.ts

Acceptance Criteria

  • Tests pass with bun test test/e2e/session-compacting.test.ts
  • All 3 signal states tested (compact_now, compact_soon, no_compact)
  • State cleanup verified

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions