Skip to content

Run more end-to-end tests against sessions v2 - #1091

Merged
fazxes merged 8 commits into
fazxes/sessions-v2-commandsfrom
fazxes/sessions-v2-coverage
Oct 1, 2026
Merged

fazxes merged 8 commits into
fazxes/sessions-v2-commandsfrom
fazxes/sessions-v2-coverage

Conversation

@fazxes

@fazxes fazxes commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • FX_SESSIONS_V2=1 now reaches fx in every tmux test. Panes on the shared tmux server took that server's environment, so with the switch set the interactive suites still ran on v1. When the switch is unset, the pane has it unset too.
  • With the switch set, tui-resume finds sessions under ~/.fx/sessions/v2 and expects the resume hint and the Ctrl+G relaunch to keep --sessions-v2. 47 of its 67 tests now pass on v2; the other 20 read or write v1 session files directly.
  • New v2 tests for flows that had none: a resumed fx ask turn keeps the session's language; fx ask compacts on its own and resumes from the summary; a piece over 256 KB is kept as a blob and sent whole on resume; the app resumes a compacted session; text typed while the app answers steers that turn and is saved inside it; a cancelled reply is saved as cancelled; the app talks to the user while a child runs; a parent killed while a named child runs a tool records that work interrupted; a named child keeps its history after the app is killed; and a hosted terminal keeps running through an app crash, and the resumed app reaches it and stops it.
  • Fault tests for the app, ACP and subagents: killed between turns, killed while a tool runs, a torn last line, a flipped byte, a missing blob, a read-only session, a second process on the same session, and a full disk. Each checks what the host says, that the log is left as it was, and that the session resumes afterwards. A damaged child log fails that message and the parent turn goes on.
  • A fault grid crosses every way a run can leave a session (committed, cancelled, killed mid-reply, killed mid-tool) with every fault (none, a torn last line, a flipped byte, a missing blob, a read-only folder, a full disk, a second process) and every way back in (fx ask by id and by last, the app by id and with -c, ACP load and resume), plus a new session in each host. A refusal must name its cause and leave the log as it was, a fault that clears must give way, and a session that comes back must show the model the history the run left. On macOS the full disk is a real disk image filled to the last byte; elsewhere a file-size limit stands in.
  • With FX_TRACE_SCOPES=wiring, v2 writes one trace line for each session step a host takes: the store opening and closing, a session opening and closing, a turn starting and ending, and a child starting and finishing. Each line names its session and process, so a run's session steps can be checked in order.
  • The full-disk tests now size their limit from the shell's own block. Bash, which is /bin/sh on macOS, counts 1024-byte blocks and dash counts 512, so the old fx ask limit left twice the room it meant to on macOS.
  • Running the suites this way found two bugs, fixed in the PRs that own the code: the picker froze for two seconds on a session open in another fx (Add the experimental v2 session store to interactive fx #1073), and resuming an interactive session with a shell result hung (Store ACP sessions in sessions v2 #1079).

Nothing changes when FX_SESSIONS_V2 is unset.

Stacked on #1082.

@fazxes fazxes added the type: maintenance Changes internal tooling, dependencies, CI, or implementation structure label Sep 28, 2026
@fazxes
fazxes force-pushed the fazxes/sessions-v2-coverage branch from 8f5867b to c0ba089 Compare September 29, 2026 04:24
@fazxes
fazxes force-pushed the fazxes/sessions-v2-commands branch 2 times, most recently from 77f4165 to 0f4ca16 Compare September 29, 2026 05:41
@fazxes
fazxes force-pushed the fazxes/sessions-v2-coverage branch from c0ba089 to aef91ad Compare September 29, 2026 05:41
@fazxes
fazxes force-pushed the fazxes/sessions-v2-commands branch from 0f4ca16 to e7c97a8 Compare September 29, 2026 15:48
@fazxes
fazxes force-pushed the fazxes/sessions-v2-coverage branch from aef91ad to 00aab9d Compare September 29, 2026 15:48
@fazxes
fazxes force-pushed the fazxes/sessions-v2-commands branch from e7c97a8 to d52c502 Compare September 29, 2026 18:33
@fazxes
fazxes force-pushed the fazxes/sessions-v2-coverage branch 2 times, most recently from 64f78c6 to b9d4bee Compare September 30, 2026 17:20
@fazxes
fazxes force-pushed the fazxes/sessions-v2-commands branch from 710dc22 to d7ead9e Compare September 30, 2026 22:12
@fazxes
fazxes force-pushed the fazxes/sessions-v2-coverage branch from b9d4bee to 74a963d Compare September 30, 2026 22:12
@fazxes
fazxes force-pushed the fazxes/sessions-v2-commands branch from d7ead9e to 7f0ba25 Compare September 30, 2026 22:49
@fazxes
fazxes force-pushed the fazxes/sessions-v2-coverage branch from 74a963d to 8298728 Compare September 30, 2026 22:49
@fazxes
fazxes marked this pull request as ready for review October 1, 2026 01:01
- FX_SESSIONS_V2 now reaches fx in every tmux test. Panes on the shared tmux server took that server's environment, so with the switch set the interactive suites still ran on v1. When the switch is unset, the pane has it unset too.
- With FX_SESSIONS_V2=1, tui-resume finds sessions under sessions/v2 and expects the resume hint and the Ctrl+G relaunch to keep --sessions-v2.
- A resumed fx ask turn with no language of its own keeps the session's saved language.
- fx ask compacts on its own, keeps what it summarized as side files, and a later resume sends the summary without summarizing again.
- A piece over 256 KB is saved as a blob, and a resume sends it whole.
- An interactive session resumed after /compact sends the summary and still shows every turn.
- Text typed while the app answers steers that turn and is saved inside it; a cancelled reply is saved as cancelled, and the session continues after a resume.
- A parent killed while a named child runs a tool records that work interrupted and stops the tool, and the child continues with its history.
- The app keeps talking to the user while a child runs, and records the child's work done.
Kill each host between turns, damage the log, remove a blob, make the
session read-only, hold it in another process and fill the disk, and
check what each host says, that the log is left as it was and that the
session resumes afterwards. A damaged child log fails that message and
the parent turn continues.

The file-size limit now uses the shell's own block size: bash counts
1024 bytes and dash 512, so the old limit left twice the room intended
on macOS.
Kill the app after a named child finished and check that the child
continues with its history under the same id. Start a hosted terminal,
kill the app, and check that the resumed app reaches the same terminal,
stops it, and closes its record in the session's side folder.
The app and ACP are each killed while a tool runs: the finished call keeps its result, the running one comes back answered as possibly run, and the crash interrupts the turn. Each also cuts a torn last line on resume or load and goes on. The fault tests now expect the named startup, load and save messages, and the first cause after a failed write.
With FX_TRACE_SCOPES=wiring, the adapter writes one line when the store opens and closes, when a host session opens and closes, when a turn starts and ends, and when a child starts and finishes. Each line names its session and process, so a run's session steps can be checked in order. Subagent children are not traced as host sessions. The process id is read once, when the store opens.
A fault grid crosses four ways a run can leave a session (committed,
cancelled, killed mid-reply, killed mid-tool) with seven faults (none, a
torn last line, a flipped byte, a missing blob, a read-only folder, a full
disk, a second process) and six ways back in (fx ask by id and by last,
the app by id and with -c, ACP load and resume), plus a new session in
each host. A refusal must name its cause and leave the log as it was, a
fault that clears must give way, and a session that comes back must show
the model the history the run left. On macOS the full disk is a real disk
image filled to the last byte; elsewhere a file-size limit stands in.

The file now runs about four times as long, so its shard weight goes from
20 to 80.
@fazxes
fazxes force-pushed the fazxes/sessions-v2-commands branch from 7f0ba25 to f554fdf Compare October 1, 2026 02:11
@fazxes
fazxes force-pushed the fazxes/sessions-v2-coverage branch from 8298728 to 4d70760 Compare October 1, 2026 02:11
@fazxes
fazxes merged commit d02c63e into fazxes/sessions-v2-commands Oct 1, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: maintenance Changes internal tooling, dependencies, CI, or implementation structure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant