Session Todo-list is forgotten after compaction #3739

Open
opened 2026-02-16 17:41:17 -05:00 by yindo · 4 comments
Owner

Originally created by @hosseinalipour on GitHub (Dec 22, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Session todo lists are lost after compaction. The todo lists should persist across compaction operations but are currently being cleared. (auto compaction only. I don't know if it can be reproduced with /compact command)

Expected behavior:
Todo lists persist across compaction

Actual behavior:
Todo lists are cleared after compaction


opencode version: 1.0.185
model this happened with: Claude Opus 4.5 127k context
Can provide logs if any, I still have the session this problem happened.

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @hosseinalipour on GitHub (Dec 22, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description Session todo lists are lost after compaction. The todo lists should persist across compaction operations but are currently being cleared. (auto compaction only. I don't know if it can be reproduced with /compact command) Expected behavior: Todo lists persist across compaction Actual behavior: Todo lists are cleared after compaction --- opencode version: 1.0.185 model this happened with: Claude Opus 4.5 127k context Can provide logs if any, I still have the session this problem happened. ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bug label 2026-02-16 17:41:17 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 22, 2025):

This issue might be a duplicate of or related to existing issues. Please check:

  • #4081: undo does not undo todo list, resulting in agents continuing on the same path as the undo (similar todo list state persistence issue)
  • #3423: opentui: todo list missing data (related todo list data loss)
  • #5760: Context size in sidebar not updated after /compact (compaction-related state issues)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 22, 2025): This issue might be a duplicate of or related to existing issues. Please check: - #4081: undo does not undo todo list, resulting in agents continuing on the same path as the undo (similar todo list state persistence issue) - #3423: opentui: todo list missing data (related todo list data loss) - #5760: Context size in sidebar not updated after /compact (compaction-related state issues) Feel free to ignore if none of these address your specific case.
Author
Owner

@tedin7 commented on GitHub (Dec 23, 2025):

Hi! I noticed that after compaction, the model sometimes loses track of todos, probably depends on whether the summary happens to mention them clearly.
I have a small fix (~5 lines) that adds a reminder to the compaction prompt when todos exist, so the summary reliably includes them.

Happy to open a PR if useful, or just share the approach!

@tedin7 commented on GitHub (Dec 23, 2025): Hi! I noticed that after compaction, the model sometimes loses track of todos, probably depends on whether the summary happens to mention them clearly. I have a small fix (~5 lines) that adds a reminder to the compaction prompt when todos exist, so the summary reliably includes them. Happy to open a PR if useful, or just share the approach!
Author
Owner

@gasatrya commented on GitHub (Dec 31, 2025):

I think in your case just the Todo-list, you can set the Compaction prune to false, see this config https://opencode.ai/docs/config/#compaction

@gasatrya commented on GitHub (Dec 31, 2025): I think in your case just the Todo-list, you can set the Compaction `prune` to `false`, see this config https://opencode.ai/docs/config/#compaction
Author
Owner

@rexdotsh commented on GitHub (Jan 20, 2026):

Hi! I noticed that after compaction, the model sometimes loses track of todos, probably depends on whether the summary happens to mention them clearly. I have a small fix (~5 lines) that adds a reminder to the compaction prompt when todos exist, so the summary reliably includes them.

Happy to open a PR if useful, or just share the approach!

Hi @tedin7, mind sharing your approach or opening a PR?

@rexdotsh commented on GitHub (Jan 20, 2026): > Hi! I noticed that after compaction, the model sometimes loses track of todos, probably depends on whether the summary happens to mention them clearly. I have a small fix (~5 lines) that adds a reminder to the compaction prompt when todos exist, so the summary reliably includes them. > > Happy to open a PR if useful, or just share the approach! Hi @tedin7, mind sharing your approach or opening a PR?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3739