Skip to content

feat(os-vitals): quit and force quit a process, with guards - #6

Merged
pblobp merged 7 commits into
mainfrom
feat/os-vitals-quit
Nov 17, 2026
Merged

pblobp merged 7 commits into
mainfrom
feat/os-vitals-quit

Conversation

@pblobp

@pblobp pblobp commented Nov 17, 2026

Copy link
Copy Markdown
Owner

What changed and why

The Processes view can now quit a process, behind a confirmation. Nothing is released by this change.

  • Worker: os-vitals.process.quit sends SIGTERM, or SIGKILL only when forced. Right before the signal it reads that one process again and requires the same start time, owner and name the panel asked for, so a reused PID is never signalled. It refuses the worker itself and its ancestors, anything inside Orca's app bundle, other users' processes, and a protected set of system and Orca processes kept as data in src/protected.ts.
  • Panel: a Quit control in the details drawer for processes that may be quit, and a plain sentence for those that may not. The confirmation is a native <dialog>. If the process is still running five seconds later, the panel offers force quit behind a second confirmation.
  • Fixes found on the way, each with a test that failed first: the ancestor walk stopped at the worker's direct parent; focus returned to the table row, not the Quit control, after the dialog closed; a status bar update that Orca refused was lost.

Processes started from Orca's terminals are not protected: quitting a runaway dev server is the point.

Plugin

os-vitals

Access changes

No change to capabilities, commands, panels, modules or programs. process.kill needs none of them. The changelog gains an Access line saying the worker can now send signals to your own processes, because users approve access once and should see this.

Tests

  • npm run check: formatting, policy, catalog and versions pass; 143 of 143 script tests pass.
  • orca plugin validate plugins/os-vitals --json: valid.
  • orca plugin test plugins/os-vitals --json: 18 of 18 worker tests pass.
  • node --test 'tests/os-vitals/**/*.test.ts': 138 of 138 pass. One named case for each of the 26 protected rules, every refusal reason, PID reuse three ways, and no signal sent on any refusal.
  • Live in Orca 1.4.261, against throwaway sleep processes started for the test: a normal quit ended one; one that ignores SIGTERM survived and ended with force; a wrong start time answered changed and sent nothing; pid 1 and Orca's terminal daemon answered protected.

Not verified: the dialog and the force flow clicked inside Orca itself (checked in the browser harness, including keyboard focus), and quitting on Linux, which arrives with the Linux process reader.

Screenshots

Reviewed locally from Orca (dark) and from the harness (11 states in dark and light). Not attached: the CLI cannot upload images, and the repository does not commit screenshots.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EWVANCgSt8W3VxxxZyAyoD

pblobp and others added 7 commits November 17, 2026 18:35
A worker that samples CPU from node:os, an HTML panel with the
Overview CPU card, a status bar item, and the command that opens the
panel through Orca's CLI. The manifest already declares the final
access: two capabilities, one panel, one command, one status bar item.

Unit tests and the smoke test live outside the plugin folder, so they
are not installed.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EWVANCgSt8W3VxxxZyAyoD
The worker reads memory from vm_stat and sysctl, the process list from
ps, and core kinds from ioreg. Process CPU comes from CPU time between
two readings. The panel gains the memory card, the top processes card,
and a sortable, filterable process table with a details drawer.

Processes are read only while a view shows them. Measured cost is
about 1.2% of one core with the Overview open and 0.16% in the
background.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EWVANCgSt8W3VxxxZyAyoD
The worker sends the signal only after reading the process again and
matching its start time, owner and name. It refuses the worker's own
family, anything inside Orca's app bundle, and a protected set of
system and Orca processes. The panel confirms in a dialog, and offers
force quit when the process is still running five seconds later.

Also fixes the ancestor walk, which stopped at the worker's parent,
and re-sends a status bar update that Orca refused.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EWVANCgSt8W3VxxxZyAyoD
CodeQL flagged the development server for returning an error's text
to the client. It now logs the error and answers with a fixed message.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EWVANCgSt8W3VxxxZyAyoD
@pblobp
pblobp merged commit 65d2070 into main Nov 17, 2026
11 checks passed
@pblobp
pblobp deleted the feat/os-vitals-quit branch November 17, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant