Skip to content

fix(eve): improve compaction checkpoints#771

Open
ruiconti wants to merge 1 commit into
rui/compaction-redundancy-regressionsfrom
rui/pi-style-compaction-checkpoint
Open

fix(eve): improve compaction checkpoints#771
ruiconti wants to merge 1 commit into
rui/compaction-redundancy-regressionsfrom
rui/pi-style-compaction-checkpoint

Conversation

@ruiconti

@ruiconti ruiconti commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Why

#749 records a production task that lost completed investigation state across compaction and continued for 442 model turns, 2,026 tool calls, and $59.0342 before cancellation. The free-form checkpoint prompt did not tell the compactor how to update an earlier checkpoint or keep completed work separate from pending work.

The first version of stacked test PR #755 required pi's exact headings. Its 60-call result measured formatting compliance, not semantic progress loss. After removing that requirement, base run 29303880312 passed the original six one-compaction cases on eve's existing prompt. Those results are retained as evidence that the earlier claim was invalid, not as proof for this change.

Review then exposed a separate repeated-compaction bug: eve stored its checkpoint as ordinary conversation messages. A later compaction could truncate the checkpoint to 280 characters or split its marker from its content and retain the stale checkpoint beside the replacement. Two focused regressions failed on both paths before the fix.

What changed

  • Use a Codex-style handoff prompt that asks for progress, decisions, constraints, remaining work, and critical continuation data without mandating section names.
  • Extract the framework-owned checkpoint before recent-window selection. Prompt construction receives it separately and intact, applies lossy truncation only to ordinary transcript messages, and replaces the old checkpoint with the updated one.
  • Move prompt construction into a pure module. Prompt serialization is tested directly instead of through a mocked model call.
  • Derive one fixed prompt-envelope estimate from the same prompt fragments used by the model call. The trigger adds that module-level reserve directly instead of scanning and splitting history on every check.
  • Require exactly two compactions in both regression cases for GPT-5.6, Opus 4.8, and Sonnet 5. Each case must keep the original work call at one, advance the checkpoint once, and finish with both completion markers.
  • Describe prompt-directed behavior as an instruction rather than a guaranteed output schema, with a patch changeset for eve.

On the final head, all six repeated-compaction cases passed in both the local run and the Vercel run. Each case observed exactly 2 compactions, 1 original work call, 1 checkpoint-advance call, and both checkpoint markers in the final response.

This PR is stacked on #755. Repeated-call containment remains a separate follow-up.

Addresses #749.

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
eve-docs Ready Ready Preview, Comment, Open in v0 Jul 14, 2026 5:42am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
eve-docs-1644 Skipped Skipped Open in v0 Jul 14, 2026 5:42am
eve-docs-4759 Skipped Skipped Open in v0 Jul 14, 2026 5:42am

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Prior structured checkpoint is truncated to 280 chars on the 2nd+ compaction, so accumulated progress/decisions/context are lost instead of being carried forward.

Fix on Vercel

@ruiconti ruiconti marked this pull request as ready for review July 14, 2026 03:25
@ruiconti ruiconti force-pushed the rui/pi-style-compaction-checkpoint branch from 16afb63 to 55cefc0 Compare July 14, 2026 03:39
@ruiconti ruiconti changed the title fix(eve): preserve progress across compaction fix(eve): improve compaction checkpoints Jul 14, 2026
@ruiconti ruiconti force-pushed the rui/pi-style-compaction-checkpoint branch 2 times, most recently from 58b8a46 to dd027db Compare July 14, 2026 05:24
@vercel vercel Bot temporarily deployed to Preview – eve-docs-4759 July 14, 2026 05:24 Inactive
@vercel vercel Bot temporarily deployed to Preview – eve-docs-1644 July 14, 2026 05:24 Inactive
@ruiconti ruiconti force-pushed the rui/pi-style-compaction-checkpoint branch from dd027db to 4a925e0 Compare July 14, 2026 05:40
@vercel vercel Bot temporarily deployed to Preview – eve-docs-4759 July 14, 2026 05:40 Inactive
@vercel vercel Bot temporarily deployed to Preview – eve-docs-1644 July 14, 2026 05:40 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants