Repository navigation
fix(omp): answer startup Kitty queries before renderer handoff - #20620
Conversation
Forward actual renderer capability through local and remote spawn. Preserve source ranges and following keyboard mode pushes, and retain independent ConPTY color authority. Refs #17081. Secondary review: #17082. Co-authored-by: stevelliu <[email protected]>
📝 WalkthroughWalkthroughThe change forwards the renderer's Kitty keyboard capability through local, remote, and agent-session terminal creation. Startup ingress parses and answers the first Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to Some Windows launches may enable unsupported keyboard handling, while prepared-command and after-tab launches can still miss Kitty startup negotiation. These paths should be corrected before merge. 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
Full details: Out of Scope Changes checkExplanation The PR includes changes with no demonstrated connection to Issue Full details: Docstring CoverageExplanation Docstring coverage is 21.05% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 41 files. (1 skipped: 1 unsupported.) Full details: Description checkExplanation The description explains the change, motivation, linked issue, implementation scope, and validation. However, it omits most required template sections, including ELI5, What Changed, Why, Visual Proof, Review, Agent skill upstream boundary, Notes, and Checklist. Resolution Rewrite the description using the repository template. Add all required section headings and content. Include
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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: 0d0c7b2d-6679-422c-b0bd-575928b1e00f
📒 Files selected for processing (24)
docs/reference/omp-startup-keyboard-query.mdsrc/main/ipc/pty/ipc/spawn-options.tssrc/main/ipc/pty/ipc/spawn-types.tssrc/main/ipc/pty/runtime/spawn-options.tssrc/main/ipc/pty/runtime/spawn-state.tssrc/main/runtime/orca-runtime-create-terminal.tssrc/main/runtime/rpc/methods/terminal/terminal-lifecycle-methods.tssrc/main/runtime/runtime-pty-controller-contract.tssrc/main/runtime/runtime-rpc-mobile-terminal-streaming.test.tssrc/main/runtime/runtime-terminal-contracts.tssrc/preload/api/pty-api.tssrc/preload/api/pty-bridge-session-control.tssrc/renderer/src/components/terminal-pane/ipc-pty-spawn-request.tssrc/renderer/src/components/terminal-pane/pty-connection/pty-input-recovery.tssrc/renderer/src/components/terminal-pane/pty-transport-types.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport-create-handoff.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.tssrc/shared/pty-startup-color-query-answer.tssrc/shared/pty-startup-ingress-intent.tssrc/shared/pty-startup-ingress-kitty.test.tssrc/shared/pty-startup-ingress.tssrc/shared/pty-startup-query.tssrc/shared/rpc-contract/terminal-unary-params.tstests/tools/omp-startup-keyboard-smoke.mjs
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| Run the actual OMP protocol smoke with a read-only reference checkout: | ||
|
|
||
| ```sh | ||
| ORCA_BACKGROUND_LAUNCH=1 bun tests/tools/omp-startup-keyboard-smoke.mjs /path/to/oh-my-pi |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Redirect stdout in the smoke-test command.
A direct interactive invocation sets process.stdout.isTTY to true. The harness rejects that state before it starts the protocol test. Redirect stdout to a file or a non-TTY stream while preserving the Bun process exit status.
Proposed fix
-ORCA_BACKGROUND_LAUNCH=1 bun tests/tools/omp-startup-keyboard-smoke.mjs /path/to/oh-my-pi
+ORCA_BACKGROUND_LAUNCH=1 bun tests/tools/omp-startup-keyboard-smoke.mjs /path/to/oh-my-pi >/tmp/omp-startup-keyboard.json && cat /tmp/omp-startup-keyboard.json📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ORCA_BACKGROUND_LAUNCH=1 bun tests/tools/omp-startup-keyboard-smoke.mjs /path/to/oh-my-pi | |
| ORCA_BACKGROUND_LAUNCH=1 bun tests/tools/omp-startup-keyboard-smoke.mjs /path/to/oh-my-pi >/tmp/omp-startup-keyboard.json && cat /tmp/omp-startup-keyboard.json |
| if (startupTerminalColorQueryReplyColors) { | ||
| ctx.spawnOptions.startupIngress = { | ||
| colors: startupTerminalColorQueryReplyColors, | ||
| ...(args.terminalKittyKeyboardProtocol === true ? { kittyKeyboardProtocol: true } : {}), |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Allow Kitty-only startup ingress.
getStartupTerminalColorQueryReplyColors(args) returns null when color replies are absent or invalid. Both buildPtyIpcSpawnOptions and buildRuntimePtySpawnOptions create startupIngress only when that result is truthy. Reachable local and runtime spawns with terminalKittyKeyboardProtocol === true therefore create no ingress and cannot answer OMP’s initial ESC[?u query.
Update the startup-ingress contract to allow a Kitty-only intent. Construct startupIngress when Kitty is enabled or valid color replies exist. Skip color-query handling when color replies are unavailable. A condition change alone is insufficient because the current intent parser requires both color replies.
| ...(terminalKittyKeyboardProtocol === true | ||
| ? { terminalKittyKeyboardProtocol: true } | ||
| : {}), |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Forward the Kitty capability through both structured agent-session creates.
Both renderer payloads omit terminalKittyKeyboardProtocol. The ExplicitEnsure and CreateAgentSessionParams schemas and request types also omit it. Both host methods then call createTerminal without the field. The existing PTY spawn contracts already support the field, but kittyKeyboardProtocol remains unset, so OMP launches on either structured path can miss the Kitty startup-query response.
Add the field to both request contracts and payloads. Pass it through both createTerminal option objects. Do not extend the existing PTY spawn contracts.
|
Risk-reduction review at Actual OMP protocol smoke passes (177 raw sequence coverage), but Kitty-only ingress parses as undefined and structured session-create paths omit the capability. Remaining user-facing consequence: Some launches still lose modified-key distinctions. Requires compatible propagation through strict old/new-host schemas and actual launch proof. |
There was a problem hiding this comment.
Important
The capability reaches terminal.create but not the paired host-authority agent-session create, so the startup Kitty handshake is still missed on that path.
Reviewed changes
Reviewed the full 24-file diff at 44ab5aa: the new Kitty startup-query path in PtyStartupIngress, its intent plumbing across local/SSH/daemon/paired spawn, and the new tests/tooling.
- Kitty query parser —
parsePtyStartupQuerymatches only the exact\x1b[?uunit token while authority is open, returnspartialfor proper prefixes, and delegates toparseTerminalOscColorQueryotherwise; the consumed range removes just the query and preserves surrounding sequence ranges. - Ingress state machine — a separate
kittyQueryOpenauthority, a mirroredTerminalKittyKeyboardModeTrackerfeeding\x1b[?<flags>u, and pending-candidate release rules for ConPTY vs posix. - Color-query extraction —
answerQuery's body moved unchanged intopty-startup-color-query-answer.ts; color and Kitty authority now end independently. - Capability plumbing — optional
terminalKittyKeyboardProtocolthreaded from the renderer's xterm option through IPC, daemon, SSH, and theterminal.createRPC schema; wire version and stream opcodes unchanged. - Tests/tooling — 13 ingress tests covering fragmentation, ConPTY, deadline, write failure, once-only answering, and authority separation, plus a manual OMP smoke harness and a reference doc.
I verified the new and touched tests pass (pty-startup-ingress-kitty, pty-startup-ingress, runtime-rpc-mobile-terminal-streaming, remote-runtime-pty-transport-create-handoff) and that pnpm tc:node is clean. A byte-level fuzz pass over the ingress found no dropped or duplicated byte and no double answer.
ℹ️ Nitpicks
- The renderer side of the wiring —
pty-input-recovery.ts:38-39readingsession.pane.terminal.options.vtExtensions?.kittyKeyboard— has no test. The transport-level tests pass the flag in directly, so nothing pins the "capability comes from the live xterm option, not a default" contract that makes the native-Windows withhold case work.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta — informational only. The previously flagged paired host-authority agent-session path is untouched by this commit and remains the one open item, so this review is non-approving.
Reviewed changes
Reviewed the single new commit 8936204c0b (delta against the prior pullfrog review at 44ab5aa): it lets a Kitty capability arm startup ingress even when theme colors are absent.
- Intent construction refactored —
getStartupTerminalColorQueryReplyColorsbecamegetStartupTerminalIngressIntentand now builds the intent throughparsePtyStartupIngressIntent, falling back tocolors: {}rather than dropping the intent when color replies are missing. A recognized agent withterminalKittyKeyboardProtocol: truebut no valid theme colors therefore still answersCSI ? u. - Parser relaxed —
parsePtyStartupIngressIntentaccepts an absent/emptycolorswhenkittyKeyboardProtocol === true.colorsanddeadlineMsare now read viain-checks on the unknown input instead of anascast, and the 0–30s deadline bound is unchanged. - Both local and runtime spawn-options assign the parsed intent verbatim instead of reconstructing the object inline.
- Tests — new
terminal-startup-color-query-replies.test.ts(5 cases: agent variants keep keyboard startup without colors; ordinary shells/unadvertised support stay off; color-only startup preserved) plus three new kitty-ingress groups for colorless intents, colorless rejection without Kitty, and invalid deadlines.
I verified the touched tests pass (32 tests across terminal-startup-color-query-replies and pty-startup-ingress-kitty) and pnpm tc:node is clean at 8936204c0b. The relaxation does not regress color-only behavior on the wire: terminalOscColorQueryReplies({}, [10, 11]) is still falsy, so an empty-colors intent answers Kitty only and leaves color queries to the existing fallback.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ The previously flagged paired host-authority gap is fixed and the new capability negotiation is well covered. One non-anchored scope question remains about the other renderer agent-session create sites — non-approving only so that stays on the record.
Reviewed changes
Reviewed the single new commit 9b8bf09 (delta against the prior pullfrog review at 8936204): it closes the flagged paired host-authority gap by negotiating a new agent-session.keyboard.v1 capability before sending terminalKittyKeyboardProtocol on terminal.createAgentSession / terminal.ensureAgentSession.
- Capability negotiation module —
createAgentSessionKeyboardOptionsprobesagent-session.keyboard.v1once per transport and freezes the payload, so replays keep the original request shape; disabled/absent renderer support never probes; compat-block errors propagate while transient probe failures fall back to the legacy payload. - Host-authority params —
terminalKittyKeyboardProtocoladded to the.strict()CreateAgentSessionParams/EnsureAgentSessionParamsschemas and the shared request types;hostAuthorityCreate()spreads the negotiated options into both create and ensure calls. - Host forwarding — both host create sites now pass the flag into
createTerminal, and the create-operation fingerprint includes it so a changed capability under the same operation id is refused. - Tests — new negotiation/freeze/refusal unit tests, a host-support × resume matrix on the transport's params, and create/resume forwarding plus conflict coverage. Verified 41 tests pass locally.
ℹ️ Other paired-host agent-session creates still omit the keyboard flag
The capability now rides remote-runtime-pty-transport.ts, but two other renderer call sites still build terminal.createAgentSession / terminal.ensureAgentSession without terminalKittyKeyboardProtocol: web-runtime-terminal-create-operation.ts:97-145 (web-host agent tabs, reached through launch-agent-web-host-tab.ts) and runtime-agent-background-create.ts:36-57. Their fallbacks (session.tabs.createTerminal / terminal.create) omit it too, so an agent launched through those surfaces still answers no CSI ? u before renderer handoff and keeps the startup race this PR fixes. Is that intentionally out of scope (a follow-up PR), or should the capability ride those RPC params as well? If it is out of scope, a line in docs/reference/omp-startup-keyboard-query.md naming the remaining surfaces would keep the next reader from assuming full coverage.
Technical details
# Keyboard capability not threaded through all paired-host agent-session creates
## Affected sites
- `src/renderer/src/runtime/web-runtime-terminal-create-operation.ts:97-145` — host-authority `terminal.ensureAgentSession` / `terminal.createAgentSession` params carry no `terminalKittyKeyboardProtocol`; the `session.tabs.createTerminal` fallback (`:158-178`) omits it too.
- `src/renderer/src/runtime/web-runtime-session-types.ts:17-43` — `CreateWebRuntimeSessionTerminalArgs` has no kitty field, so the client cannot thread it from the pane's `vtExtensions.kittyKeyboard` without new plumbing.
- `src/renderer/src/lib/launch-agent-web-host-tab.ts:70-95` — builds those args for a paired web host agent tab.
- `src/renderer/src/lib/runtime-agent-background-create.ts:36-78` — same omission on the host-authority path and the `terminal.create` fallback.
## Required outcome
Either (a) the keyboard capability rides every paired-host agent-session create so OMP's first `CSI ? u` is answered on those surfaces too, or (b) the scope boundary is documented so the doc's "local/SSH/paired" claim is accurate.
## Open questions for the human
- Are the web-host and background-agent surfaces expected to hit the same startup race (both answer color queries from host view colors but never kitty)?
- If deliberately deferred, should the capability advertisement/negotiation still be reused there, or is a separate follow-up preferred?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new critical issues — the paired web host-authority create now negotiates the keyboard capability. One paired surface named in the previous review still omits it.
Reviewed changes
Reviewed the delta since the prior pullfrog review at 9b8bf09 (commit 1b1a7f94): it threads the negotiated keyboard capability into the paired web agent-session create path.
- Paired web creates negotiate the flag —
createWebRuntimeSessionTerminalResultnow buildscreateAgentSessionKeyboardOptions(...)from the default terminal advertisement and spreads the result into bothterminal.ensureAgentSessionandterminal.createAgentSession. - Shared request types widened — optional
terminalKittyKeyboardProtocoladded toRuntimeEnsureAgentSessionRequest/RuntimeCreateAgentSessionRequest, which until now existed only on the Zod schemas (the host file is@ts-nocheck, so typecheck never caught the divergence). - Test matrix extended — the host-authority create test gains a
keyboardSupporteddimension asserting the param is present only when the host advertisesagent-session.keyboard.v1; the harness clears the runtime-compat cache per test, so the dimension genuinely exercises negotiation.
I verified the touched suites pass (web-runtime-session-terminal-host-authority 17, agent-session-keyboard-capability 6, remote-runtime-pty-transport-create-handoff 14) and that pnpm tc:web / pnpm tc:node are clean at 1b1a7f94. Using buildDefaultTerminalOptions() here is consistent with the eventual renderer: the vtExtensions.kittyKeyboard: false withhold is gated on isLocalNativeWindowsConpty, which requires a 'local' execution host, so a paired-remote pane advertises kitty regardless of client OS.
ℹ️ Background paired agent-session creates still omit the keyboard flag
runtime-agent-background-create.ts builds terminal.createAgentSession (and its terminal.create fallback) without terminalKittyKeyboardProtocol, so an agent launched into a paired background/sleeping session still cannot answer OMP's startup CSI ? u before renderer handoff. This is the second of the two surfaces the previous review named; the web-host site is now fixed, but this one is untouched and the reference doc still reads as though every paired client negotiates the capability.
Technical details
# Remaining paired agent-session create omits the keyboard capability
## Affected sites
- `src/renderer/src/lib/runtime-agent-background-create.ts:40` — host-authority `terminal.createAgentSession` params carry no `terminalKittyKeyboardProtocol`; the `terminal.create` fallback at `:61` omits it too.
- `src/renderer/src/lib/launch-agent-background-session.ts:177` — the paired-runtime background launch that reaches that helper.
- `docs/reference/omp-startup-keyboard-query.md:5` — describes clients sending the flag on `terminal.createAgentSession` / `terminal.ensureAgentSession` without noting this deferred surface.
## Required outcome
Either thread the same negotiated capability through this create (reusing `createAgentSessionKeyboardOptions`, mirroring `web-runtime-terminal-create-operation.ts`), or state the deferred surface in the reference doc so its coverage claim is accurate.
## Open question for the human
Is the background/sleeping-agent surface deliberately deferred to a follow-up, or should it ride the same capability negotiation now?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta. The one paired surface flagged previously is still untouched, so this stays non-approving.
Reviewed changes
Reviewed the delta since the prior pullfrog review at 941ce43 (commit abb10a0): it hardens the paired-web launch result handling and edits two SSH e2e files.
- Paired launch results are now decoded —
readCreatedAgentTerminalIdentityvalidates theterminalcoordinates returned byterminal.createAgentSession/terminal.ensureAgentSessionbefore they are consumed inweb-runtime-terminal-create-operation.ts, replacing the twoas RuntimeRpcResponse<...>casts with a checked decode that keeps onlytabId/paneKey. - Decoder unit tests added —
web-runtime-terminal-identity.test.tspins acceptance of additive/legacy fields and rejection of malformed shapes. - Unrelated SSH e2e rewrites bundled in —
ssh-docker-watcher-isolation.spec.tsswitches its twoexpect.pollwaits toexpect().toPass()retries, anddocker-ssh-relay-processes.tsgets a comment tweak.
I verified the touched suites pass (web-runtime-terminal-identity 7, web-runtime-session-terminal-host-authority 17, web-runtime-session-terminal-legacy-create 9, remote-runtime-pty-transport-create-handoff 14, agent-session-keyboard-capability 6), pnpm tc:web and the e2e typecheck are clean, and oxlint is clean on the changed renderer files at abb10a0.
ℹ️ Unrelated SSH e2e retry rewrite rides along
Neither tests/e2e/ssh-docker-watcher-isolation.spec.ts nor tests/e2e/helpers/docker-ssh-relay-processes.ts has any connection to the Kitty startup path. Both edits look reasonable in isolation, but bundling them here makes the PR's scope ambiguous; if they are an intended flakiness fix, a separate PR would be cleaner, and if they were picked up accidentally they should be dropped.
Technical details
# Unrelated test changes included in the Kitty startup commit
## Affected sites
- `tests/e2e/ssh-docker-watcher-isolation.spec.ts:51-55` and `:129-139` — the two `waitForRelayWatcherProcessGroup` / `afterCrash` waits are rewritten from `expect.poll(...).toBe(...)` to `expect(() => { ... expect(...).toBe(...) }).toPass({ timeout })`, and a comment is added about a process exiting between `/proc` reads.
- `tests/e2e/helpers/docker-ssh-relay-processes.ts:55` — the `Number('')` comment is reworded.
- None of these files are touched by the Kitty ingress, capability negotiation, or host-authority changes.
## Required outcome
Either confirm the e2e change is intentional and split it out (or explain why it must ride here), or drop it so the PR's diff stays limited to the OMP startup keyboard fix.
## Open question for the human
Was the SSH e2e retry rewrite meant for this PR, or did it come along from another working tree?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed commit 5596aade62 and merge b66102f647 against the prior pullfrog review at abb10a0: it closes the last remaining paired-host agent-session create that omitted the keyboard capability, and deduplicates a search test brought in by main.
- Paired background launches negotiate the keyboard capability —
runtime-agent-background-create.tsnow buildscreateAgentSessionKeyboardOptions(...)from the default terminal advertisement and spreads the negotiated result into the host-authorityterminal.createAgentSessionparams, mirroringweb-runtime-terminal-create-operation.ts. The non-strictterminal.createfallback carries the additive flag when the renderer advertises it. - Capability matrix test added —
launch-agent-background-session-remote.test.tsgains anit.each([true, false])case asserting the param is present only when the host advertisesagent-session.keyboard.v1, plus an OMP-launch assertion and a legacy-fallback assertion. The harness clears the runtime-compat cache per test, so the dimension genuinely exercises negotiation. - Remaining gap closed in the doc —
docs/reference/omp-startup-keyboard-query.md:5now names the paired background path. - Duplicate search test removed on main integration — one byte-identical duplicate of the separator-only include-pattern case is dropped; the surviving case and all its imports remain.
The background helper is reached only when runtimeTarget.kind === 'environment', so using the default kittyKeyboard: true advertisement matches the paired-remote decision already made for the web-host path. Verified locally: launch-agent-background-session-remote (17), agent-session-keyboard-capability (6), and text-search (45) pass, pnpm tc:web is clean, and oxlint reports 0 warnings on the changed files. All prior Pullfrog threads are resolved.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 Major · Forward the negotiated keyboard capability… · web-runtime-terminal-create-operation.ts:171-189
src/renderer/src/runtime/web-runtime-terminal-create-operation.ts:171-189
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftForward the negotiated keyboard capability through the legacy launch path.
When
args.preparedAgentCommandorargs.afterTabIdforcesmustUseLegacyAgentCreate, thesession.tabs.createTerminalrequest does not callkeyboardOptions(environmentId). TheCreateTerminalTabschema and its handler also do not declare or forwardterminalKittyKeyboardProtocol, so adding the field only in the renderer request would not reachruntime.createMobileSessionTerminal. Extend that legacy contract and forward the field before spreading the capability-gated options. This preserves Kitty keyboard support when the renderer and host advertiseAGENT_SESSION_KEYBOARD_RUNTIME_CAPABILITY.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 7e5af39d-fe37-4154-adfe-11d779ec2d86
📒 Files selected for processing (18)
docs/reference/omp-startup-keyboard-query.mdsrc/main/ipc/pty/runtime/spawn-options.tssrc/main/ipc/pty/runtime/spawn-state.tssrc/main/runtime/orca-runtime-create-terminal.tssrc/main/runtime/rpc/methods/terminal/terminal-lifecycle-methods.tssrc/main/runtime/runtime-pty-controller-contract.tssrc/main/runtime/runtime-terminal-contracts.tssrc/renderer/src/lib/launch-agent-background-session-remote.test.tssrc/renderer/src/lib/runtime-agent-background-create.tssrc/renderer/src/runtime/web-runtime-session-terminal-host-authority.test.tssrc/renderer/src/runtime/web-runtime-terminal-create-operation.tssrc/renderer/src/runtime/web-runtime-terminal-identity.test.tssrc/renderer/src/runtime/web-runtime-terminal-identity.tssrc/shared/protocol-version.tssrc/shared/rpc-contract/terminal-unary-params.tssrc/shared/text-search.test.tstests/e2e/helpers/docker-ssh-relay-processes.tstests/e2e/ssh-docker-watcher-isolation.spec.ts
💤 Files with no reviewable changes (1)
- src/shared/text-search.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| const keyboardProtocol = buildDefaultTerminalOptions().vtExtensions?.kittyKeyboard | ||
| const keyboardOptions = createAgentSessionKeyboardOptions(keyboardProtocol) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,110p' src/renderer/src/lib/runtime-agent-background-create.ts
rg -n "createRuntimeAgentBackgroundTerminal|buildDefaultTerminalOptions|kittyKeyboard|terminalKittyKeyboardProtocol" src/renderer/src/lib src/renderer/src/components/terminal-pane | head -240Repository: stablyai/orca
Length of output: 22534
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- capability/default definitions ---'
cat -n src/renderer/src/lib/pane-manager/terminal-keyboard-protocol.ts
cat -n src/renderer/src/lib/pane-manager/pane-terminal-options.ts | sed -n '1,95p'
printf '%s\n' '--- background callers and tests ---'
rg -n -A28 -B12 "createRuntimeAgentBackgroundTerminal|launch-agent-background-session" src/renderer/src/lib src/renderer/src/runtime src/renderer/src/components
printf '%s\n' '--- keyboard option helper and downstream launch use ---'
rg -n -A45 -B15 "createAgentSessionKeyboardOptions|terminalKittyKeyboardProtocol" src/renderer/src/runtime src/renderer/src/components/terminal-pane src/renderer/src/libRepository: stablyai/orca
Length of output: 50370
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- keyboard protocol gate ---'
sed -n '1,100p' src/renderer/src/lib/pane-manager/terminal-keyboard-protocol.ts
printf '%s\n' '--- default terminal options ---'
sed -n '25,82p' src/renderer/src/lib/pane-manager/pane-terminal-options.ts
printf '%s\n' '--- locate keyboard helper ---'
rg -l "function createAgentSessionKeyboardOptions|createAgentSessionKeyboardOptions" src/renderer/src/runtime src/renderer/src/lib src/renderer/src/components/terminal-pane | head -20
printf '%s\n' '--- background caller ---'
sed -n '130,215p' src/renderer/src/lib/launch-agent-background-session.ts
printf '%s\n' '--- remote launch test capability cases ---'
sed -n '385,455p' src/renderer/src/lib/launch-agent-background-session-remote.test.tsRepository: stablyai/orca
Length of output: 12000
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- keyboard capability helper ---'
cat -n src/renderer/src/runtime/agent-session-keyboard-capability.ts
printf '%s\n' '--- remote launch wrapper ---'
rg -n -A120 -B20 "export function runRemoteAgentSessionLaunch|function runRemoteAgentSessionLaunch" src/renderer/src/runtime src/renderer/src/lib
printf '%s\n' '--- background creator references ---'
rg -n -A20 -B12 "createRuntimeAgentBackgroundTerminal" src/renderer/src/lib/launch-agent-background-session.ts src/renderer/src/lib/runtime-agent-background-create.tsRepository: stablyai/orca
Length of output: 16678
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- all repository consumers ---'
rg -n -A18 -B12 "terminalKittyKeyboardProtocol" --glob '!src/renderer/src/lib/runtime-agent-background-create.ts' --glob '!src/renderer/src/runtime/agent-session-keyboard-capability.ts' --glob '!src/renderer/src/lib/launch-agent-background-session-remote.test.ts' .
printf '%s\n' '--- effective option gate usages ---'
rg -n -A16 -B12 "buildTerminalKeyboardProtocolOptions|shouldDisableKittyKeyboardForTerminal|isLocalNativeWindowsConpty" src/renderer/srcRepository: stablyai/orca
Length of output: 50370
Forward the effective renderer capability.
createRuntimeAgentBackgroundTerminal reads the static true value from buildDefaultTerminalOptions(). The caller supplies no override, and downstream runtime code forwards terminalKittyKeyboardProtocol to terminal creation without applying the renderer’s platform gate.
When the effective xterm capability is false, a compatible host can still receive terminalKittyKeyboardProtocol: true through both launch paths. Pass the effective renderer capability into this function and add a false-capability test.
| const keyboardProtocol = buildDefaultTerminalOptions().vtExtensions?.kittyKeyboard | ||
| const keyboardOptions = createAgentSessionKeyboardOptions(keyboardProtocol) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '60,210p' src/renderer/src/runtime/web-runtime-terminal-create-operation.ts
rg -n "webRuntimeTerminalCreateOperation|buildDefaultTerminalOptions|kittyKeyboard|isWindows|win32" src/renderer/src/runtime src/renderer/src/components/terminal-pane | head -260Repository: stablyai/orca
Length of output: 40806
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- helper definitions and usages ---'
rg -n -C 8 "function createAgentSessionKeyboardOptions|const createAgentSessionKeyboardOptions|createAgentSessionKeyboardOptions|function buildDefaultTerminalOptions|const buildDefaultTerminalOptions|kittyKeyboard" src/renderer/src src shared | head -500
printf '%s\n' '--- capability and renderer input sources ---'
rg -n -C 6 "AGENT_SESSION_KEYBOARD_RUNTIME_CAPABILITY|agent-session.keyboard.v1|keyboard.*capabil|kitty.*capabil|effective.*capabil|input.*capabil|renderer.*capabil" src/renderer/src src/main shared | head -500
printf '%s\n' '--- createTerminal contract and handlers ---'
rg -n -C 8 "session\\.tabs\\.createTerminal|CreateTerminalTab|createTerminal" src/renderer/src/runtime src/main src/shared shared | head -500Repository: stablyai/orca
Length of output: 50370
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- keyboard capability helper ---'
cat -n src/renderer/src/runtime/agent-session-keyboard-capability.ts
printf '%s\n' '--- terminal option implementation ---'
fd -i -t f 'pane-terminal-options' .
for f in $(fd -i -t f 'pane-terminal-options' .); do
echo "FILE $f"
rg -n -C 12 "buildDefaultTerminalOptions|kittyKeyboard|vtExtensions" "$f"
done
printf '%s\n' '--- exact createTerminal matches ---'
rg -l "session\\.tabs\\.createTerminal|CreateTerminalTab" src | sort
printf '%s\n' '--- capability-related exact matches ---'
rg -n -C 4 "agent-session\\.keyboard\\.v1|AGENT_SESSION_KEYBOARD_RUNTIME_CAPABILITY|terminalKittyKeyboardProtocol" src --glob '!**/*.test.*' | head -240Repository: stablyai/orca
Length of output: 27680
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- operation signature and callers ---'
cat -n src/renderer/src/runtime/web-runtime-terminal-create-operation.ts | sed -n '1,260p'
printf '%s\n' 'CALLERS'
rg -n -C 8 "webRuntimeTerminalCreateOperation|createWebRuntimeTerminal|WebRuntimeTerminalCreate|runWebRuntimeTerminal" src/renderer/src --glob '!**/*.test.*'
printf '%s\n' '--- relevant caller and active terminal capability paths ---'
cat -n src/renderer/src/lib/runtime-agent-background-create.ts | sed -n '1,130p'
cat -n src/renderer/src/components/terminal-pane/pty-connection/pty-input-recovery.ts | sed -n '25,50p'
printf '%s\n' '--- legacy schema and handler ---'
cat -n src/main/runtime/rpc/methods/session-tabs-schemas.ts | sed -n '1,260p'
cat -n src/main/runtime/rpc/methods/session-tabs.ts | sed -n '1,260p'Repository: stablyai/orca
Length of output: 40469
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- web-runtime callers ---'
rg -n -C 12 "createWebRuntimeSessionTerminal(?:WithLaunchDraft)?\\(|createWebRuntimeAgentSessionTerminal\\(" src --glob '!**/*.test.*'
printf '%s\n' '--- web-runtime argument type ---'
cat -n src/renderer/src/runtime/web-runtime-session-types.ts | sed -n '13,48p'
printf '%s\n' '--- legacy parameter definition ---'
rg -n -C 18 "CreateTerminalTab" src/shared/rpc-contract/session-tabs-schemas-params.ts
printf '%s\n' '--- non-test vtExtensions assignments ---'
rg -n -C 8 "vtExtensions" src/renderer/src --glob '!**/*.test.*' | head -220Repository: stablyai/orca
Length of output: 45178
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- effective keyboard policy ---'
cat -n src/renderer/src/lib/pane-manager/terminal-keyboard-protocol.ts | sed -n '1,100p'
rg -n -C 10 "buildTerminalKeyboardProtocolOptions|shouldDisableKittyKeyboardForTerminal" src/renderer/src --glob '!**/*.test.*'
printf '%s\n' '--- complete legacy schema tail ---'
cat -n src/shared/rpc-contract/session-tabs-schemas-params.ts | sed -n '135,185p'Repository: stablyai/orca
Length of output: 20088
Use the effective renderer Kitty capability.
buildDefaultTerminalOptions() always sets vtExtensions.kittyKeyboard to true. The native Windows ConPTY policy can override the effective renderer value to false, but this operation has no platform or effective-capability gate. A structured agent launch can therefore pass terminalKittyKeyboardProtocol: true to a host that supports agent-session.keyboard.v1, even when the renderer must withhold Kitty support. This can cause Windows clients to lose modified-key or navigation-key handling.
Pass the caller's effective renderer capability into this operation and use it instead of buildDefaultTerminalOptions(). Add coverage for the false-capability path.

OMP can ask about keyboard support before its renderer owns terminal replies. This change forwards the renderer's Kitty capability and answers the first startup query through the existing reply path, preserving subsequent mode changes and output sequence ranges.
Fixes #17081. Compared with contributor #17082; stevelliu is credited as co-author.
Local, SSH, paired New Tab, and paired background launches carry the capability. Strict host-authority agent-session methods receive it only after
agent-session.keyboard.v1negotiation; older hosts retain their original strict payload. Legacy terminal creation accepts the additive field. Paired panes use their default terminal advertisement; native Windows panes retain their existing Kitty-withholding policy. Keyboard-only ingress works without theme colors. Color and keyboard reply ownership remain independent.Validation
b66102f6478: 145 focused tests passed across background launches, capability negotiation, host-authority creation, legacy fallback, ingress and search coverage. Web typecheck and commit hooks pass.docs/reference/omp-startup-keyboard-query.mdfor the redirected, non-TTY invocation.Two intentional CI repairs accompany validation: Docker SSH process observations use bounded retries when a process exits between
/procreads, preserving the complete-snapshot and unchanged-relay assertions; main integration removes one byte-identical duplicate search test that failed the native-quality gate. Neither changes production process cleanup.