Skip to content

fix: pre-emptive aoe rm --purge to prevent stale cmd-override on re-dispatch#5

Merged
jakecelentano merged 3 commits into
mainfrom
fix/4-purge-before-add
Jul 16, 2026
Merged

fix: pre-emptive aoe rm --purge to prevent stale cmd-override on re-dispatch#5
jakecelentano merged 3 commits into
mainfrom
fix/4-purge-before-add

Conversation

@jakecelentano

Copy link
Copy Markdown
Contributor

Summary

Closes bogocat/tmq#4. The prior commit edaaf47 fixed the spawned argv bugs (#1 empty-arg wt_flag and #2 missing --approve). This adds the third fix: a best-effort aoe rm --purge before aoe add so re-dispatching always picks up the new cmd-override.

What changed

  • src/tmq/spawn.py (~14 lines): In _spawn_via_aoe, run aoe rm --purge <session_name> with check=False before aoe add. If the session does not exist, aoe rm exits non-zero — we catch the SpawnError and carry on. The subsequent aoe add will surface any real error.
  • tests/test_spawn.py (+30 lines): New test test_spawn_via_aoe_purges_before_add that captures the full _run call sequence and asserts aoe rm --purge fires before aoe add. New helper _captured_aoe_call_sequence for sequence-ordered assertions.

Out of scope

  • Aoe --trust-hooks semantics (closed Rust binary)
  • Pi --approve behavior (upstream)
  • Dist-packages copy — auto-managed by pip install
  • Manual end-to-end AC verification — no test harness for live aoe/tmux spawns yet

Review

Single-reviewer scan — net change is ~14 lines of production code with a targeted unit test.

Test plan

python3 -m pytest tests/test_spawn.py -v   # 10/10 pass

Verification

  • All 10 tests pass (9 existing + 1 new)
  • LSP clean on both files
  • AC4 (no regressions): tmq distillery 558 --agent pi --type feature still works — run manually after merge

Follow-ups

  • This repo tracks at bogocat/tower-fleet#202
  • Dist-packages sync lands on next pip install --upgrade bogocat-tmq

…rride

aoe rm (without --purge) leaves the session record with a stale
command: field, so aoe add for the same title re-registers silently
with the OLD command. Now we purge first, best-effort — if the session
doesn't exist, aoe rm exits non-zero and we carry on.

Closes: #4
setup-uv v8 dropped moving tags (@v8 doesn't exist). Pin to the
specific commit hash for v8.3.2 as recommended by upstream docs.
mypy was failing on  in events.py because the stub
package wasn't installed. Pre-existing issue, previously hidden by the
setup-uv@v8 CI config bug.
@jakecelentano
jakecelentano merged commit 54ec76d into main Jul 16, 2026
3 checks passed
@jakecelentano
jakecelentano deleted the fix/4-purge-before-add branch July 16, 2026 16:06
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