Skip to content

test(tui): headless session history reconstructed on hydration#206

Merged
edwin-zvs merged 1 commit into
mainfrom
headless-hydration-test
May 24, 2026
Merged

test(tui): headless session history reconstructed on hydration#206
edwin-zvs merged 1 commit into
mainfrom
headless-hydration-test

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Follow-up to #195 (render headless conversation in the TUI). That PR has rendering coverage, but no test asserting headless history is reconstructed on restart/reconnect. This adds one.

What it covers

Exercises the real hydration path — load_session_hydrationapply_transcript_to_local_state — including the SessionHydrationRequest.is_headless plumbing, against a mock daemon serving a PTY-less transcript of Message + Reasoning events (what a headless session persists).

  • Headless (is_headless: true): the rebuilt ItemHistory renders the assistant prose ("Hello from headless") and reasoning ("considering options") — i.e. the conversation is restored on relaunch / after /agentd restart.
  • Contrast (is_headless: false): the same transcript's Message prose is not re-rendered (a PTY-backed session keeps its prose in the PTY stream, so replaying it would double it up).

This guards the restart-reconstruction wiring that the rendering-only test (transcript_replay_renders_messages_only_when_headless) doesn't reach.

Verification

Test-only change. New test green; full agentd-cli suite (173) passes; --locked workspace build clean.

🤖 Generated with Claude Code

Adds a regression test exercising the full restart/reconnect hydration
path (load_session_hydration → apply_transcript_to_local_state, including
the SessionHydrationRequest.is_headless plumbing) against a mock daemon
serving a PTY-less transcript of Message/Reasoning events. Asserts the
headless prose + reasoning are folded back into the rebuilt ItemHistory
when is_headless, and that a PTY-backed session does NOT re-render that
transcript prose (it lives in the PTY stream).
@edwin-zvs
edwin-zvs merged commit 91c902c into main May 24, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the headless-hydration-test branch May 24, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant