feat(FN-3615): fix Codex weekly pace parsing

Fixed Codex weekly pace parsing in the usage tracking module, with corresponding test coverage added to verify the fix.

Fusion-Task-Id: FN-3615
This commit is contained in:
Fusion
2026-05-06 20:49:42 -07:00
committed by gsxdsm
parent 1258e471c1
commit 4d39e577fd

View File

@@ -33,7 +33,9 @@ function run(command, commandArgs, options = {}) {
});
if (result.status !== 0) {
process.exit(result.status ?? 1);
const error = new Error(`${command} ${commandArgs.join(" ")} failed with exit code ${result.status ?? 1}`);
error.exitCode = result.status ?? 1;
throw error;
}
}
@@ -624,5 +626,12 @@ export function main(argv = process.argv.slice(2)) {
}
if (process.argv[1] && path.resolve(process.argv[1]) === currentFilePath) {
main();
try {
main();
} catch (error) {
if (error?.exitCode) {
process.exit(error.exitCode);
}
throw error;
}
}