oasis_test 0.1.48 → 0.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +22 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38755,10 +38755,26 @@ var init_codex = __esm({
|
|
|
38755
38755
|
if (stdoutErrorLines.length > 10) stdoutErrorLines.shift();
|
|
38756
38756
|
}
|
|
38757
38757
|
};
|
|
38758
|
+
const streamErrorMessages = [];
|
|
38759
|
+
const pushStreamErrorLine = (line) => {
|
|
38760
|
+
let obj;
|
|
38761
|
+
try {
|
|
38762
|
+
obj = JSON.parse(line);
|
|
38763
|
+
} catch {
|
|
38764
|
+
return;
|
|
38765
|
+
}
|
|
38766
|
+
if (obj?.type === "error" && typeof obj.message === "string") {
|
|
38767
|
+
streamErrorMessages.push(obj.message);
|
|
38768
|
+
} else if (obj?.type === "turn.failed" && typeof obj.error?.message === "string") {
|
|
38769
|
+
streamErrorMessages.push(obj.error.message);
|
|
38770
|
+
}
|
|
38771
|
+
if (streamErrorMessages.length > 5) streamErrorMessages.shift();
|
|
38772
|
+
};
|
|
38758
38773
|
const rl = readline2.createInterface({ input: child.stdout });
|
|
38759
38774
|
rl.on("line", (line) => {
|
|
38760
38775
|
out.write(line + "\n");
|
|
38761
38776
|
pushStdoutErrorLine(line);
|
|
38777
|
+
pushStreamErrorLine(line);
|
|
38762
38778
|
emitNormalized(normalizeCodexStreamLine(line, normalizeState));
|
|
38763
38779
|
});
|
|
38764
38780
|
const errRl = readline2.createInterface({ input: child.stderr });
|
|
@@ -38806,11 +38822,13 @@ var init_codex = __esm({
|
|
|
38806
38822
|
const telemetry = scanCodexTelemetry(dir, startedAtMs);
|
|
38807
38823
|
const model = telemetry.model ?? job.model ?? this.opts.model;
|
|
38808
38824
|
const runtimeSessionId = telemetry.sessionId ?? (job.resumeRuntimeSession ? job.runtimeSessionId : void 0);
|
|
38809
|
-
const
|
|
38810
|
-
const
|
|
38825
|
+
const sawStreamError = streamErrorMessages.length > 0;
|
|
38826
|
+
const isError = !killedByUs && (typeof code === "number" && code !== 0 || sawStreamError);
|
|
38827
|
+
const errorMessage = isError ? [...streamErrorMessages, ...stdoutErrorLines, ...stderrTail].join("\n").trim().slice(-4e3) || void 0 : void 0;
|
|
38828
|
+
const reason = killedByUs ? "timeout" : sawStreamError ? "error" : code === 0 ? "clean" : "error";
|
|
38811
38829
|
finish({
|
|
38812
38830
|
code: killedByUs ? null : code,
|
|
38813
|
-
reason
|
|
38831
|
+
reason,
|
|
38814
38832
|
transcriptRef,
|
|
38815
38833
|
...telemetry.usage ? { usage: telemetry.usage } : {},
|
|
38816
38834
|
...model ? { model } : {},
|
|
@@ -58771,7 +58789,7 @@ ${res.warning}`);
|
|
|
58771
58789
|
}
|
|
58772
58790
|
|
|
58773
58791
|
// src/index.ts
|
|
58774
|
-
var PKG_VERSION = true ? "0.1.
|
|
58792
|
+
var PKG_VERSION = true ? "0.1.49" : "dev";
|
|
58775
58793
|
var OASIS_DIR = path19.join(os11.homedir(), ".oasis");
|
|
58776
58794
|
var CONFIG_FILE = path19.join(OASIS_DIR, "node-config.json");
|
|
58777
58795
|
var PID_FILE = path19.join(OASIS_DIR, "node.pid");
|