mirror of
https://github.com/stablyai/orca.git
synced 2026-11-18 11:54:46 +00:00
fix(codex): stop warning about absent session day folders and a missing Codex CLI (#43286)
The rollout walker warned on every opendir error after its caller's handler had already classified it, so each pending backfill date without a day folder logged ENOENT at startup. The index heal logged a stack trace for every pass on a machine without Codex. Absence is now an empty listing, and a missing CLI aborts the heal quietly for a later retry, like the Codex model catalog probe already does. Co-authored-by: Bensonluo <18586615+Bensonluo@users.noreply.github.com> Co-authored-by: Pr1p <48266347+Pr1p@users.noreply.github.com>
This commit is contained in:
co-authored by
Bensonluo
Pr1p
parent
83a59aa684
commit
16b95e73b0
@@ -1,6 +1,7 @@
|
||||
import { dirname, join } from 'node:path'
|
||||
import { resolveCodexCommand } from '../../../codex-cli/command'
|
||||
import { isTransientSqliteContention } from '../../../sqlite/sqlite-read-failure'
|
||||
import { isMissingProviderExecutable } from '../../../provider-process/provider-executable-missing'
|
||||
import { CODEX_SHORT_LIVED_PROBE_APP_SERVER_ARGS } from '../../../codex-cli/codex-read-only-app-server-args'
|
||||
import { buildWslCodexAppServerArgs } from '../../../codex-cli/wsl-codex-command'
|
||||
import { resolveWslExecutablePath } from '../../../wsl/execution/wsl-executable-path'
|
||||
@@ -189,8 +190,9 @@ export async function readCodexThreadsForIndexHeal<T extends { threadId: string
|
||||
const batch = threads.slice(offset, offset + readsPerServerSession)
|
||||
const timeoutMs = HEAL_BATCH_TIMEOUT_BASE_MS + HEAL_BATCH_TIMEOUT_PER_READ_MS * batch.length
|
||||
const settled: CodexSettledThreadRead[] = []
|
||||
const invocation = buildInvocation(codexHomePath, timeoutMs)
|
||||
try {
|
||||
await runSession(buildInvocation(codexHomePath, timeoutMs), async (rpc) => {
|
||||
await runSession(invocation, async (rpc) => {
|
||||
let nextIndex = 0
|
||||
const worker = async (): Promise<void> => {
|
||||
while (nextIndex < batch.length && !shouldStop()) {
|
||||
@@ -211,6 +213,10 @@ export async function readCodexThreadsForIndexHeal<T extends { threadId: string
|
||||
if (isCodexAppServerUnsupportedError(error)) {
|
||||
return 'unsupported'
|
||||
}
|
||||
// Without a Codex CLI there is nothing to heal yet; retry quietly once it is installed.
|
||||
if (isMissingProviderExecutable(error, invocation.command)) {
|
||||
return 'aborted'
|
||||
}
|
||||
console.warn('[codex-session-index-heal] Heal batch aborted:', error)
|
||||
return 'aborted'
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { readdirSync } from 'node:fs'
|
||||
import { opendir } from 'node:fs/promises'
|
||||
import { join } from 'node:path'
|
||||
import { isDefinitiveAbsence } from '../../../../shared/errors/definitive-filesystem-absence'
|
||||
|
||||
export type CodexSessionBridgeIncrementalOptions = {
|
||||
/** Directory entries to process before yielding back to the event loop. */
|
||||
@@ -26,7 +27,7 @@ export function listCodexSessionJsonlFiles(rootPath: string): string[] {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('[codex-session-bridge] Failed to list system Codex sessions:', error)
|
||||
warnUnlessAbsent(error)
|
||||
}
|
||||
return files.sort()
|
||||
}
|
||||
@@ -102,11 +103,18 @@ async function* listCodexSessionFilesIncrementally(
|
||||
}
|
||||
} catch (error) {
|
||||
await onDirectoryError?.(currentDirectory, error)
|
||||
console.warn('[codex-session-bridge] Failed to list system Codex sessions:', error)
|
||||
warnUnlessAbsent(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Day folders exist only for days with sessions, so absence is an empty listing, not a failure.
|
||||
function warnUnlessAbsent(error: unknown): void {
|
||||
if (!isDefinitiveAbsence(error)) {
|
||||
console.warn('[codex-session-bridge] Failed to list system Codex sessions:', error)
|
||||
}
|
||||
}
|
||||
|
||||
function delayIncrementalBridge(ms: number): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(resolve, ms)
|
||||
|
||||
Reference in New Issue
Block a user