Skip to content

[P2b] feat: messages.transform E2E tests #107

Description

@four-bytes-robby

Purpose

Validate that experimental.chat.messages.transform correctly parses compaction signals from assistant messages, strips them from visible output, and compacts message history.

Technical Details

  • Mock message history with assistant messages containing compaction_signal blocks
  • Assert: signal is parsed and stored in session state
  • Assert: compaction_signal is stripped from visible output
  • Assert: empty assistant messages get placeholder () injected
  • Assert: message history is compacted (old tool outputs removed/truncated)
  • Assert: providerID/modelID are extracted from user message info
  • Assert: compactMessageHistory is called with correct sessionID

Files to Create

  • test/e2e/messages-transform.test.ts
  • test/fixtures/sample-messages.ts

Acceptance Criteria

  • Tests pass with bun test test/e2e/messages-transform.test.ts
  • Signal parsing, stripping, and history compaction tested
  • Edge cases: no signal, multiple signals, empty messages

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