Add persistent in-pane banner for closed-out hera worker tasks - #943
Open
anutron wants to merge 3 commits into
Open
Add persistent in-pane banner for closed-out hera worker tasks#943anutron wants to merge 3 commits into
anutron wants to merge 3 commits into
Conversation
anutron
force-pushed
the
argus/build-a-ux-fix-for-closed-out
branch
from
August 21, 2026 22:07
9321517 to
09960d2
Compare
Enter on a closed-out worker/freelance row used to only set a 15s-TTL footer notice and leave the pane's own content unchanged. The first Enter now arms a persistent TerminalPane banner explaining the state; a second, immediately-following Enter dismisses it and falls through to the pane's existing dead-session rendering (replay content, or the placeholder) — no new PTY, process, or emulator is spawned either way.
SetTaskID's eager loadSessionLog call was always undone by the very next ResetVT call in the standard SetTaskID -> ResetVT -> SetSession bind sequence every caller uses (bindPane, reconcileOne, onTaskSelect), regardless of whether the prior session was live. Move the reload into SetSession itself, the only step that knows the definitive new session value, fixing the closed-out banner's dismiss-to-replay path (and the same passive dead-session replay for ordinary panes).
anutron
force-pushed
the
argus/build-a-ux-fix-for-closed-out
branch
from
August 23, 2026 04:30
7bd2116 to
10c3e58
Compare
A finished Claude Code session's on-disk log ends with CSI ?1049l (alt-screen exit) followed by its own "Resume this session with: claude --resume <uuid>" hint printed to the restored main buffer. Feeding the full log through the replay emulator faithfully reconstructs that hint as the terminal's true final state, which buries the actual conversation the instant alt-screen tears down — correct emulation, but a much less useful "last known output" view than intended. truncateAtFinalAltScreenExit trims the replay's byte window to end just before the last alt-screen-exit sequence, so asyncReplayRebuild never processes the teardown or the post-exit hint. Gated by a new finalFrame parameter (true from EagerReplayBuild, !alive from Draw's cache-miss kick) so a live session's real-time scrollback — where a mid-session alt-screen toggle is genuine content, not a teardown to hide — is never truncated.
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
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
heraReattach's existing close-out refusal (dead-session worker/freelance task) now toggles a persistent, in-paneTerminalPanebanner instead of only a 15s-TTL footer notice. First Enter arms the banner; a second, immediately-following Enter dismisses it and falls through to the pane's own existing dead-session rendering (replay content, or the placeholder) — no new PTY, process, or emulator is spawned for either press. Further Enters keep toggling.TerminalPane(closedOutBannerShown), reset byResetVT()— already called on every hera pane rebind — so leaving and returning to the same closed-out row shows the banner again on the next Enter.Enterpress.Spec
add-hera-closeout-bannercreated, implemented against, and archived in this PR (openspec/specs/hera-coordination/spec.md's "Enter refuses to restart a dead-session worker awaiting close-out" requirement updated + new scenarios).Gotchas documented
context/knowledge/gotchas/hera-view.md— newadd-hera-closeout-bannersection: why both Enter presses reach the identicalheraReattachcall, why the toggle state lives on the pane not the App, why dismissal needs no new rendering path, and why there's no third state (a third press just re-arms the banner).Test plan
internal/tui/terminal: table/unit tests forShowClosedOutBanner/DismissClosedOutBanner/ClosedOutBannerShown,ResetVTclearing the flag, andDraw()priority over both the placeholder and replay content, plus a defensive "never over a live session" case.internal/tui: SimulationScreen smoke tests — first/second/third Enter toggle behavior with status-bar message assertions, and a leave-and-return test proving the banner resets per visit.make pre-prrun clean: build, vet, fmt-check, lint-pr (0 issues) all pass.vulnfails only on pre-existing Go-stdlib-only CVEs (toolchain,continue-on-errorin CI, unrelated to this diff).test-cover-gatepasses at 88.7% (run with this sandbox's ownARGUS_TASK_ID/ARGUS_ARCHETYPE/ARGUS_MODELenv vars scrubbed — otherwise they leak into two unrelatedinternal/agentprofile-env subprocess tests, a known pre-existing sandbox-only false failure, confirmed reproducing identically with this diff absent).internal/tui/terminal96.2%, all new code paths 100%.🤖 Generated with Claude Code