Repository navigation
Add a per-host running terminal limit setting - #31396
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Priority: Merge Risk:
|
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:
f598061f-0550-4091-b00b-cd2bb86226a1
⛔ Files ignored due to path filters: 1
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing: 39
src/main/daemon/daemon-automatic-work-guard.tssrc/main/daemon/daemon-automatic-work-resume.tssrc/main/daemon/daemon-control-request.tssrc/main/daemon/daemon-pty-adapter.tssrc/main/daemon/daemon-request-deadline.tssrc/main/daemon/daemon-server-options.tssrc/main/daemon/daemon-server.tssrc/main/daemon/daemon-terminal-limit-protocol.tssrc/main/daemon/daemon-terminal-limit.test.tssrc/main/daemon/host-terminal-ledger.tssrc/main/daemon/host-terminal-policy.test.tssrc/main/daemon/host-terminal-policy.tssrc/main/daemon/system-pty-limit.tssrc/main/daemon/terminal-spawn-admission-mode.tssrc/main/daemon/terminal-spawn-gate.tssrc/main/daemon/terminal-spawn-host-share.tssrc/main/ipc/pty/runtime/controller.tssrc/main/runtime/orca-runtime-get-status.tssrc/main/runtime/orca-runtime-pty-controller.tssrc/main/runtime/rpc/methods/terminal-daemon.tssrc/main/runtime/runtime-pty-controller-contract.tssrc/main/window/owned-temp-staging-root.tssrc/renderer/src/components/settings/TerminalAdvancedSection.tsxsrc/renderer/src/components/settings/TerminalLimitSetting.test.tsxsrc/renderer/src/components/settings/TerminalLimitSetting.tsxsrc/renderer/src/components/settings/TerminalPane.tsxsrc/renderer/src/components/settings/settings-interface-primary-section-renderers.tsxsrc/renderer/src/components/settings/terminal-advanced-platform-search.tssrc/renderer/src/components/settings/terminal-limit-transport.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/owned-private-directory.tssrc/shared/rpc-contract/terminal-limit-params.tssrc/shared/terminal-limit-policy.tssrc/shared/terminal-runtime-capabilities.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.
|
Orca previously limited each computer to 256 running terminals without a Settings control. This adds Settings → Terminal → Advanced → Maximum running terminals for the selected computer. The initial default is half of the known system limit, rounded up and capped at 4096, or 256 if unavailable. A saved value and The review corrected a silent fallback that could ignore a saved value when storage was slow or unreadable. Admissions now use the daemon’s effective in-memory value. Background reads apply validated results whenever they finish; actual failures retain the last good value and show a short explanation in Settings. An explicitly edited same-number value can repair the saved file. Untouched fields and canceled edits do not save. The Resume correction is separate in #35401. Verified: focused policy, real socket, terminal-gate, selected-host/old-server, renderer and existing-user settings tests. The three actual branch screenshots below passed. CI is green on Intended limits: propagation to another profile takes its next eligible background read plus storage latency. An already-open Settings field retains its last fetched value until its next normal fetch; it does not update live after a late read or another window’s save. This can differ from the daemon’s independently refreshed admission value. Startup waits only a bounded time; a pending read alone does not claim a storage failure. An already-issued filesystem replacement may finish after its request expires and physically replace a later save; the daemon reconciles the actual file without confirming the expired request. The review explicitly retained this physical-write ordering limit; no global latest-request-wins guarantee is claimed. For Brennan’s review Saved value: Unreadable saved file, retaining 384: After explicitly clearing/retyping 384 and Enter: Review spots: cache publication and health, explicit edit and repair, physical save completion. Screenshots ran on |
The Resume correction fixes a bug that already exists at the default limit, so it now lives in #35401 and this change only adds the terminal limit setting.
[Medium impact] The PR appears safe to merge, with the existing non-blocking issue that an open setting can show an outdated limit. SummaryAdds a running-terminal limit for the selected computer, including remote computers.
|



Orca’s default limit of 256 running terminals per computer was introduced in #27488. When Orca reaches that limit, users cannot start another terminal or terminal agent. This adds Settings → Terminal → Advanced → Maximum running terminals so they can see and change that limit for the selected computer, including a connected remote computer.
Older connected servers continue to work as before; editing the limit is unavailable until the server supports it.
Orca checks the system limit on the computer where the terminals run. For a remote connection, that means the remote computer. These checks only read the current limit; they do not use sudo or change it.
/usr/sbin/sysctl -n kern.tty.ptmx_max./proc/sys/kernel/pty/maxand/proc/self/mountsdirectly, without starting a command. The equivalent commands for inspecting those files arecat /proc/sys/kernel/pty/maxandcat /proc/self/mounts. If the/dev/ptsmount has its ownmax=limit, Orca uses the lower of that value and the system limit.The system value is total capacity shared with other terminal apps, not the number of terminals the user can still open or a separate per-user allowance.
The sleeping-conversation Resume correction is tracked in #35401 and is separate from this change.
Saved-limit reads happen in the background; terminal admission uses the effective value already in memory. Valid reads apply when they finish, including slow reads. If a saved file becomes unreadable or invalid, Orca keeps the last good value and Settings explains how to replace it. An explicitly edited value can repair the file, including re-entering the same number; untouched or canceled edits do not save. A pending read alone does not show a failure warning.
Validation: focused policy, daemon socket, admission, selected-host/older-server, renderer, existing-user settings and deterministic startup-error tests pass. The branch-only Settings run saved 384, corrupted only its disposable policy file, retained 384 with the explanation, and repaired the real file through the input. The app-language number-formatting regression also passes (11/11 renderer tests). CI is green on
d2b3387, including static analysis/typecheck, all ten unit shards, cross-version compatibility, packaging, persistence, SSH and the separate WSL checks. Review status.Intended limits: other profiles receive changes after their next eligible background read completes. An already-open Settings field keeps its last fetched value until its next normal fetch, even if a late read or another window changes the daemon’s effective value; it is not a live display. Already-issued filesystem replacements can complete after a save request expires; the daemon reconciles the actual saved file, without a global latest-request-wins promise.
Screenshots from the isolated branch copy
Saved 384; this computer’s system limit is 511:
Unreadable saved file; effective 384 remains editable:
Explicit same-number edit repaired the file and cleared the explanation: