From f529dee47f5ea30072728abfe5669cd48740aa36 Mon Sep 17 00:00:00 2001 From: Merge Sim Date: Sat, 5 Sep 2026 00:39:29 -0700 Subject: [PATCH] perf(runtime): preserve ordinary prompt scheduling --- .../runtime/orca-runtime-write-terminal-agent-prompt.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/runtime/orca-runtime-write-terminal-agent-prompt.ts b/src/main/runtime/orca-runtime-write-terminal-agent-prompt.ts index be6e8189db8..5cb95bc8a4c 100644 --- a/src/main/runtime/orca-runtime-write-terminal-agent-prompt.ts +++ b/src/main/runtime/orca-runtime-write-terminal-agent-prompt.ts @@ -52,7 +52,9 @@ export class OrcaRuntimeWithWriteTerminalAgentPrompt extends OrcaRuntimeWithReso if (!this.ptyController?.write(ptyId, pastePayload)) { throw new Error('terminal_not_writable') } - await options.afterWrite?.(ptyId) + if (options.afterWrite) { + await options.afterWrite(ptyId) + } } catch (error) { renderGate?.dispose() throw error @@ -90,7 +92,9 @@ export class OrcaRuntimeWithWriteTerminalAgentPrompt extends OrcaRuntimeWithReso if (!this.ptyController?.write(ptyId, AGENT_PROMPT_SUBMIT)) { throw new Error(options.suffixFailureError ?? 'terminal_not_writable') } - await options.afterWrite?.(ptyId) + if (options.afterWrite) { + await options.afterWrite(ptyId) + } await verifyAgentPromptSubmission({ baseline, readActivity: () => this.getAgentPromptActivity(handle, ptyId, waitTextCache),