baro-ai 0.59.0 → 0.59.2
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/runner.mjs +15 -3
- package/dist/runner.mjs.map +1 -1
- package/package.json +1 -1
package/dist/runner.mjs
CHANGED
|
@@ -3734,7 +3734,7 @@ var url = process.env.CONTROL_URL ?? "wss://api.baro.jigjoy.ai";
|
|
|
3734
3734
|
var token = process.env.RUNNER_TOKEN;
|
|
3735
3735
|
var httpBase = url.replace(/^ws/, "http").replace(/\/+$/, "");
|
|
3736
3736
|
var credsPath = join(homedir(), ".baro", "credentials.json");
|
|
3737
|
-
var VERSION = "0.59.
|
|
3737
|
+
var VERSION = "0.59.2";
|
|
3738
3738
|
var updateCachePath = join(homedir(), ".baro", "update-check.json");
|
|
3739
3739
|
function semverLt(a, b) {
|
|
3740
3740
|
const pa = a.split(".").map(Number);
|
|
@@ -3855,6 +3855,10 @@ async function runGoal(d, emit, signal) {
|
|
|
3855
3855
|
} catch {
|
|
3856
3856
|
diffBase = void 0;
|
|
3857
3857
|
}
|
|
3858
|
+
try {
|
|
3859
|
+
execFileSync("git", ["remote", "remove", "origin"], { cwd });
|
|
3860
|
+
} catch {
|
|
3861
|
+
}
|
|
3858
3862
|
} else {
|
|
3859
3863
|
env.GH_TOKEN = d.githubToken;
|
|
3860
3864
|
env.GITHUB_TOKEN = d.githubToken;
|
|
@@ -3878,6 +3882,7 @@ async function runGoal(d, emit, signal) {
|
|
|
3878
3882
|
let passed = 0;
|
|
3879
3883
|
let failed = 0;
|
|
3880
3884
|
let doneSuccess = null;
|
|
3885
|
+
let lastErr = "";
|
|
3881
3886
|
let stderrTail = "";
|
|
3882
3887
|
let buf = "";
|
|
3883
3888
|
child.stdout?.on("data", (chunk) => {
|
|
@@ -3899,6 +3904,11 @@ async function runGoal(d, emit, signal) {
|
|
|
3899
3904
|
if (ev.type === "story_complete") passed++;
|
|
3900
3905
|
else if (ev.type === "story_error") failed++;
|
|
3901
3906
|
else if (ev.type === "done") doneSuccess = !!ev.success;
|
|
3907
|
+
const d2 = ev.data ?? {};
|
|
3908
|
+
const msg = d2.error ?? d2.message ?? ev.error;
|
|
3909
|
+
if (typeof msg === "string" && msg.trim() && (String(ev.type).includes("error") || String(ev.type).includes("fail") || ev.type === "done" && ev.success === false)) {
|
|
3910
|
+
lastErr = msg.trim();
|
|
3911
|
+
}
|
|
3902
3912
|
}
|
|
3903
3913
|
});
|
|
3904
3914
|
child.stderr?.on("data", (chunk) => {
|
|
@@ -3907,13 +3917,15 @@ async function runGoal(d, emit, signal) {
|
|
|
3907
3917
|
signal.addEventListener("abort", () => child.kill("SIGTERM"));
|
|
3908
3918
|
child.on("close", (code) => {
|
|
3909
3919
|
const ok = doneSuccess ?? (code === 0 && failed === 0 && passed > 0);
|
|
3910
|
-
const
|
|
3920
|
+
const goalLines = new Set(d.goal.split("\n").map((s) => s.trim()).filter(Boolean));
|
|
3921
|
+
const errTail = stderrTail.trim().split("\n").map((s) => s.trim()).filter((l) => l && l !== "User goal:" && !l.startsWith("User goal:") && !goalLines.has(l)).slice(-3).join(" \xB7 ").slice(-500);
|
|
3911
3922
|
resolve({
|
|
3912
3923
|
success: ok,
|
|
3913
3924
|
durationSecs: secs(),
|
|
3914
3925
|
storiesPassed: passed,
|
|
3915
3926
|
storiesTotal: stories.size || passed + failed,
|
|
3916
|
-
|
|
3927
|
+
// Prefer the real reason from the stream, then cleaned stderr, then a fallback.
|
|
3928
|
+
error: ok ? null : lastErr || errTail || (doneSuccess === false ? "run reported failure" : `exit ${code} \u2014 the run ended without a result (is the claude/codex CLI signed in on this runner?)`)
|
|
3917
3929
|
});
|
|
3918
3930
|
});
|
|
3919
3931
|
child.on("error", (e) => resolve({ success: false, durationSecs: secs(), error: e.message }));
|