Skip to content

fix(update): quiesce daemon before lifecycle lock - #501

Merged
ScriptedAlchemy merged 2 commits into
masterfrom
codex/fix-live-update-daemon-quiesce
Aug 4, 2026
Merged

fix(update): quiesce daemon before lifecycle lock#501
ScriptedAlchemy merged 2 commits into
masterfrom
codex/fix-live-update-daemon-quiesce

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • stop the managed daemon before update/upgrade acquires the exclusive profile lifecycle lease
  • carry the exact prior service state through the post-update re-exec so running/enabled state is restored
  • restore the service on lease acquisition failure, pre-launch failure, missing handoff token, upgrade failure, and no-op upgrade
  • reuse the same stop-before-lock authority for explicit daemon restart

Live v0.0.71 reproduction

With the managed daemon active, both tracedecay update and tracedecay upgrade failed before doing work:

cannot start update: daemon service install is already active; retry after it finishes

The daemon correctly held a shared lifecycle lease; the command incorrectly requested exclusive ownership before quiescing it. This also explains why earlier update runs could leave a previously-running service stopped: the original service state was not preserved across the hidden re-exec.

Verification

  • RED: new tests initially failed on the missing stop-before-lock and typed state handoff seams
  • 27/27 update_cmd tests pass
  • 36/36 CLI parse tests pass
  • 13/13 startup policy tests pass
  • cargo clippy -p tracedecay --bin tracedecay --all-features -- -D warnings
  • cargo fmt --all -- --check
  • git diff --check
  • live source-built tracedecay update against the preserved v0.0.71 profile stopped the daemon, refreshed every tracked integration including both Hermes profiles, advanced both version markers to 0.0.71, and restarted the service
  • live source-built no-op tracedecay upgrade --no-heal --no-reinstall stopped PID 2711807, reported GitHub v0.0.71 current, restored the service as PID 2884363, and exited successfully

No generated dashboard or binary artifacts are committed.

@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 41935f0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67d4224bf2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/update_cmd.rs
@ScriptedAlchemy
ScriptedAlchemy merged commit cfa22ae into master Aug 4, 2026
32 of 34 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the codex/fix-live-update-daemon-quiesce branch August 4, 2026 19:13
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