From bea7d7333228c52103e8cfb019d3e171ded7e571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davor=20Raci=C4=87?= Date: Wed, 14 Oct 2026 06:24:50 +0200 Subject: [PATCH 01/11] fix(cleanup): say when a displaced registry is another project's derived root A displaced PSMUX_DATA_DIR shaped like a root bmad-loop derived for another project path (or for this project before a rename) holds sessions whose owner cannot be proven from here: the tag hashes a path and run ids are caller-supplied. Report its sessions in full as before, but name the registry for what it is instead of calling them "not migrated", in the cleanup stderr line, the TUI toast and the displaced-root note. The --json document is unchanged. Closes #906 --- CHANGELOG.md | 5 +++ docs/multiplexer-backends.md | 15 ++++++++- src/bmad_loop/cli.py | 32 +++++++++++++++--- src/bmad_loop/runs.py | 37 +++++++++++++++++++++ src/bmad_loop/tui/app.py | 9 ++++++ tests/test_cli.py | 62 +++++++++++++++++++++++++++++++++++ tests/test_runs.py | 63 ++++++++++++++++++++++++++++++++++++ tests/test_tui_app.py | 38 ++++++++++++++++++++++ 8 files changed, 255 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e16144f..64ba3ce3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -88,6 +88,11 @@ breaking changes may land in a minor release. - Refuse psmux option values shaped `-X=value`, `-t…` or `--`: psmux 3.4.0 rewrites the first silently and rejects the others, so the value is now warned about and its key freed (#905). +- Stop `cleanup` and the TUI from calling the sessions in a displaced registry `not migrated` + when it is another project's derived `PSMUX_DATA_DIR` (or this project's from before a + rename): name it as such and say its control session and untagged sessions most likely + belong to that project, while a session tagged as this project's is yours; the stderr + note names it too (#906). - Fire the TUI's stale state-root note on psmux too: the psmux backend now answers which value a new pane inherits through psmux 3.4.0's named `show-environment` (#660). - Fix the OpenCode V2 SSE-reconnect end-to-end test failing on slow runners (Windows): the diff --git a/docs/multiplexer-backends.md b/docs/multiplexer-backends.md index 71b317be..993e613f 100644 --- a/docs/multiplexer-backends.md +++ b/docs/multiplexer-backends.md @@ -202,9 +202,11 @@ repeats the warning. A server already running with it on is not detected. Unset before the per-project root: psmux's default registry, and any `PSMUX_DATA_DIR` root bmad-loop displaced. It kills only sessions that carry this project's ownership tag and whose run is not still going. Whatever it leaves is named on stderr as -`left in (not migrated): …` and in `cleanup --json` at +`left in (