Repository navigation
feat(tui): keep the child session view live on the poll tick - #694
Merged
Merged
Conversation
P5a opened the view as a snapshot, so a live subagent's transcript froze at the moment the operator pressed `→`. This re-reads the viewed child's journal on the existing `poll_background_tasks` tick while its task is non-terminal; a finished child keeps its final snapshot. Guarded on the live handle, not the view: `ChildSessionView` now carries the task id, and the tick refreshes only while that task's status is non-terminal. A stale view can never point the refresh at the wrong journal, because the id comes from the background registry each tick. Three quietness rules, each load-bearing: - Silent. The tick already updates the strip, which is the evidence; an unreadable journal must not knock a view the operator is still reading out from under them. - Swap only when the messages actually changed (length plus last content length), else every tick invalidates the render cache for nothing. - Never touches the conversation window: the operator may be reading an older page, and a refresh must not steal their place. Tests: an unchanged journal across a poll leaves the revision untouched (no render-cache churn); ending the child keeps the view standing on its final snapshot with scroll intact; and `session_messages` reads an unreadable journal as `None` rather than an error, so one bad session cannot fail the caller.
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.
P5b: the child session view no longer freezes. P5a (#692) opened it as a snapshot, so a live subagent's transcript stopped at the moment the operator pressed
→. This re-reads the viewed child's journal on the existingpoll_background_taskstick while its task is non-terminal; a finished child keeps its final snapshot.Guarded on the live handle, not the view
ChildSessionViewnow carries the task id, and the tick refreshes only while that task's status is non-terminal. The id comes from the background registry each tick, so a stale view can never point the refresh at the wrong journal.Three quietness rules
Each is load-bearing, and each is documented at the call site:
Notes for the reviewer
session_messagesreturningNonefor an unreadable journal is the same contract assession_title_hint— fall back, never fail the whole listing. The test plants a non-SQLite.dbfile to prove the read side, sinceJournal::openwithcreate_if_missingmakes a merely-missing file readable.Verification
cargo fmt --all -- --checkclean;cargo clippy --package forge-tui --all-targets --locked -- -D warningsclean.