@kody-ade/kody-engine 0.3.54 → 0.3.55
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/bin/kody.js +30 -4
- package/package.json +1 -1
package/dist/bin/kody.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// package.json
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "@kody-ade/kody-engine",
|
|
6
|
-
version: "0.3.
|
|
6
|
+
version: "0.3.55",
|
|
7
7
|
description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
|
|
8
8
|
license: "MIT",
|
|
9
9
|
type: "module",
|
|
@@ -1480,10 +1480,23 @@ function commitAndPush(branch, agentMessage, cwd) {
|
|
|
1480
1480
|
const sha = git(["rev-parse", "HEAD"], cwd).slice(0, 7);
|
|
1481
1481
|
try {
|
|
1482
1482
|
git(["push", "-u", "origin", branch], cwd);
|
|
1483
|
-
|
|
1484
|
-
|
|
1483
|
+
return { committed: true, pushed: true, sha, message };
|
|
1484
|
+
} catch (firstErr) {
|
|
1485
|
+
try {
|
|
1486
|
+
git(["push", "--force-with-lease", "-u", "origin", branch], cwd);
|
|
1487
|
+
return { committed: true, pushed: true, sha, message };
|
|
1488
|
+
} catch (secondErr) {
|
|
1489
|
+
const tail = (secondErr instanceof Error ? secondErr.message : String(secondErr)).slice(-400);
|
|
1490
|
+
const initial = firstErr instanceof Error ? firstErr.message : String(firstErr);
|
|
1491
|
+
return {
|
|
1492
|
+
committed: true,
|
|
1493
|
+
pushed: false,
|
|
1494
|
+
sha,
|
|
1495
|
+
message,
|
|
1496
|
+
pushError: `push failed: ${initial.slice(-200)} | force-with-lease failed: ${tail}`
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1485
1499
|
}
|
|
1486
|
-
return { committed: true, pushed: true, sha, message };
|
|
1487
1500
|
}
|
|
1488
1501
|
function hasCommitsAhead(branch, defaultBranch, cwd) {
|
|
1489
1502
|
try {
|
|
@@ -2107,6 +2120,16 @@ var commitAndPush2 = async (ctx) => {
|
|
|
2107
2120
|
ctx.data.commitResult = result;
|
|
2108
2121
|
const postCommitFiles = result.committed ? listFilesInCommit("HEAD", ctx.cwd) : listChangedFiles(ctx.cwd);
|
|
2109
2122
|
ctx.data.changedFiles = postCommitFiles.filter((f) => !isForbiddenPath(f));
|
|
2123
|
+
if (result.committed && !result.pushed) {
|
|
2124
|
+
const reason = result.pushError ?? "push failed (no error detail)";
|
|
2125
|
+
ctx.data.commitCrash = reason;
|
|
2126
|
+
if (ctx.output.exitCode === void 0 || ctx.output.exitCode === 0) {
|
|
2127
|
+
ctx.output.exitCode = 4;
|
|
2128
|
+
}
|
|
2129
|
+
if (!ctx.output.reason) ctx.output.reason = reason;
|
|
2130
|
+
process.stderr.write(`[kody commitAndPush] ${reason}
|
|
2131
|
+
`);
|
|
2132
|
+
}
|
|
2110
2133
|
} catch (err) {
|
|
2111
2134
|
const reason = err instanceof Error ? err.message : String(err);
|
|
2112
2135
|
ctx.data.commitCrash = reason;
|
|
@@ -3316,6 +3339,9 @@ var ensurePr2 = async (ctx) => {
|
|
|
3316
3339
|
if (!commitResult?.committed && !hasCommits) {
|
|
3317
3340
|
return;
|
|
3318
3341
|
}
|
|
3342
|
+
if (commitResult?.committed && commitResult.pushed === false) {
|
|
3343
|
+
return;
|
|
3344
|
+
}
|
|
3319
3345
|
const branch = ctx.data.branch;
|
|
3320
3346
|
if (!branch) return;
|
|
3321
3347
|
const failureReason = computeFailureReason(ctx);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kody-ade/kody-engine",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.55",
|
|
4
4
|
"description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|