Skip to content

[v2] Make compaction summaries structured and economical#2406

Open
SivanCola wants to merge 8 commits into
esengine:main-v2from
SivanCola:feat/compact
Open

[v2] Make compaction summaries structured and economical#2406
SivanCola wants to merge 8 commits into
esengine:main-v2from
SivanCola:feat/compact

Conversation

@SivanCola
Copy link
Copy Markdown
Contributor

Summary

Change compaction summaries to a fixed five-section structure and skip summarization when the compactable region is too small to be worthwhile.

Root Cause

Free-form summaries are harder for the agent to resume from, and compacting very small regions can cost more latency and tokens than it saves.

Technical Approach

Update the summarizer prompt to emit Goal, Decisions, Files, Commands, and Pending sections; wrap summaries in a dedicated tag; add a simple fold-economics threshold.

Focused Optimization Points

  • Improves resumability after compaction.
  • Makes compacted summaries easier to distinguish from live user input.
  • Avoids low-value summarization calls for tiny regions.

Verification

Not run during this publishing pass. This is opened as a draft PR for upstream review of the split branch.

- Replaces free-form summary prompt with structured 5-section template
  (Goal / Decisions / Files / Commands / Pending)
- Adds foldEconomics() to skip compaction when input region is too small
- Wraps summaries in <compaction-summary> tags for distinguishability
@SivanCola SivanCola changed the title Make compaction summaries structured and economical [v2] Make compaction summaries structured and economical May 31, 2026
@SivanCola SivanCola marked this pull request as ready for review May 31, 2026 09:25
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fc6f416022

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/agent/compact.go Outdated
@SivanCola
Copy link
Copy Markdown
Contributor Author

Resolved the merge conflict by merging the latest main-v2 (ee44f479) into feat/compact and pushing the PR branch to 58cf203c.\n\nWhat was preserved:\n- Kept the PR's structured/economical compaction behavior and tests.\n- Brought in the latest checkpoint, rewind, controller, desktop bridge, and locale updates from main-v2.\n- Let Git's merge combine internal/agent/compact.go without manual conflict markers remaining.\n\nVerification run locally:\n- go test ./...\n- npx pnpm@9 install --frozen-lockfile && npx pnpm@9 build\n\nGitHub checks are currently pending for macOS and Ubuntu.

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.

1 participant