Repository navigation
feat(terminal): persistent banner to restart a terminal daemon whose files are gone - #28021
Conversation
…files are gone Co-Authored-By: Claude <[email protected]>
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to The new banner can restart a different terminal daemon than the one the user confirmed, ending running shells and jobs without a matching warning. Status refreshes can also briefly hide the banner. Bind the confirmation to the daemon identity shown when the dialog opened before merging. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9093f4fb-7ee2-4659-a67b-b794aaad7a52
📒 Files selected for processing (10)
src/main/ipc/pty-management.tssrc/preload/api-types.tssrc/preload/api/pty-bridge-stream-and-serialization.tssrc/preload/api/pty-management-api.tssrc/renderer/src/components/sidebar/SeveredTerminalDaemonBanner.test.tsxsrc/renderer/src/components/sidebar/SeveredTerminalDaemonBanner.tsxsrc/renderer/src/components/sidebar/index.tsxsrc/renderer/src/i18n/en-runtime-required.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/web/preload-api/web-terminal-api.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| return | ||
| } | ||
| try { | ||
| setDaemon((await read()).severed) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Ignore status results from older refreshes.
A focus refresh can finish after a later poll or post-restart refresh. Line 75 then replaces the newer status with an older daemon or null. A stale null can hide the warning until the next poll. Track a request sequence and apply only the latest result. Based on learnings, concurrent async refreshes must not apply out-of-order results.
Source: Learnings
| const result = await window.api.pty.management.restartSeveredDaemon({ | ||
| pid: daemon.pid, | ||
| linuxStartTicks: daemon.linuxStartTicks, | ||
| bootId: daemon.bootId | ||
| }) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Require a new confirmation if the daemon incarnation changes.
If a status refresh replaces daemon while the dialog is open, restart sends the new incarnation. The user confirmed the warning for the previous daemon, but the new request can end processes in another incarnation. Capture the confirmed identity when the dialog opens, and close the dialog or require confirmation again when that identity changes.
| "resumed_other": "{{count}} agent sessions resumed." | ||
| }, | ||
| "severedDaemonBanner": { | ||
| "unknownCount": "its running terminals", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Correct the unknown-count wording.
When liveSessionCount is null, the banner says, “It still runs its running terminals.” The confirmation also uses that phrase. Change unknownCount to “its terminals” so both sentences read clearly.
|
Small thing in the new banner: with exactly one live terminal it reads "It still runs 1 running terminals", and the confirm dialog says "Restarting ends every process running in 1 running terminals".
Happy to send that as a PR if it helps. |
ELI5
#28011 taught Orca to recognise a Linux AppImage terminal daemon that keeps running after its program files have disappeared. Orca keeps that daemon so your running terminals stay alive, and opens new terminals elsewhere. Until now the only place this showed up was a CLI command. This PR adds a banner to the desktop sidebar. It explains what is happening and offers Restart terminal daemon. The banner stays until you restart the daemon or dismiss it.
What Changed
orca terminal-daemon restart.pty:management:severedDaemon, a new IPC that wraps the state from fix(daemon): stop giving new terminals to a daemon whose AppImage files are gone #28011./proc. Headless and paired users haveorca terminal-daemon status|restart.Why
Linked Issue
Part of #18200.
Visual Proof
No screenshot: this work had to run without launching Electron, so the banner was not rendered in a real window. The component test renders it in happy-dom and checks the copy, the confirmation, the incarnation that is sent, and the dismissal. It uses the existing sidebar alert styling of
LocalGitToolchainScanBanner: the destructive border,TriangleAlert, andButtonprimitives.Testing
SeveredTerminalDaemonBanner.test.tsx:pnpm tc,pnpm lint(including the localization catalogs), andpnpm run check:code-quality:changed.Checklist
pnpm lint,pnpm typecheckpass locally; CI covers the rest