Repository navigation
fix: capture an empty screen on a session that has printed nothing - #235
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…e screenshot test after what it checks
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Why
The operator wants his open agent-tty issues landed. This PR fixes #213. On a session whose program has not printed yet,
snapshotandscreenshotfailed with exit 9RPC_ERRORandretryable: true, and a retry failed the same way. An empty Event Log is a valid state: a blank screen at the session's size. Both renderer backends refused to render it, and the host and the offline replay path skipped the replay for it.What changed
targetSeq-1. They take the session size and replay nothing. The host and the offline replay path now always replay, also for an empty log.capturedAtSeq: -1.record diffalready uses -1 for this state. A newReplaySeqSchema(an integer of at least -1) typescapturedAtSeqin the snapshot, screenshot, render-wait and batch results, the artifact manifest and the renderer types.wait --after-seqaccepts -1, so thecapturedAtSeqof an empty snapshot can be passed to it.Behavior changes for CLI and JSON users
snapshot --jsonandscreenshot --jsonon a silent session exit 0. They return an empty screen or a blank PNG of the session's size, withcapturedAtSeq: -1. The screenshot file isscreenshot--1-<profile>.png.snapshot,screenshotand renderwaitpaths now return a JSON envelope. Before, they printed a raw Node stack and exited 1.wait --text ready --timeout-ms 20000returnedtimedOut: trueafter 3.0 s for output that came at 6 s.--screen-stable-msnow matches the blank screen.capturedAtSeqand--after-seqcan now be -1. A client that requirescapturedAtSeq >= 0must also accept -1. A live render wait that times out on an empty log reportscapturedAtSeq: -1(it was 0).Scope
snapshot,screenshotand render waits, live and offline, on both backends.record export --format webmon an empty log still fails with exit 7EXPORT_ERROR. Record export has its own "requires at least one event" checks. A blank video needs a decision on the empty-log seq for record export, because asciicast export reports 0 there today. I left it for a follow-up.Tradeoffs
capturedAtSeq: 0for the empty screen. That value says event 0 was rendered, and await --after-seq 0chained from it skips the first output.Verification
test/integration/empty-session-capture.test.ts(9 tests) fails 9 of 9 on main 997f701 and passes on this branch. Both backends have a new unit test for the empty replay.check.shexit 0.Closes #213
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:xhigh