Skip to content

fix(core): handle aborted overflow compaction#34029

Open
cwj2001 wants to merge 1 commit into
anomalyco:devfrom
cwj2001:compaction-guard
Open

fix(core): handle aborted overflow compaction#34029
cwj2001 wants to merge 1 commit into
anomalyco:devfrom
cwj2001:compaction-guard

Conversation

@cwj2001

@cwj2001 cwj2001 commented Jun 26, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes #27924

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Handles aborted overflow recovery compaction without re-entering the compaction loop.

When the provider reports context overflow before assistant output, OpenCode tries to summarize and retry once. If that summary stream aborts or dies with a non-interrupt failure, this PR treats the summary as failed and persists the original provider overflow as the assistant error.

Real user/session interrupts still propagate as interrupts.

How did you verify your code works?

  • bun test test/session-runner.test.ts --test-name-pattern "publishes the original overflow when recovery summarization aborts" from packages/core
  • bun test test/session-runner.test.ts --test-name-pattern "overflow" from packages/core
  • bun typecheck from packages/core
  • Push hook ran bun turbo typecheck: 29 successful, 29 total

Screenshots / recordings

N/A. Core session recovery fix.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

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.

bug(session): infinite compaction loop when compression fails to reduce context

2 participants