Run more end-to-end tests against sessions v2 - #1091
Merged
Merged
Conversation
fazxes
force-pushed
the
fazxes/sessions-v2-coverage
branch
from
September 29, 2026 04:24
8f5867b to
c0ba089
Compare
fazxes
force-pushed
the
fazxes/sessions-v2-commands
branch
2 times, most recently
from
September 29, 2026 05:41
77f4165 to
0f4ca16
Compare
fazxes
force-pushed
the
fazxes/sessions-v2-coverage
branch
from
September 29, 2026 05:41
c0ba089 to
aef91ad
Compare
fazxes
force-pushed
the
fazxes/sessions-v2-commands
branch
from
September 29, 2026 15:48
0f4ca16 to
e7c97a8
Compare
fazxes
force-pushed
the
fazxes/sessions-v2-coverage
branch
from
September 29, 2026 15:48
aef91ad to
00aab9d
Compare
fazxes
force-pushed
the
fazxes/sessions-v2-commands
branch
from
September 29, 2026 18:33
e7c97a8 to
d52c502
Compare
fazxes
force-pushed
the
fazxes/sessions-v2-coverage
branch
2 times, most recently
from
September 30, 2026 17:20
64f78c6 to
b9d4bee
Compare
fazxes
force-pushed
the
fazxes/sessions-v2-commands
branch
from
September 30, 2026 22:12
710dc22 to
d7ead9e
Compare
fazxes
force-pushed
the
fazxes/sessions-v2-coverage
branch
from
September 30, 2026 22:12
b9d4bee to
74a963d
Compare
fazxes
force-pushed
the
fazxes/sessions-v2-commands
branch
from
September 30, 2026 22:49
d7ead9e to
7f0ba25
Compare
fazxes
force-pushed
the
fazxes/sessions-v2-coverage
branch
from
September 30, 2026 22:49
74a963d to
8298728
Compare
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
force-pushed
the
fazxes/sessions-v2-commands
branch
from
October 1, 2026 02:11
7f0ba25 to
f554fdf
Compare
fazxes
force-pushed
the
fazxes/sessions-v2-coverage
branch
from
October 1, 2026 02:11
8298728 to
4d70760
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FX_SESSIONS_V2=1now 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.tui-resumefinds sessions under~/.fx/sessions/v2and 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.fx askturn keeps the session's language;fx askcompacts 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.fx askby 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.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./bin/shon macOS, counts 1024-byte blocks and dash counts 512, so the oldfx asklimit left twice the room it meant to on macOS.Nothing changes when
FX_SESSIONS_V2is unset.Stacked on #1082.