Skip to content

/compact can keep completed work in Next Move after preserved-tail turns #38530

Closed as not planned

Description

@samiralibabic

Description

A repeated /compact can preserve stale work under Next Move when the previous summary lists an action and the recent preserved tail shows that action was completed. The tail remains in the session but is excluded from the summarizer history, so it cannot reconcile the previous summary.

Expected: completed work is removed from Next Move. The recent tail should remain preserved and should only be supplied as a small, sanitized reconciliation audit.

Replaces #28063, which was closed by inactivity. PR #46364 contains the current regression coverage and bounded tail-audit implementation, replacing the auto-closed #28067.

Plugins

None

OpenCode version

Current dev (9f69463f1d)

Steps to reproduce

  1. Compact a session whose summary lists run tests under Next Move.
  2. Run the tests successfully in one of the preserved recent turns.
  3. Run /compact again.
  4. Observe that run tests can remain under Next Move.

Screenshot and/or share link

N/A

Operating System

macOS

Terminal

iTerm2 / zsh

Activity

  1. kkga commented on Aug 15, 2026

    @kkga

    Confirmed here too. Repro from a real session:

    1. Finished a multi-step change in a session: implemented an algorithm, updated tests, ran the full suite green, updated docs, and committed.
    2. Ran /compact.
    3. The generated summary listed the just-completed work under "Next Move" (e.g. "update tests", "update docs", "build and run tests") as if still pending, instead of in the Completed/Done section.

    Expected: completed items move out of Next Move. Actual: the new session's agent re-did the listed work from scratch — edits succeeded against the original strings, confirming the work really was finished before compaction.

    Same root cause as #28063/#38530: the preserved recent tail (which contains the completed work) is excluded from the summarizer input, so the previous summary's Next Move items survive unchanged. +1 for the bounded tail-audit fix in #28067.

  2. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report and for the work on #28067 and #46364.

    The commit you tested (9f69463f1d) is from before v2 replaced the dev branch. The code involved (compaction.tail_turns and tail_start_id in packages/opencode/src/session/compaction.ts) belongs to OpenCode v1 (1.x). v1 only gets fixes for critical bugs such as data loss, crashes or security problems. A stale Next Move item is not in that category, so this is unlikely to be fixed in v1.

    Compaction works differently in v2 (@opencode/cli, code now in packages/core/src/session/compaction.ts). The summarizer normally gets the whole conversation, including the recent turns that are kept beside the summary. It is also told to move completed work out of Work State and Next Move. The kept turns are left out only in a fallback, when the full request doesn't fit the context window. Please try v2. If you still see completed work under Next Move there, or you think this is critical, reply here with the version and steps.

    Related:

  3. opencodejr commented on Oct 29, 2026

    @opencodejr
    Contributor

    We haven't heard back, so I'm closing this as not planned. This report is about OpenCode v1's compaction (compaction.tail_turns / tail_start_id in packages/opencode). v1 only gets fixes for critical bugs, and a stale Next Move item isn't one of them.

    In v2 (@opencode/cli), the summarizer normally gets the recent turns that are kept beside the summary. If you still see completed work under Next Move on v2, please open a new issue with your opencode --version and the steps to reproduce. #50816 tracks a similar report on v2. Thanks again for the detailed write-up and the PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions