perf(runtime): gate terminal.list visual layouts (#12450)

* perf(runtime): gate terminal.list visual layouts and stop the false writable claim

visualLayouts is ~31% of a large terminal.list payload (44,208 B of 137,412 B on a live 134-terminal remote runtime) and has exactly one consumer: the human-readable CLI formatter. Gate it behind an includeVisualLayouts request param that defaults to included, so pre-flag clients are unaffected, and have every --json/internal caller opt out.

Also drop the record-backed builder's writable, which was a verbatim copy of connected. terminal.show now states writability explicitly as exactly what terminal.send's PTY gate enforces.

* test(runtime): type the payload-size fixture arrays for tsc

* fix(runtime): preserve terminal list compatibility

* test(runtime): guard terminal list optimization

* fix(cli): preserve agent access to terminal layouts
This commit is contained in:
Brennan Benson
2026-08-04 17:50:52 -07:00
committed by GitHub
parent dc5c5a89ba
commit 39c3c58d55
29 changed files with 477 additions and 34 deletions
+6 -2
View File
@@ -180,8 +180,12 @@ export const CORE_COMMAND_SPECS: CommandSpec[] = [
{
path: ['terminal', 'list'],
summary: 'List live Orca-managed terminals',
usage: 'orca terminal list [--worktree <selector>] [--limit <n>] [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'worktree', 'limit']
usage:
'orca terminal list [--worktree <selector>] [--limit <n>] [--include-visual-layouts] [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'worktree', 'limit', 'include-visual-layouts'],
notes: [
'JSON omits visualLayouts by default; pass --include-visual-layouts when machine-readable tab and pane topology is required.'
]
},
{
path: ['terminal', 'show'],