Skip to content

/export after /compact writes only the turns that survived compaction, and the file name is not the documented one #2685

Closed

Description

@AbirAbbas

Severity: P1 (an export that is documented as the whole conversation silently drops its first turns) · Regression: no (v0.8.2 does the same)

What happened

Found in the 2026-11-16 hand-QA of dev@9eb0b516b (dev-20261114-9eb0b516b6f2, linux amd64) with a real OpenRouter
model; v0.8.2 does the same, so it is old, not a regression. After /compact, /export writes only the part of the
conversation that survived compaction. Everything before it is missing from the file, with no note that anything was
left out. In three of three runs the first three turns (including the first turn's question and answer) were absent
and the file began at turn 4:

    ·  compacted · about 15487 to 14879 tokens
    · exported · <folder>/transcript-merge-sort-explanation-with-perigee-42.md

# merge sort explanation with perigee-42

## you

In one sentence, what is the space complexity of merge sort?     <- turn 4; turns 1-3 are not in the file
...
## you

What was the exact codeword from our first turn?

## codeaf

PERIGEE-42.

commands.md, "Does export save to my laptop — /export writes this conversation here": "/export (or /save) writes the
whole conversation to a markdown file somebody else can read. It is built from the full transcript, not from the
tail on screen. With no argument the file lands in the local root under a name derived from the session, like
20260817-150405_a3f2-port-the-resume-picker.md — the transcript file stem plus the session name in kebab case". The
same page and run also show the name: the file is transcript-<session name>.md, not the documented
<stamp>_<id>-<session name>.md; the stem part of the name is the literal journal file name transcript. The
exported record is the one a person hands to somebody else, so a silently shortened export is a document that lies by
omission.

Replication

Deterministic (no model). The repository's scripted endpoint cannot make /compact summarise anything small
enough to see; use the field run.

Field (real models). A cheap OpenRouter model, an empty CODEAF_HOME and an empty folder; about a cent:

  1. codeaf, then /budget conversation 0.5.
  2. Send three turns long enough to give /compact something to summarise: Write a 300-word explanation of merge sort and include the exact codeword PERIGEE-42., Write a 300-word explanation of heap sort., Write a 300-word explanation of quicksort pivot selection.
  3. Send three short ones: In one sentence, what is the space complexity of merge sort?, In one sentence, is heap sort stable?, In one sentence, is merge sort stable?
  4. /compact, wait for · compacted · about N to M tokens, send What was the exact codeword from our first turn?
    (it answers PERIGEE-42 from the summary).
  5. /export, then read the file it names: no turn 1, 2 or 3 in it.

Where

exportTranscript in internal/tui3/export.go builds the document from a.agent.Transcript(), which after a
compaction is the retained tail plus the new turns. exportFileName joins the journal's file stem and the session name
with -.

The fix

/export is built from the whole journal as commands.md says (the compaction summary may stand where the earlier
turns were, but the turns themselves must be in the file), or the page and the export both say that a compacted
conversation exports its tail and where the rest lives. The default name follows the page, or the page follows the name.

Acceptance

  • e2e: a conversation of six turns, /compact, one more turn, /export: the file contains the text of turns 1
    to 3 and of the last turn.
  • Unit: exportDocument fed the journal of a compacted conversation returns every user line the journal holds.
  • Unit: the default file name matches the form the manual gives, or the manual shows transcript-<session name>.md.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions