GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): retry compaction on output token limit and preserve user turns by kitlangton · Pull Request #57220 · anomalyco/opencode

Conversation

@kitlangton

@kitlangton kitlangton commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Compaction requests inherit the session model and variant from SessionContext.load, including adaptive high-effort thinking on Claude 4.6/4.7. Because thinking tokens count toward maxTokens (capped at 32,000 by SessionModelRequest.outputLimit), large compactions can spend ~25k tokens on thinking and hit finish: "length" mid-summary.
  • Keep the initial compaction request byte-identical to the session prefix so the prompt cache stays warm, and when compaction finishes with length, retry once with a concise-summary instruction (LENGTH_NUDGE) and reduced/disabled reasoning (lowerReasoning, using per-message Message.effort({ effort: "low" }) when supported to preserve top-level output_config.effort cache stability).
  • When automatic pre-step compaction still settles as failed, continue running the user's turn (with overflow recovery disabled for that step) instead of aborting the turn and dropping the user's pending message.
  • Treat any trailing settled compaction message as already attempted in SessionCompaction.due so transient step retries do not re-trigger automatic compaction before the assistant responds.

Testing

  • Added unit tests in packages/core/test/session-compaction.test.ts and packages/core/test/session-runner.test.ts covering variant thinking inheritance, length retry with lowered reasoning, and preserving the user turn when automatic compaction fails.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kitlangton
fix(core): retry compaction on output token limit and preserve user t…
ba1fc7e
…urns
@github-actions github-actions Bot added the contributor label Oct 19, 2026
This was referenced Oct 20, 2026
fix(core): retry truncated compaction with less history #57236
Closed
compaction: reasoning tokens consume the summary budget, so compaction fails with "reached the output token limit" #59110
Open
@github-actions

github-actions Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this Nov 20, 2026
@github-actions github-actions Bot added the automated-pr-cleanup label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

automated-pr-cleanup contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@kitlangton
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.