mirror of
https://github.com/stablyai/orca.git
synced 2026-09-26 08:02:38 +00:00
Increase shell readiness timeout to match daemon barrier
Slow interactive rc files can take longer than 1.5s to initialize. Raise the startup command readiness timeout from 1.5s to 15s to match the daemon barrier and prevent queued commands from executing mid-startup.
This commit is contained in:
@@ -114,6 +114,7 @@ vi.mock('../shell-prompt-readiness-probe', () => ({
|
||||
}))
|
||||
|
||||
import { LocalPtyProvider } from './local-pty-provider'
|
||||
import { STARTUP_COMMAND_READY_MAX_WAIT_MS } from './local-pty-shell-ready-startup-command'
|
||||
import {
|
||||
applyLocalPtyProviderMockDefaults,
|
||||
createLocalPtyMockProcess,
|
||||
@@ -240,6 +241,12 @@ describe('LocalPtyProvider', () => {
|
||||
vi.advanceTimersByTime(1500)
|
||||
await Promise.resolve()
|
||||
|
||||
expect(onData).not.toHaveBeenCalled()
|
||||
expect(mockProc.write).not.toHaveBeenCalled()
|
||||
|
||||
vi.advanceTimersByTime(STARTUP_COMMAND_READY_MAX_WAIT_MS - 1500)
|
||||
await Promise.resolve()
|
||||
|
||||
expect(onData).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
'\x1b]777;orca-shell-ready',
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
import type * as pty from 'node-pty'
|
||||
import { buildStartupCommandSubmission } from '../../shared/startup-command-submission'
|
||||
|
||||
export const STARTUP_COMMAND_READY_MAX_WAIT_MS = 1500
|
||||
// Match the daemon barrier so slow interactive rc files do not receive queued commands mid-startup.
|
||||
export const STARTUP_COMMAND_READY_MAX_WAIT_MS = 15_000
|
||||
const POST_SHELL_READY_STARTUP_COMMAND_DELAY_MS = 30
|
||||
const POST_SHELL_READY_STARTUP_COMMAND_FALLBACK_MS = 200
|
||||
|
||||
|
||||
Reference in New Issue
Block a user