Oko/Docs

Command reference

oko sessions orphans

Lists recorded process trees whose owning session ended, alongside unattributed adopted terminal processes and the reason they cannot be reaped.

Invocation#

Command
oko sessions orphans [--json]

Inputs and options#

  • Run `oko sessions agents` while sessions are live. Inventory follows actual parent chains from transcript writers and broker-owned terminals and retains each descendant's kernel birth identity in ~/.oko/session-processes.json. OKO_SESSION_PROCESSES selects another ownership register.
  • Ownership comes from observed ancestry, not a command name, terminal or kernel session number. Detached descendants remain attributable. A process already orphaned before any observation has no recoverable owner in this register and cannot be authorized retroactively.

Output and state effect#

  • Returns {at, count, orphans: [{pid, parent, session, observedAt, terminal, elapsed, command, tree}], unattributed: [{pid, parent, terminal, elapsed, command, cause}]}. Roots must have been adopted after their starter ended; original recorded session owners must no longer run. Process births distinguish reused PIDs.
  • `oko sessions agents` includes the same observation under orphaned, with age, command and session beside live agent rows. orphaned.failure names a failed process-table, kernel-identity or ownership-register operation instead of reporting an empty success.
  • Oko Desktop → Sessions → Agent sessions shows the same attributed and unattributed processes. Left running displays each tree, age, command, owning session and ownership observation, with a reason field and Reap action.

Refusals and safe exits#

  • Unreadable process tables, ownership records and kernel identities retain their actual causes. Unattributed rows are diagnostics, not permission to signal them.
  • This listing takes no positional argument. Use `oko sessions reap PID --reason TEXT` to end a recorded tree.

CLI reference#