Agent pane: a finished turn's fold comes from one per-harness-family table

Merged
TE
2d ago
+295-15

Leo-ask: Leo 2026-11-04 01:47Z turn folding per harness

Leo, 2026-11-04: "doesn't make sense to fold claude's transcripts like that. do it for chatgpt, do the proper folds for however the other harnessses/model families fold (muse, gemini)", then: "i think it should be the top level collapsible thing IF POSSIBLE... SOMETIMES there's just claude chatter that we could prob group up".

Follow-up to #34774, which folds a finished Claude turn under one "Worked for".

What changes

How a finished turn folds is now one property per harness family, kept in one table: conversation/turnFoldStyle.ts (TURN_FOLD_STYLES, keyed by the family's agent, so claude-sr2 maps to claude). turns.ts reads it once per turn, and its startsWith("claude") checks are gone.

FamilyFinished turn
codex (ChatGPT)Unchanged: a closed "Worked for" over the conclusion, with Codex's "N previous messages" header when messages sit between the work.
claude#34774's fold, but the header always reads "Worked for" (ChatGPT's "Worked for 12m 16s ›") and never counts messages. When opened, the runs still fold one line per run.
geminiNo turn fold. Each run of calls folds into its own line in place, the way Gemini CLI groups a run's calls in one tool box.
museNo reference shows how Muse Code ends a turn, so it gets no turn fold either, only per-run lines in place.
any other familyFolds like Codex, as before.

Spec: leo-workspace design/chat-transcript.md, "fold a finished turn as its harness family's row says".
Gallery: agent-pane.turn-fold-per-harness, with variants claude, claude-open, codex, gemini and muse.

Tests

  • conversation/turnFoldStyle.test.ts: one test per family, plus Claude edge cases: a turn that ends on a tool call, a turn with only a reply, and a running turn.
  • conversation/codexHeader.test.ts: a Claude turn reads "Worked for 1m", not the message count.

Observed / Not run

  • A fleet webviews check and test run is in flight at this head. Anything it finds is fixed forward, since this is a leo-named-fix.

Changelog

Changed: A finished Claude turn's fold always reads "Worked for", and Gemini and Muse turns keep their work in place.

🤖 Generated with Claude Code

Agent session: agent session


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

How a finished turn folds now comes from one table per harness family (turnFoldStyle.ts) instead of hardcoded claude checks in turns.ts.

Behavior per family

  • Codex and any family without a row: unchanged, closed "Worked for" that counts the messages it folds.
  • Claude: same fold, but the header always reads "Worked for" and never counts messages; opened, its runs still fold one line per run.
  • Gemini and Muse: no turn fold; each run of calls folds into its own line in place.