fix(desktop): dismiss stale prompt overlays - #59778
Conversation
d41e181 to
beafc55
Compare
OutThisLife
left a comment
There was a problem hiding this comment.
Approve. Clean, correctly-scoped desktop (Electron) fix — a different renderer from the Ink TUI work in #61885, so both are needed.
When sudo.respond / secret.respond races a backend timeout/completion and comes back "no pending … request", the dialog now clears the local overlay instead of toasting an error and leaving a stuck box; other failures still keep the dialog open and surface the error. isMissingPendingPromptRequest is a tidy, testable helper.
Degrades gracefully alongside #61885: once the server returns {status: expired} (success) for late secret/sudo responds, this catch simply stops firing and the existing success path clears the overlay — no conflict, no double-handling. Merges clean, tests included. Thanks @frizikk.
Sync PR #37 pulled PR NousResearch#59778 (desktop: dismiss stale prompt overlays) by frizikk and PR NousResearch#63080 (desktop: structured Fallback Models editor, salvaging MarkVLK's work from NousResearch#47522), whose commit emails weren't yet mapped. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ialog-dismiss-59765 fix(desktop): dismiss stale prompt overlays
…ialog-dismiss-59765 fix(desktop): dismiss stale prompt overlays
…ialog-dismiss-59765 fix(desktop): dismiss stale prompt overlays
…ialog-dismiss-59765 fix(desktop): dismiss stale prompt overlays
What does this PR do?
Fixes #59765.
Hermes Desktop can show sudo/admin or secret prompt overlays whose backend-side pending request has already timed out or completed. Before this change, responding/cancelling after that race produced a
no pending ... requestgateway error, showed an error toast, and left the local overlay store populated, so the dialog stayed stuck on screen.This PR treats that specific stale-prompt gateway response as an already-resolved prompt: clear the local overlay state and do not show a failure toast for the stale response. Other gateway failures still keep the dialog open and surface the existing error notification.
Related Issue
Fixes #59765
Type of Change
Changes Made
apps/desktop/src/components/prompt-overlays.tsxsudo.respondreturnsno pending password request.secret.respondreturnsno pending value request.apps/desktop/src/lib/gateway-rpc.tsisMissingPendingPromptRequest(...)for detecting stale prompt-response errors from the JSON-RPC gateway.apps/desktop/src/components/prompt-overlays.test.tsxapps/desktop/src/lib/gateway-rpc.test.tsHow to Test
Cancel/close on the Desktop dialog.no pending password requestfailure toast is shown.origin/main:Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qis N/A here)Documentation & Housekeeping
docs/, docstrings) — N/A, behavior is covered by tests and inline helper commentcli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AFor New Skills
N/A — this PR does not add a skill.
Screenshots / Logs
Local verification results after rebasing onto latest
origin/main:2 passed,6 tests passed.tsc -p . --noEmitpassed.assert-dist-builtconfirmeddist/index.html + assets present.git diff --check HEAD: passed.