Skip to content

v3.2.1

Latest

Choose a tag to compare

@serkanalgur serkanalgur released this 28 Oct 06:19
· 1 commit to main since this release
ae7a49c

FIXES

  • A compression block that removed the head of the history no longer produces a request that starts mid-tool-loop. The summary is injected at its anchor, which can sit well after the removed messages, so when the block covered the original prompt the outgoing history began with an assistant turn holding a tool_use and no user turn before it — Anthropic rejects that with tool_use ids were found without tool_result blocks immediately after, and the stored block re-applied on every later request, so the session kept failing. The first injected summary is now hoisted to the front whenever the original history started with a user turn; if there is no summary to hoist, the request goes out uncompressed rather than malformed.

Reported and fixed by @leandromqrs in #14.

Verification: 440 tests / 137 suites passing, tsc --noEmit clean. Published to npm as @serkanalgur/opencodev2-slim@3.2.1.