stablyai/orca · error · CodexAppServerTimeoutError

codex trust-grant entry killed by ${spawned.signal} after ${

Error message

codex trust-grant entry killed by ${spawned.signal} after ${request.invocation.timeoutMs}ms deadline

What it means

Thrown as CodexAppServerTimeoutError when spawnSync's child was killed by a signal (spawned.signal is set) but the error code was not ETIMEDOUT. The message includes the signal name and the session deadline. This covers cases like SIGKILL from external pressure (OOM killer) or manual signal delivery.

Source

Thrown at src/main/codex/codex-app-server-grant-bridge.ts:113

    timeout:
      request.invocation.timeoutMs + (options.timeoutMarginMs ?? GRANT_ENTRY_TIMEOUT_MARGIN_MS),
    killSignal: 'SIGKILL',
    maxBuffer: GRANT_ENTRY_MAX_BUFFER_BYTES,
    windowsHide: true,
    env: { ...process.env, ELECTRON_RUN_AS_NODE: '1' }
  })
  if ((spawned.error as NodeJS.ErrnoException | undefined)?.code === 'ETIMEDOUT') {
    // Why: spawnSync reports its own deadline through error.code before the
    // signal field; preserve the typed timeout so cooldown diagnostics work.
    throw new CodexAppServerTimeoutError(
      `codex trust-grant entry exceeded ${request.invocation.timeoutMs}ms session deadline`
    )
  }
  if (spawned.error) {
    throw spawned.error
  }
  if (spawned.signal) {
    throw new CodexAppServerTimeoutError(
      `codex trust-grant entry killed by ${spawned.signal} after ${request.invocation.timeoutMs}ms deadline`
    )
  }
  const lines = (spawned.stdout ?? '').split('\n').filter((line) => line.trim().length > 0)
  const lastLine = lines.at(-1)
  let envelope: GrantEntryEnvelope | null = null
  if (lastLine) {
    try {
      envelope = JSON.parse(lastLine) as GrantEntryEnvelope
    } catch {
      envelope = null
    }
  }
  if (!envelope) {
    throw new Error(
      `codex trust-grant entry produced no result (exit ${spawned.status ?? 'unknown'})${
        spawned.stderr ? `: ${spawned.stderr.trim().slice(0, 400)}` : ''
      }`

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Check system memory: if low, close other applications and retry.
  2. Check antivirus logs for process termination of Orca or its children.
  3. On Windows, check Event Viewer for process termination events.
  4. Retry the trust-grant operation after addressing the resource issue.
Defensive patterns

Strategy: retry

Type guard

import { CodexAppServerTimeoutError } from '@orca/main/codex/codex-app-server-client'

function isGrantKilled(error: unknown): error is CodexAppServerTimeoutError {
  return error instanceof CodexAppServerTimeoutError &&
         error.message.includes('killed by')
}

Try / catch

try {
  runCodexHookTrustGrantSessionSync(request)
} catch (error) {
  if (error instanceof CodexAppServerTimeoutError &&
      error.message.includes('killed by')) {
    // Process was killed (OOM, AV, signal); check resources before retry
    logSignalKill(error.message)
  } else { throw error }
}

Prevention

When it happens

Trigger: The grant entry child process was killed by a signal other than the spawnSync timeout path. Possible sources: OS OOM killer, task manager, antivirus, or the parent process receiving a signal that propagates.

Common situations: System out of memory triggers the OOM killer targeting the node child. Antivirus software kills the ELECTRON_RUN_AS_NODE child. A user or admin task-kill on Windows. Signal propagation from Orca's main process restart.

Understand the failure class

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/e9dd9a780fce39e8. Report an issue: GitHub.