fix(issue-17): follow-ups - a failed decision ends the wrapper with 1; resume closes herdr 0.9.3's placeholder (v4.8.7) #52

Merged
Godopu merged 9 commits from fix/issue17-followups into main 2026-10-08 02:32:57 +00:00
2 changed files with 8 additions and 4 deletions
Showing only changes of commit 25c99704f2 - Show all commits

No files matched your search

+4 -2
View File
@@ -1,8 +1,10 @@
"""Issue #45 (B): close the restored empty shells of the session being resumed.
With restore-on-restart off (lib_py/herdr_config.py) a restarted MAM server
still brings every saved pane back - as an empty shell in its old cwd, or in
$HOME when that directory is gone. A pane keeps the `agent_session` its agent
still brings every saved pane back - as an empty shell in its old cwd. When
that directory is gone, herdr 0.9.1 opens the shell in $HOME and herdr 0.9.3
keeps the old path; nothing below looks at the cwd. A pane keeps the
`agent_session` its agent
reported before the server died. resume_session.sh calls this once, right
before it spawns, with the id it is about to resume; a pane is closed only when
all of these hold:
+4 -2
View File
@@ -264,7 +264,7 @@ def test_b_only_the_resumed_sessions_restored_shell_is_closed(rig):
rig.run_agent(rig.new_pane(rig.root / f"ws{k}", k), ids[k])
rig.new_pane(rig.root / "wsU", "U") # a user's plain shell: no agent_session
rig.crash(*ids.values())
shutil.rmtree(rig.root / "wsY") # a removed worktree: restored into $HOME
shutil.rmtree(rig.root / "wsY") # a removed worktree: still restored (cwd below)
before = rig.restores()
rig.start_via_shim()
@@ -272,7 +272,9 @@ def test_b_only_the_resumed_sessions_restored_shell_is_closed(rig):
rig.run_agent(_pane_with(rig, ids["Z"])["pane_id"], ids["Z"]) # running again
rig.hd("pane", "run", _pane_with(rig, ids["X2"])["pane_id"], "sleep 60") # busy shell
time.sleep(1)
assert _pane_with(rig, ids["Y"])["cwd"] == str(rig.root)
# Y's directory is gone: herdr 0.9.1 restores the pane into $HOME (rig.root),
# 0.9.3 keeps the old path. Closing does not look at the cwd either way.
assert _pane_with(rig, ids["Y"])["cwd"] in (str(rig.root), str(rig.root / "wsY"))
n = len(rig.panes())
for k in ("Z", "X2"):