@kody-ade/kody-engine 0.3.75 → 0.3.76

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