fix: apply review feedback for the watcher, guarded-save and chat-start stacks (#31216)

Fixes bugs found reviewing #30270, #30605, #30885, #30417, #31113, #30415,
#30992 and #30997, and removes code those PRs made unnecessary.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Neil
2026-10-20 14:07:27 -07:00
committed by GitHub
co-authored by Claude
parent e507a3342a
commit 5f40d0c88b
78 changed files with 802 additions and 512 deletions
+5 -11
View File
@@ -7,6 +7,7 @@ import {
resolveProviderChildEnv,
type ProviderProcessLaunch
} from '../provider-process/provider-process-launch'
import { findInErrorChain } from '../provider-process/provider-error-chain'
export class CodexCliInstallationError extends AgentSessionPreSpawnError {
readonly codexInstallation: CodexInstallationProblem
@@ -26,17 +27,10 @@ export class CodexCliInstallationError extends AgentSessionPreSpawnError {
}
}
export function codexInstallationProblemOf(
error: unknown,
depth = 0
): CodexInstallationProblem | undefined {
if (depth >= 6 || !(error instanceof Error)) {
return undefined
}
if (error instanceof CodexCliInstallationError) {
return error.codexInstallation
}
return codexInstallationProblemOf(error.cause, depth + 1)
export function codexInstallationProblemOf(error: unknown): CodexInstallationProblem | undefined {
return findInErrorChain(error, (inner) =>
inner instanceof CodexCliInstallationError ? inner.codexInstallation : undefined
)
}
export async function requireSupportedCodexCli(