@pushpalsdev/cli 1.0.78 → 1.0.79
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/package.json
CHANGED
|
@@ -2053,6 +2053,10 @@ async function runProcessWithNode(command, opts) {
|
|
|
2053
2053
|
});
|
|
2054
2054
|
}
|
|
2055
2055
|
var cachedCodexCommandPrefix = new Map;
|
|
2056
|
+
function bunCodexCommandFromEnv(env) {
|
|
2057
|
+
const bunBin = (env.PUSHPALS_BUN_BIN ?? "").trim();
|
|
2058
|
+
return bunBin ? [bunBin, "x", "--yes", "@openai/codex"] : [];
|
|
2059
|
+
}
|
|
2056
2060
|
async function resolveCodexCommandPrefix(configuredCommand) {
|
|
2057
2061
|
const override = codexCommandOverrideParts(configuredCommand);
|
|
2058
2062
|
const cacheKey = override.join("\x00");
|
|
@@ -2071,6 +2075,7 @@ async function resolveCodexCommandPrefix(configuredCommand) {
|
|
|
2071
2075
|
candidates.push(cmd);
|
|
2072
2076
|
};
|
|
2073
2077
|
pushCandidate(preferred);
|
|
2078
|
+
pushCandidate(bunCodexCommandFromEnv(process.env));
|
|
2074
2079
|
const execPath = (process.execPath ?? "").trim();
|
|
2075
2080
|
if (execPath) {
|
|
2076
2081
|
const lower = execPath.toLowerCase();
|
|
@@ -4491,6 +4496,12 @@ function asNumber(value, fallback = 0) {
|
|
|
4491
4496
|
const n = Number(value);
|
|
4492
4497
|
return Number.isFinite(n) ? n : fallback;
|
|
4493
4498
|
}
|
|
4499
|
+
function compactStatusDetail(value, max = 240) {
|
|
4500
|
+
const normalized = value.replace(/\s+/g, " ").trim();
|
|
4501
|
+
if (normalized.length <= max)
|
|
4502
|
+
return normalized;
|
|
4503
|
+
return `${normalized.slice(0, Math.max(0, max - 3))}...`;
|
|
4504
|
+
}
|
|
4494
4505
|
function uniqueLowercaseTokens(values, max = 24) {
|
|
4495
4506
|
const out = [];
|
|
4496
4507
|
const seen = new Set;
|
|
@@ -6050,6 +6061,9 @@ class RemoteBuddyAutonomousEngine {
|
|
|
6050
6061
|
const maxPhaseTimeoutMs = Math.max(this.phaseTimeoutMs("ideation"), this.phaseTimeoutMs("scoring"), this.phaseTimeoutMs("planning"));
|
|
6051
6062
|
return Math.max(this.cfg.tickIntervalMs * 3, this.cfg.ideationBudgetMs * 2 + maxPhaseTimeoutMs * 6, 30000);
|
|
6052
6063
|
}
|
|
6064
|
+
lockStaleAfterMs() {
|
|
6065
|
+
return Math.max(this.phaseTimeoutMs("ideation") + 30000, this.cfg.heartbeatLogMs * 2, 120000);
|
|
6066
|
+
}
|
|
6053
6067
|
cycleBudgetMs() {
|
|
6054
6068
|
const ideationTimeoutMs = this.phaseTimeoutMs("ideation");
|
|
6055
6069
|
const scoringTimeoutMs = this.phaseTimeoutMs("scoring");
|
|
@@ -6360,10 +6374,15 @@ class RemoteBuddyAutonomousEngine {
|
|
|
6360
6374
|
body: JSON.stringify({
|
|
6361
6375
|
sessionId: this.sessionId,
|
|
6362
6376
|
runId,
|
|
6363
|
-
ttlMs
|
|
6377
|
+
ttlMs,
|
|
6378
|
+
staleAfterMs: this.lockStaleAfterMs()
|
|
6364
6379
|
})
|
|
6365
6380
|
});
|
|
6366
|
-
|
|
6381
|
+
if (res.ok)
|
|
6382
|
+
return { ok: true };
|
|
6383
|
+
const payload = await res.json().catch(() => ({}));
|
|
6384
|
+
const reason = asString2(payload.reason ?? payload.message);
|
|
6385
|
+
return { ok: false, reason };
|
|
6367
6386
|
}
|
|
6368
6387
|
async renewDispatchLock(runId) {
|
|
6369
6388
|
const res = await fetch(`${this.server}/autonomy/lock/renew`, {
|
|
@@ -6666,9 +6685,10 @@ ${JSON.stringify(input.messages ?? [])}`),
|
|
|
6666
6685
|
let outcomeDetail = "not_dispatched";
|
|
6667
6686
|
try {
|
|
6668
6687
|
this.setPhase("acquire_lock");
|
|
6669
|
-
|
|
6688
|
+
const lockResult = await this.acquireDispatchLock(runId);
|
|
6689
|
+
lockAcquired = lockResult.ok;
|
|
6670
6690
|
if (!lockAcquired) {
|
|
6671
|
-
outcomeDetail = "lock_not_acquired";
|
|
6691
|
+
outcomeDetail = lockResult.reason ? compactStatusDetail(`lock_not_acquired:${lockResult.reason}`) : "lock_not_acquired";
|
|
6672
6692
|
return;
|
|
6673
6693
|
}
|
|
6674
6694
|
this.setPhase("prepare_worktree");
|