Compacting a forked session drops the step's own work from the summary #276

Closed
opened 2026-10-28 13:22:06 -04:00 by cmoriarty · 1 comment
Owner

What happens
When opencode (2.0.30) compacts a session that was forked from another step's, the compaction request carries the history the session was forked with and the step's brief, not the step's own turns since the fork. The summary the step goes on from leaves out what it did.

Seen in the apply-single simulated run, where opencode is real: the build's turn requests carried 14, then 17 messages; the compaction request carried 14, the history at the fork. In a session of its own the compaction request carries every turn.

Since #275, thorough forks its build session from the proposal, so every compaction during a build hits this. The worktree still holds the work, so the step can recover it, at a cost.

Fix

  • Find whether opencode compacts from the fork's parent (a pin, an upstream report, or a patch).
  • Until then, compact a forked step by a fresh session seeded with Braid's note, as a failed compaction does.

Done when
A compacted build step's summary names the files it wrote and the tasks it ticked before the compaction.

**What happens** When opencode (2.0.30) compacts a session that was forked from another step's, the compaction request carries the history the session was forked with and the step's brief, not the step's own turns since the fork. The summary the step goes on from leaves out what it did. Seen in the `apply-single` simulated run, where opencode is real: the build's turn requests carried 14, then 17 messages; the compaction request carried 14, the history at the fork. In a session of its own the compaction request carries every turn. Since #275, `thorough` forks its build session from the proposal, so every compaction during a build hits this. The worktree still holds the work, so the step can recover it, at a cost. **Fix** - Find whether opencode compacts from the fork's parent (a pin, an upstream report, or a patch). - Until then, compact a forked step by a fresh session seeded with Braid's note, as a failed compaction does. **Done when** A compacted build step's summary names the files it wrote and the tasks it ticked before the compaction.
Author
Owner

Verified by the simulated run apply-single, which drives real opencode. A carried (forked) step that crosses its context alarm now starts a fresh session ("Continued session full"), and compacts in place only at the second alarm. Production runs this size stay far below the alarm (run 136's largest step peaked at 89,828 of 240k), so it won't come up on its own.

Verified by the simulated run `apply-single`, which drives real opencode. A carried (forked) step that crosses its context alarm now starts a fresh session ("Continued session full"), and compacts in place only at the second alarm. Production runs this size stay far below the alarm (run 136's largest step peaked at 89,828 of 240k), so it won't come up on its own.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid#276
No description provided.