From 6f5b4c3dc1a4425c2e317f7ada174d710f00062b Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 15 Aug 2026 23:35:54 -0500 Subject: [PATCH] fix(fleet): restore ConditionPathExists dropped by my own red-check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Self-inflicted and worth recording rather than quietly amending. To prove the new tests were red without the fix I ran `git checkout origin/next -- `. That writes the *index*, not just the working tree. Copying my versions back afterwards restored the working tree only, so the unit file sat staged-as-origin/next and modified-in-tree, and the next commit (67f5014c) committed the index — silently removing the ConditionPathExists line that 463745e3 had added. Nothing caught it. The spec reads the file from the working tree, so it stayed 10/10 green against a HEAD that no longer had the guard. Found by reading `git status` after the push, not by any gate. Verified by content, not by assumption: origin/next 0 occurrences 463745e3 1 67f5014c 0 <- the regression this commit 1 Refs #1237 --- .../mosaic/framework/systemd/user/mosaic-agent@.service | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/mosaic/framework/systemd/user/mosaic-agent@.service b/packages/mosaic/framework/systemd/user/mosaic-agent@.service index f4d4a985..81f76b54 100644 --- a/packages/mosaic/framework/systemd/user/mosaic-agent@.service +++ b/packages/mosaic/framework/systemd/user/mosaic-agent@.service @@ -4,6 +4,14 @@ Documentation=https://git.mosaicstack.dev/mosaicstack/stack Requires=mosaic-tmux-holder.service After=mosaic-tmux-holder.service PartOf=mosaic-tmux-holder.service +# Do not attempt a seat before its generated env exists. `install` enables this +# unit (WantedBy=default.target) but on a roster-v2 fleet the reconciler owns the +# generated env, so between `install` and the first `apply`/`regen --write` there +# is a boot window where ExecStart would run against an absent env file and the +# launcher would fail the unit. A skipped unit is the honest state for "enabled +# but not yet configured"; systemd re-evaluates the condition on every start, so +# the seat comes up on the next start once the reconciler has written env. +ConditionPathExists=%h/.config/mosaic/fleet/agents/%i.env.generated [Service] Type=oneshot