fix: parse escaped retryable error messages
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
DEFAULT_REASONING_MATCH_MODE,
|
||||
DEFAULT_STATE_ROOT,
|
||||
ensureDirectory,
|
||||
expandEscapedLineBreaks,
|
||||
getCodexProviderContext,
|
||||
getGatewayBaseUrl,
|
||||
getGatewayStatePaths,
|
||||
@@ -47,13 +48,16 @@ function parseEnvFile(content) {
|
||||
}
|
||||
const key = line.slice(0, separatorIndex).trim();
|
||||
let value = line.slice(separatorIndex + 1).trim();
|
||||
if (
|
||||
(value.startsWith('"') && value.endsWith('"')) ||
|
||||
(value.startsWith("'") && value.endsWith("'"))
|
||||
) {
|
||||
if (value.startsWith('"') && value.endsWith('"')) {
|
||||
try {
|
||||
value = JSON.parse(value);
|
||||
} catch {
|
||||
value = value.slice(1, -1);
|
||||
}
|
||||
} else if (value.startsWith("'") && value.endsWith("'")) {
|
||||
value = value.slice(1, -1);
|
||||
}
|
||||
parsed[key] = value;
|
||||
parsed[key] = typeof value === "string" ? expandEscapedLineBreaks(value) : value;
|
||||
}
|
||||
return parsed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user