Skip to content

[Bug]: ACP history replay drops whitespace chunks #37504

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Load an ACP session whose history sends an agent_message_chunk for message a1 with text hi.
  2. Send a separate chunk for a1 containing a single space, then another containing there.
  3. Read the adapter's public readThreadSnapshot result. The same problem occurs with standalone newline chunks or a leading tab followed by code.

The existing replays history in order, with stable earlier snapshots test can reproduce this by replacing its " there" chunk with separate " " and "there" chunks. Run:

pnpm exec vp test run apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts -t 'replays history in order'

Expected behavior

The snapshot preserves the original text, including hi there, blank lines and code indentation, regardless of ACP chunk boundaries.

Actual behavior

The snapshot contains hithere. Standalone whitespace chunks are dropped before history assembly because the idle/replay ingestion path checks text.trim().length > 0. This affects user, assistant and thought chunks on that path. Actual prevalence among providers is unmeasured.

Impact

Minor bug or occasional failure

Version or commit

main @ 399ea10

Environment

Linux, ACP adapter with the repository's mock ACP agent. Reproduced through the public adapter snapshot interface without a paid provider turn.

Logs or stack traces

Expected: assistant:hi there
Actual:   assistant:hithere

Screenshots, recordings, or supporting files

Found during the Pi and ACP Improvements hunt. An independent Claude Opus 5.5 verifier confirmed the baseline passes and the whitespace repro fails for the stated reason.

Workaround

None confirmed. Providers that combine whitespace with adjacent non-whitespace text avoid this particular loss.

Activity

  1. added
    vouch:trusted
    on Nov 16, 2026
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

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions