Repository navigation
Show what a desktop alert is about and answer an approval from it - #377
Conversation
Add an optional host-authoritative LockScreenDecisions pair to Ask and AskView, with an omitted-on-None wire field. The host sets it only for a questionless stock Claude tool request or a Codex Command/Files request whose machine decisions are exactly one literal accept and one literal decline. Projection and the paired replica reject anything other than exactly two distinct in-bounds decisions with no questions, so a third choice cannot inherit the pair. UX, push payloads and action dispatch are unchanged.
"Turn failed" came from the transcript's sticky error banner, so a turn that completed or was stopped while an unrelated request or an older turn left an error still raised a failure alert. Decide from the outcome recorded for the finished turn instead. A child thread's failed turn is delivered to its parent agent as a tool result, and a worker that reports to a parent agent likewise hands its result to the agent. Neither raises a failure alert now; the parent's own turn outcome is what the operator hears about. Host-raised synthetic worker notices are unchanged, and whether such threads raise Finished is unchanged. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Desktop alerts named only the host and the event, so an approval or a finished turn said nothing about what it concerned. The host now fills an additive, bounded `detail` on each notification change: the approval's title and command or first line, the question's text, the turn's error, or the end of the last assistant message. The desktop shows it under the thread title only when "Include request and result details" is on. That is off by default, like thread titles, because these texts can carry commands and replies onto a lock screen. Phone push payloads never carry the detail. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Saved settings were read with an unwrap_or_default: a notifications file that existed but did not parse silently became the defaults, and the next toggle overwrote what the user had written. A missing file now means the defaults; an existing file that cannot be read or parsed is renamed to notifications.json.invalid first, so its content survives. Adds the persisted `actions` flag (off by default) that the next change uses. Tests cover every combination of the nine saved flags through a real write and load, files written before the newer keys, a missing file and an invalid one. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
An approval alert could only open the conversation, so allowing a simple command meant opening a window and finding the request. When the host proves an exact allow-once and deny pair for a sole pending approval, the alert now offers "Allow once" and "Deny" (opt-in, under "Allow once or deny from the notification", off by default). A button sends the existing answer through a connection of its own, with the approval token the host issued, and closes the alert. A missing pairing, an offline host or a refused answer opens the conversation exactly as a plain click does. Each alert takes its approval once, so a second click answers nothing. Approval and question alerts no longer expire on Linux, so the buttons stay until used. Non-Linux buttons go through gpui's system notification actions; they are not verified on macOS from this machine. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Both switches are off by default because their text can reach a lock screen; the guide now says what each one shows and when buttons appear. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
An answer sent from a notification waited on the host with no read timeout, so a host that stopped replying would have held the alert open with nothing happening. The exchange now gives up after 30 seconds, and the caller opens the conversation as it does for any failed answer. The exchange is split from the connection so a fake host can prove it: one subscribe, one answer carrying the host's token and the exact decision index, and only the reply to its own request ends it. An alert with details on but nothing to say no longer adds an empty line to its body. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
# Conflicts: # desktop/ox-desk-core/src/store/projection.rs
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)ℹ️ 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82aa10d94d
ℹ️ 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".
|
Coordination with #371: this PR adds |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 82aa10d94d
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
…to its request The buttons never appeared in production: the desktop looked for the approval's ask in the same catalog delta, but the host filters asks out of the catalog stream, so the lookup always found nothing. The tests had used a synthetic delta that included the asks, so they passed. A notification now carries the approval it is about as an additive `approval` reference: the request id and the host-validated allow-once and deny indices, with no token. The desktop reads the delta's notification directly. Each approval alert has a tag that includes its request id, so a second request on the same thread no longer replaces the first alert's answer. A new approval closes the thread's earlier approval alerts, and a `Waiting` event closes the approval alerts of threads the host no longer reports as waiting. A button press now subscribes, reads the host's snapshot, and answers the exact request id and thread with that request's token and the index from the host's own validated pair. Nothing is sent when the snapshot does not hold that request with a pair, and the conversation opens instead, as before. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
…-actions # Conflicts: # desktop/ox-desk-core/src/store/projection.rs
|
Re the #371 coordination request: ce84195 adds |
|
/queue ce84195 |
|
In line to merge. Commit f54102e is reviewed with nothing blocking; it has entered the merge queue. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce84195726
ℹ️ 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".
An approval alert named only the request id, and its "Allow once" was sent with whatever token the host then held for that id. A runtime can resolve a request and ask again under the same id on the same thread. The host mints a fresh token for that ask, but no new notification is sent because the id did not change, so the old alert's button would have approved the replacement. The host now sends, with each approval alert, the opaque reference of the token it minted for that ask generation, derived by ox_host_web::approval_ref::ask_ref, the same derivation the push path uses. An alert whose ask, thread or token cannot be found goes out without buttons. The desktop shows buttons only for a reference it can validate, tags alerts by their reference, and sends an answer only when the live ask's token produces the alert's reference. Otherwise it sends nothing and reports that the approval is no longer waiting. The reference field is additive and defaults to empty, so an older host's alerts still parse and show no buttons. The generated contract is regenerated to match. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
|
/queue a55e421 |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Main now carries the terminal-only failed alert (#374). Keep this branch's version of the finished and failed alert, which adds the detail line to the same decision. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
|
/queue f54102e |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Main now carries the alert details and approval actions (#377). Keep the approval reference bound before any alert is held, and regenerate the protocol contract. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
A desktop alert said only " · Approval needed" and, with titles on, the thread title. This adds what the alert is about, lets an approval be answered from the notification, and makes saved alert settings come back exactly.
What changes
More in the alert.
Change::Notificationgains an optionaldetailline (additive; older clients ignore it, older hosts omit it). The host fills it with:It is one line, at most 240 characters, with control characters removed. The desktop shows it under the thread title only when the new Include request and result details switch is on. The switch is off by default, like Include thread titles. Phone push payloads are unchanged and do not carry the detail.
Allow once / Deny on the notification. With the new Allow once or deny from the notification switch on (off by default, like the phone's opt-in in #367), an approval alert offers the two buttons when the host proved the exact pair (
lock_screenfrom #344). The notification carries an optionalapprovalreference: the request id and the pair, never the token. Each request gets its own alert; a newer approval on the thread, or the host no longer reporting the thread as waiting, closes the older one. On a click the desktop subscribes through the pairing the alert came from, finds that exact request on that thread in the host's snapshot, and sends the snapshot's token and the index from the snapshot's validated pair, without opening the window. Each alert answers at most once. If the request is gone, the host is unpaired, the switch was turned off, or the answer fails or gets no reply in 30 seconds, nothing is approved and the conversation opens instead. Approval and question alerts no longer expire after ten seconds on Linux.Saved settings. Every switch survives a save and a restart for every combination of values. A settings file that exists but cannot be parsed is renamed to
notifications.json.invalidbefore defaults are used; before, it silently became defaults and the next save overwrote it.Verification
cargo fmt --check,cargo clippy -p ox-desk-core -p ox-host -p ox-host-web -p ox-desktop --all-targets -- -D warnings, andox-host-protocol --checkon the generated contract, on Linux x86_64 with Rust 1.100.0.ox-desk-core(two process tests pass only outside the local sandbox),ox-desktop(174 passed),ox-host-web --features server,client --lib(204 passed, including the untouched push privacy tests). These full runs were beforemainwas merged in; after the merge the notification, projection, catalog and protocol tests and clippy were re-run.Not verified
answer_askfrom a fresh subscribed connection is the existing path the replica uses.SystemNotificationActionandresponse.action_idasgpui0.3.12 declares them; it was not built or run on macOS here, and whether macOS renders the buttons is unknown.ox-hosttests were not run locally; only its clippy.Checked against
mainat7f33f06. The branch has #374 merged in, because both change the lines that pick Failed or Finished; until #374 lands, this diff also shows its changes.🤖 Generated with Claude Code