Repository navigation
Show in the desktop app when the daemon has a restart queued - #831
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
PR Summary by QodoShow queued daemon restarts in the desktop app
AI Description
Diagram
High-Level Assessment
Files changed (9)
|
Code Review by Qodo
1.
|
| }); | ||
| } | ||
|
|
||
| // ---- daemon restart pending (the daemon's own queued restart-after-update) ---- |
There was a problem hiding this comment.
1. Two test headings repeat test names 📘 Rule violation ⚙ Maintainability
MainWindowViewModelTests and TrayViewModelTests add identical section-banner comments that merely restate the subject of the immediately following restart-pending tests. Because the test names already describe that behavior, the banners record no non-obvious constraint or rationale and add decoration a later maintainer must keep aligned.
Agent Prompt
## Issue description
Remove the decorative restart-pending section comments because the adjacent test names already communicate their subject.
## Issue Context
The comments document no non-obvious constraint, invariant, trade-off, or rationale and are duplicated across two test files.
## Fix Focus Areas
- test/Capacitor.App.Tests.Unit/MainWindowViewModelTests.cs[66-66]
- test/Capacitor.App.Tests.Unit/TrayViewModelTests.cs[42-42]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5ff877782
ℹ️ 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".
| var pendingWhileConnected = status | ||
| .CombineLatest(restartPending ?? Observable.Return(false), (st, pending) => pending && st.State == AttachState.Connected) | ||
| .DistinctUntilChanged(); |
There was a problem hiding this comment.
Marshal restart-pending updates to the UI scheduler
When the marker changes during the 15-second poll, DaemonRestartPendingWatcher.PollAsync publishes from a thread-pool continuation, and CombineLatest consequently updates both bound OAPH properties on that background thread. Unlike the existing status source, restartPending is not passed through ObserveOn(RxSchedulers.MainThreadScheduler), so detecting or clearing an update while the window is active can raise Avalonia-bound property changes off the UI thread. Marshal this stream before creating pendingWhileConnected.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 016cf40: the restart-pending stream is observed on RxSchedulers.MainThreadScheduler before the CombineLatest, the same way status and snapshots are. The tray's pipeline already marshalled its final model, so only the main window needed it.
The marker file is the only signal: nothing about a queued restart travels over the status socket. No forced restart, it would take the running agents down. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The marker read moves under the lock so two callers cannot publish their observations in the reverse order of their reads. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
c5ff877 to
016cf40
Compare
Closes #830 — AI-2604
What & why
A busy daemon keeps running the old binary after a CLI update until it is idle, and the app showed nothing about it. The session rail's daemon indicator and the tray header now carry "update pending" while the daemon's restart-pending marker exists and the app is attached to that daemon; the rail tooltip says the restart happens once no agents are running. Passive only: no button and no forced restart, which would take the running agents down.
Where to look
DaemonRestartPendingWatcherreads the marker file the daemon writes and its successor deletes, the same filekcap daemon statusreads, on every attach transition and on a 15-second poll matching the daemon's own binary poll. Both view models gate the indicator on being attached, so a marker left by an unreachable daemon shows nothing.Verification
Capacitor.App.Tests.Unit: 1616 passed, 0 failed. The eight new tests cover the marker present at start, written later and seen on the poll, cleared on an attach transition, no repeat emissions, and both surfaces showing and hiding the indicator with attach state.