Skip to content

Fold an autonomous stretch with no user turn (dirge-qobx.4) - #843

Merged
yogthos merged 1 commit into
mainfrom
fix/qobx-4-window
Sep 2, 2026
Merged

Fold an autonomous stretch with no user turn (dirge-qobx.4)#843
yogthos merged 1 commit into
mainfrom
fix/qobx-4-window

Conversation

@yogthos

@yogthos yogthos commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #842.

compute_compress_window snapped both cuts to a user message (dirge-89fm) so no tool_usetool_result pair could be split. But one prompt and a hundred tool iterations — the normal shape of agentic work — has no user turn in it: snap_forward_to_user walked the head cut to messages.len(), the window collapsed to (0, 0), the summarizer never ran, and every fold in that stretch degraded to prune-only. apply_checkpoint_summary refused for the same reason, so the background-checkpoint fast path could not fire there either.

A user turn is sufficient, not necessary. Results follow their call immediately (heal::fix_tool_call_pairing repairs a transcript where they do not), so any index whose message is not itself a tool result is a safe cut: the kept tail cannot begin with an orphan, and the message before the cut cannot be holding calls whose results were dropped — those results would be at the cut.

The user boundary stays the preferred cut, so every transcript that folded before folds identically; the fallback only runs where the old code returned nothing at all. A stretch where every candidate cut is a tool result is still refused.

@yogthos
yogthos force-pushed the fix/qobx-4-window branch 7 times, most recently from 0a7d16c to 6d7c90c Compare September 2, 2026 15:03
compute_compress_window snapped both cuts to a user message (dirge-89fm)
so no tool_use/tool_result pair could be split. But one prompt and a
hundred tool iterations has no user turn: snap_forward_to_user walked
the head cut to messages.len(), the window collapsed to (0, 0), the
summarizer never ran, and every fold in the stretch degraded to
prune-only. apply_checkpoint_summary refused for the same reason, so
the background-checkpoint fast path could not fire there either.

A user turn is sufficient, not necessary. Results follow their call
immediately (heal::fix_tool_call_pairing repairs a transcript where
they do not), so any index whose message is not itself a tool result is
a safe cut: the kept tail cannot begin with an orphan, and the message
before the cut cannot hold calls whose results were dropped, because
those results would be at the cut.

The user boundary stays the preferred cut, so every transcript that
folded before folds the same way; the fallback only runs where the old
code returned nothing at all.
@yogthos
yogthos merged commit 770cbcc into main Sep 2, 2026
15 checks passed
@yogthos
yogthos deleted the fix/qobx-4-window branch September 2, 2026 15:19
yogthos pushed a commit that referenced this pull request Sep 2, 2026
dirge-qobx and children .1-.6, all closed by #840-#843. Plus dirge-57hu:
CI runs nextest with no timeout, so the looping test those PRs surfaced
held ten runners for 5h29m instead of failing.

Also gitignores .beads/.auto-import-issues.jsonl, a per-machine staging
marker that has been showing up untracked.
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.

1 participant