Repository navigation
Notify when something waits on you; wait for an unlock (KV_UNLOCK_WAIT=30s) - #89
Merged
Merged
Conversation
…nlock
- An agent call refused because the vault is locked is announced ("unlock
needed"): the first in a locked period at once, then at most every 10
minutes with a count.
- A request still unanswered halfway through its wait gets a reminder,
under the approval notices' cap.
- Requests that time out are told of together: a 10 s gather, then at most
one notice every 5 minutes.
- Handle requests and received shares go the same way.
- A new control command, notifying_status, needs no credential. It returns
the status and the notices the daemon holds for kv tray to post under
kv's own name, locked or not. While the tray asks, the daemon posts none
of these itself; if it stops asking for 5 s, the daemon posts what is
left. It does not keep a locked daemon running and is not audited.
- KV_UNLOCK_WAIT / --unlock-wait (default 30s, 0 or off to disable, at most
10m): a call refused because the vault is locked waits for an unlock
after its notice is posted or queued, then runs. On timeout it gets the
same vault_locked as before. At most 32 calls wait at once. Never with
KV_NOTIFY=off.
…en kv - On macOS, where kv.app posts notifications, the tray asks the daemon for notifying_status every second instead of the agent socket's status. It posts the notices it gets under kv's name instead of the daemon posting them as Finder. - "Unlock needed" has an Unlock button. It and a click do what the menu's Unlock does: Touch ID, or kv's window asking for the passphrase. The notification goes once the vault is unlocked anywhere. - Missed requests, handle requests and shares have Open kv, which opens the window on Audit, Handles or Shares. - A reminder brings the request's own notification back with its answers. - An older daemon that does not know the command is asked the old way.
…tons Documents the unlock-needed, still-waiting and requests-timed-out notices, the new 30 s default for KV_UNLOCK_WAIT and the MCP client timeout caveat, the buttons kv tray gives them on macOS, and that the daemon's own notifications show under Finder there. Adds an upgrade note for the new default.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…tions # Conflicts: # crates/kv/src/notify.rs
This was referenced Nov 23, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
kv now tells Leo when something is waiting on him, not only when a request first arrives. A call that finds the vault locked now waits for an unlock by default.
New default:
KV_UNLOCK_WAIT=30sAn agent's call that finds the vault locked now waits up to 30 seconds for an unlock instead of failing at once.
vault_lockederror as before.KV_UNLOCK_WAIT=0oroffturns it off. Any duration up to10mis accepted.kv daemon --unlock-waitdoes the same.KV_NOTIFY=off.MAX_UNLOCK_WAITERS, the same bound as requests waiting for approval); past that, calls fail at once. There was no connection limit on the agent socket to reuse, so this is a new one.Notices
askandallcover all of these, andoffnone. There are no newKV_NOTIFYvalues.vault_locked. Any tool except status, list_handles and request_handle.approval_waitapproval_timeoutRouting (no doubling)
notifying_status. It needs no credential and returns the status plus the notices the daemon holds for the client.notifying_overviewcheck.Item 3: handle requests and shares on macOS
Neither was suppressed when the tray was the notifier. They were always posted by the daemon through notify-rust, and a non-bundled process posts as com.apple.Finder on macOS. So they showed under "Finder" and were silenced whenever Finder notifications were off.
With kv tray running they now come from kv.app ("kv"), with Open kv. Without the tray they still come from Finder; the README says to check System Settings → Notifications → Finder.
kv tray (macOS)
Tests
tests/notices.rs(state): locked notice text and once-per-period throttle; status and list_handles excluded;KV_NOTIFY=off; unlock resets the period;notifying_statusneeds no credential, queues instead of posting, and is not audited; a stale outbox goes to the plain path exactly once; polling does not keep a locked daemon alive; reminder text and no reminder once answered; missed coalescing.daemon/notices.rsunit tests: 10-minute cap, counts, 32-notice outbox cap, 10 s gather and 5 min cap with nothing lost, tray text vs plain text.tests/unlock_wait.rs(live sockets): a call waits, its notice is queued first, and after unlocking it runs through approval to upstream; timeout →vault_lockedafter the wait; off orKV_NOTIFY=off→ immediate; 32 waiters + the 33rd fails at once; a live reminder arrives at half the wait.tests/tray_worker.rs: unlock notice → Unlock button → Touch ID session; notice withdrawn on an unlock elsewhere; handle request → Open kv → Handles; reminder re-post with answers, and answering it lets the call through.tray/notices.rsunit tests;KV_UNLOCK_WAITparsing.The kv.app button categories (
ui/notices.rs) are macOS-only and are checked by CI's macOS build and by hand.Release notes (draft for 1.9.4)
Changed
KV_UNLOCK_WAIT=off(thenkv stop) to keep the old behaviour, or any duration up to10m. Your MCP client's own tool timeout may be shorter.New
Fixed