Fix timeout handling in health check and remove unused spawnProcess export
- Add timedOut check to version probe so timed-out codex --version is not silently treated as success - Add timedOut guard in parseAuthStatusFromOutput so timed-out auth probes return authStatus 'unknown' instead of falsely reporting 'authenticated' - Remove unnecessary export from spawnProcess (only used internally) Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
1 parent
45745a247a
commit
976009abbd
2 files changed
+10
-2
No files matched your search
@@ -79,7 +79,7 @@ function toSpawnOptions(options: ProcessSpawnOptions) {
|
||||
};
|
||||
}
|
||||
|
||||
export function spawnProcess(
|
||||
function spawnProcess(
|
||||
command: string,
|
||||
args: readonly string[],
|
||||
options: ProcessSpawnOptions = {},
|
||||
|
||||
@@ -109,6 +109,14 @@ export function parseAuthStatusFromOutput(result: CommandResult): {
|
||||
readonly authStatus: ServerProviderAuthStatus;
|
||||
readonly message?: string;
|
||||
} {
|
||||
if (result.timedOut) {
|
||||
return {
|
||||
status: "warning",
|
||||
authStatus: "unknown",
|
||||
message: "Timed out while checking Codex authentication status.",
|
||||
};
|
||||
}
|
||||
|
||||
const lowerOutput = `${result.stdout}\n${result.stderr}`.toLowerCase();
|
||||
|
||||
if (
|
||||
@@ -237,7 +245,7 @@ export const checkCodexProviderStatus = (
|
||||
}
|
||||
|
||||
const version = versionProbe.success;
|
||||
if (version.code !== 0) {
|
||||
if (version.timedOut || version.code !== 0) {
|
||||
const detail = detailFromResult(version);
|
||||
return {
|
||||
provider: CODEX_PROVIDER,
|
||||
|
||||
Reference in new issue
Block a user