diff --git a/src/renderer/src/components/terminal-pane/terminal-ctrl-enter.test.ts b/src/renderer/src/components/terminal-pane/terminal-ctrl-enter.test.ts index 45a6c014893..4cb4b9a1b52 100644 --- a/src/renderer/src/components/terminal-pane/terminal-ctrl-enter.test.ts +++ b/src/renderer/src/components/terminal-pane/terminal-ctrl-enter.test.ts @@ -41,7 +41,7 @@ describe('hasCtrlEnterCsiUAuthorityForPane', () => { ) it('authorizes only trusted Ctrl+Enter CSI-u consumers', () => { - for (const agent of ['droid', 'grok'] as const) { + for (const agent of ['droid', 'grok', 'opencode'] as const) { expect( hasCtrlEnterCsiUAuthorityForPane( { diff --git a/src/shared/tui-agent-config-types.ts b/src/shared/tui-agent-config-types.ts index 587d4df84d7..53ae4e9ea7a 100644 --- a/src/shared/tui-agent-config-types.ts +++ b/src/shared/tui-agent-config-types.ts @@ -62,3 +62,9 @@ export type TuiAgentConfig = { /** Ctrl+Enter encoding for agents that consume CSI-u without active kitty flags. */ ctrlEnterEncoding?: 'csi-u' } + +/** Authoring form: `launchCmd` and `expectedProcess` default to `detectCmd` (true for most agents). */ +export type TuiAgentConfigSource = Omit & { + launchCmd?: string + expectedProcess?: string +} diff --git a/src/shared/tui-agent-config.ts b/src/shared/tui-agent-config.ts index a809d350f76..3dccce8952b 100644 --- a/src/shared/tui-agent-config.ts +++ b/src/shared/tui-agent-config.ts @@ -1,6 +1,6 @@ import type { TuiAgent } from './tui-agent' import { getOrcaCliCommandNameForPlatform } from './orca-cli-command-name' -import type { TuiAgentConfig } from './tui-agent-config-types' +import type { TuiAgentConfig, TuiAgentConfigSource } from './tui-agent-config-types' export type { AgentPromptInjectionMode, @@ -10,12 +10,6 @@ export type { TuiAgentDetectionRuntime } from './tui-agent-config-types' -/** Authoring form: `launchCmd` and `expectedProcess` default to `detectCmd` (true for most agents). */ -type TuiAgentConfigSource = Omit & { - launchCmd?: string - expectedProcess?: string -} - function resolveTuiAgentConfig(source: TuiAgentConfigSource): TuiAgentConfig { return { ...source, @@ -103,6 +97,8 @@ const TUI_AGENT_CONFIG_SOURCE: Record = { // was pasted blind, mid-startup (#22479). The signal itself fired every time in // those runs, so the budget was the problem, not a dropped escape. draftPasteReadyTimeoutMs: 20_000, + // Why: OpenCode decodes CSI-u Ctrl+Enter without local ConPTY kitty negotiation (#25372). + ctrlEnterEncoding: 'csi-u', composerReadyCaptures: [ 'opencode-1-18-32-timed-boot-slow', 'opencode-1-18-32-timed-boot-hidden-pane',