Repository navigation
Add background desktop notifications - #1055
Conversation
Permission actions follow current request capabilities and live handles across local and server handovers.
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 QodoAdd actionable background desktop notifications
AI Description
Diagram
High-Level Assessment
Files changed (38)
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae2df69e42
ℹ️ 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".
| if (pending is null) return null; | ||
| var options = request.Options ?? []; | ||
| return pending with { | ||
| SupportsAllowOnce = PickAllow(options, preferAlways: false) is not null, |
There was a problem hiding this comment.
Withhold Allow for ambiguous local ACP options
When a local ACP request supplies two allow_once options, PickAllow returns the first and this advertises SupportsAllowOnce = true; the notification then exposes a generic Allow button, and MapSettlement silently selects that same first option even though the user never chose between them. The ACP parser permits repeated kinds, and AcpInteractionBridge.TrySelectLeastPrivilegeAllow explicitly treats multiple once-scoped options as ambiguous, so this capability should be false unless exactly one addressable once option exists.
Useful? React with 👍 / 👎.
| static string? OptionFor(PendingPermissionRequest request, string action) { | ||
| var kind = action switch { "allow" => "allow_once", "always" => "allow_always", "decline" => "reject_once", _ => null }; | ||
| if (action == "always" && request.Options?.Count(o => o.Kind == kind) != 1) return null; | ||
| return kind is null ? null : request.Options?.FirstOrDefault(o => o.Kind == kind)?.OptionId; |
There was a problem hiding this comment.
Require an unambiguous server ACP option
For a server ACP request with multiple allow_once or reject_once options, this picks the first option and presents a generic Allow or Decline action, silently making a choice the user was never shown. Duplicate or blank option IDs are also not rejected here, even though the protocol deserializer permits them and the daemon's AcpInteractionBridge treats such choices as non-addressable; only expose a notification action when its kind resolves to exactly one uniquely addressable option, otherwise direct the user to the app.
Useful? React with 👍 / 👎.
| .OrderBy(r => r.Origin).FirstOrDefault(); | ||
| } | ||
|
|
||
| bool HasPending(AgentRow row) => _pending.Any(p => RowFor(p)?.Key == row.Key); |
There was a problem hiding this comment.
Count stale pending requests before idle alerts
During a hub reconnect, RowFor returns null for every server-lane request unless allowStale is set, so HasPending can report false even when the retained permission notification still maps to this local row on the app's server. If that row transitions from working to awaiting input while _remoteStale is true, the coordinator consequently emits an additional misleading idle notification beside the existing permission alert; pending suppression should use the same stale-tolerant mapping used to retain actionable notices.
Useful? React with 👍 / 👎.
Closes #1047 — AI-2997
What & why
Notify users when an agent needs permission, asks a question, or becomes idle while Capacitor is in the background. Notifications offer supported permission actions or open the agent; three settings switches control each category independently.
Where to look
The coordinator deduplicates local/server requests, survives reconnects, and validates live requests before answering. Remote subscriptions stay active with the window hidden; remote idle is not inferred.
Verification
dotnet rundesktop unit project: 2,636 passed with en_US.UTF-8; affected daemon suite: 62 passed; IPC suite: 27 passed.