Skip to content

Commit 976009a

Browse files
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 <juliusmarminge@users.noreply.github.com>
1 parent 45745a2 commit 976009a

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

apps/server/src/processRunner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function toSpawnOptions(options: ProcessSpawnOptions) {
7979
};
8080
}
8181

82-
export function spawnProcess(
82+
function spawnProcess(
8383
command: string,
8484
args: readonly string[],
8585
options: ProcessSpawnOptions = {},

apps/server/src/provider/Layers/ProviderHealth.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ export function parseAuthStatusFromOutput(result: CommandResult): {
109109
readonly authStatus: ServerProviderAuthStatus;
110110
readonly message?: string;
111111
} {
112+
if (result.timedOut) {
113+
return {
114+
status: "warning",
115+
authStatus: "unknown",
116+
message: "Timed out while checking Codex authentication status.",
117+
};
118+
}
119+
112120
const lowerOutput = `${result.stdout}\n${result.stderr}`.toLowerCase();
113121

114122
if (
@@ -237,7 +245,7 @@ export const checkCodexProviderStatus = (
237245
}
238246

239247
const version = versionProbe.success;
240-
if (version.code !== 0) {
248+
if (version.timedOut || version.code !== 0) {
241249
const detail = detailFromResult(version);
242250
return {
243251
provider: CODEX_PROVIDER,

0 commit comments

Comments
 (0)