@kody-ade/kody-engine 0.3.75 → 0.3.77
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 +24 -1
- 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.77",
|
|
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",
|
|
@@ -737,6 +737,7 @@ async function runInteractiveMode(opts) {
|
|
|
737
737
|
idleExitMs,
|
|
738
738
|
hardCapMs
|
|
739
739
|
});
|
|
740
|
+
if (!opts.skipGit) commitTurn(opts.cwd, opts.sessionId, opts.verbose ?? false);
|
|
740
741
|
let watermark = 0;
|
|
741
742
|
let turnsCompleted = 0;
|
|
742
743
|
while (true) {
|
|
@@ -754,10 +755,12 @@ async function runInteractiveMode(opts) {
|
|
|
754
755
|
});
|
|
755
756
|
if (result.kind === "idle-timeout") {
|
|
756
757
|
await emitExit(opts, "idle-timeout", turnsCompleted);
|
|
758
|
+
if (!opts.skipGit) commitTurn(opts.cwd, opts.sessionId, opts.verbose ?? false);
|
|
757
759
|
return { exitCode: 0, reason: "idle-timeout", turnsCompleted };
|
|
758
760
|
}
|
|
759
761
|
if (result.kind === "deadline") {
|
|
760
762
|
await emitExit(opts, "deadline", turnsCompleted);
|
|
763
|
+
if (!opts.skipGit) commitTurn(opts.cwd, opts.sessionId, opts.verbose ?? false);
|
|
761
764
|
return { exitCode: 0, reason: "deadline", turnsCompleted };
|
|
762
765
|
}
|
|
763
766
|
}
|
|
@@ -778,6 +781,7 @@ async function runInteractiveMode(opts) {
|
|
|
778
781
|
const msg = err instanceof Error ? err.message : String(err);
|
|
779
782
|
await emit2(opts.sink, "chat.error", opts.sessionId, `loop-${turnsCompleted}`, { error: msg });
|
|
780
783
|
await emitExit(opts, "fatal", turnsCompleted);
|
|
784
|
+
if (!opts.skipGit) commitTurn(opts.cwd, opts.sessionId, opts.verbose ?? false);
|
|
781
785
|
return { exitCode: 99, reason: "fatal", turnsCompleted };
|
|
782
786
|
}
|
|
783
787
|
if (turnResult.exitCode === 64) {
|
|
@@ -5668,6 +5672,11 @@ var persistFlowState = async (ctx) => {
|
|
|
5668
5672
|
};
|
|
5669
5673
|
|
|
5670
5674
|
// src/scripts/postIssueComment.ts
|
|
5675
|
+
var FAILED_LABEL_SPEC = {
|
|
5676
|
+
label: "kody:failed",
|
|
5677
|
+
color: "e11d21",
|
|
5678
|
+
description: "kody: flow failed"
|
|
5679
|
+
};
|
|
5671
5680
|
var postIssueComment2 = async (ctx) => {
|
|
5672
5681
|
if (ctx.skipAgent && ctx.output.exitCode !== void 0) return;
|
|
5673
5682
|
const targetType = ctx.data.commentTargetType;
|
|
@@ -5680,12 +5689,14 @@ var postIssueComment2 = async (ctx) => {
|
|
|
5680
5689
|
if (!commitResult?.committed && !hasCommits) {
|
|
5681
5690
|
const reason = "no changes to commit";
|
|
5682
5691
|
postWith(targetType, targetNumber, `\u26A0\uFE0F kody FAILED: ${reason}`, ctx.cwd);
|
|
5692
|
+
markRunFailed(ctx);
|
|
5683
5693
|
ctx.output.exitCode = 3;
|
|
5684
5694
|
ctx.output.reason = reason;
|
|
5685
5695
|
return;
|
|
5686
5696
|
}
|
|
5687
5697
|
if (ctx.output.exitCode === 4 && ctx.data.prCrashReason) {
|
|
5688
5698
|
postWith(targetType, targetNumber, `\u26A0\uFE0F kody FAILED: ${truncate2(ctx.data.prCrashReason, 1500)}`, ctx.cwd);
|
|
5699
|
+
markRunFailed(ctx);
|
|
5689
5700
|
ctx.output.reason = ctx.data.prCrashReason;
|
|
5690
5701
|
return;
|
|
5691
5702
|
}
|
|
@@ -5710,9 +5721,21 @@ var postIssueComment2 = async (ctx) => {
|
|
|
5710
5721
|
const misses = ctx.data.coverageMisses ?? [];
|
|
5711
5722
|
if (!agentDone || misses.length > 0) exitCode = 1;
|
|
5712
5723
|
else if (!verifyOk) exitCode = 2;
|
|
5724
|
+
if (exitCode !== 0) markRunFailed(ctx);
|
|
5713
5725
|
ctx.output.exitCode = exitCode;
|
|
5714
5726
|
ctx.output.reason = failureReason || void 0;
|
|
5715
5727
|
};
|
|
5728
|
+
function markRunFailed(ctx) {
|
|
5729
|
+
const issueNumber = ctx.args.issue;
|
|
5730
|
+
if (typeof issueNumber === "number" && Number.isFinite(issueNumber)) {
|
|
5731
|
+
setKodyLabel(issueNumber, FAILED_LABEL_SPEC, ctx.cwd);
|
|
5732
|
+
}
|
|
5733
|
+
const targetType = ctx.data.commentTargetType;
|
|
5734
|
+
const targetNumber = Number(ctx.data.commentTargetNumber ?? 0);
|
|
5735
|
+
if (targetType === "pr" && targetNumber > 0 && targetNumber !== issueNumber) {
|
|
5736
|
+
setKodyLabel(targetNumber, FAILED_LABEL_SPEC, ctx.cwd);
|
|
5737
|
+
}
|
|
5738
|
+
}
|
|
5716
5739
|
function computeFailureSuffix(input) {
|
|
5717
5740
|
if (input.prUrl) {
|
|
5718
5741
|
return input.prAction === "updated" ? ` \u2014 PR: ${input.prUrl}` : ` \u2014 draft PR: ${input.prUrl}`;
|
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.77",
|
|
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",
|