Skip to content

fix(desktop): replay pending approvals after reconnect - #82087

Open
konsisumer wants to merge 1 commit into
NousResearch:mainfrom
konsisumer:fix/desktop-replay-pending-approvals
Open

fix(desktop): replay pending approvals after reconnect#82087
konsisumer wants to merge 1 commit into
NousResearch:mainfrom
konsisumer:fix/desktop-replay-pending-approvals

Conversation

@konsisumer

Copy link
Copy Markdown
Contributor

What changed and why

Per the reporter's clarification on 2026-08-05, a Desktop approval can remain queued after its original WebSocket delivery is lost. session.resume and session.activate now return the oldest unresolved approval using the existing session-scoped approval queue. Desktop restores that prompt only after its runtime session is bound, so the existing approval controls can respond normally without re-running the tool or extending the timeout.

Addressing maintainer feedback

How to test

  • Start a Desktop session that reaches a dangerous-command approval.
  • Disconnect and reconnect the Desktop gateway, then resume the same session.
  • Confirm the original approval controls return and approving or denying resolves the original blocked operation once.
  • Automated: pytest tests/tui_gateway/test_protocol.py -q -x --timeout=60 (43 passed).
  • Automated: pytest tests/tools/test_approval.py::TestApprovalTimeoutIsNotConsent -q -x --timeout=60 (4 passed).
  • The required full-suite command was attempted but stops at the unrelated existing tests/tools/test_approval.py::TestDetectDangerousRm::test_nonrecursive_verification_artifact_cleanup_is_not_dangerous assertion.

What platforms tested on

  • Platform-independent Python gateway protocol tests.
  • Desktop TypeScript typecheck was not run because apps/desktop/node_modules is unavailable in this worker environment; no manual Desktop run was performed.

Refs #53839

@alt-glitch alt-glitch added type/bug Something isn't working comp/desktop Electron desktop app (apps/desktop/*) comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants