@kody-ade/kody-engine 0.4.80 → 0.4.81

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 CHANGED
@@ -868,7 +868,7 @@ var init_loadPriorArt = __esm({
868
868
  // package.json
869
869
  var package_default = {
870
870
  name: "@kody-ade/kody-engine",
871
- version: "0.4.80",
871
+ version: "0.4.81",
872
872
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
873
873
  license: "MIT",
874
874
  type: "module",
@@ -1700,6 +1700,9 @@ var CHAT_SYSTEM_PROMPT = [
1700
1700
  "You are Kody, an AI assistant for the Kody Operations Dashboard. Reply to the",
1701
1701
  "user's latest message using the full conversation below as context. Keep replies",
1702
1702
  "short and simple. Prefer one-liners and short paragraphs. Use plain terms, not jargon.",
1703
+ "When you diagnose something, answer in this shape: a few words on the issue, a",
1704
+ "few words on the fix, then a single question asking whether to proceed. Do not",
1705
+ "pad it with preamble, restated context, or a trailing summary.",
1703
1706
  "",
1704
1707
  "# Your environment and capabilities",
1705
1708
  "You run inside a sandboxed runner with a full clone of the user's repository",
@@ -1724,6 +1727,22 @@ var CHAT_SYSTEM_PROMPT = [
1724
1727
  " pytest, go test, cargo, etc., whatever the project uses).",
1725
1728
  " - standard Unix utilities (curl, jq, sed, awk, find, etc.).",
1726
1729
  "",
1730
+ "# Clarify before you act (HARD RULE)",
1731
+ "If the user's request is ambiguous or under-specified \u2014 you can read it two",
1732
+ "plausible ways, or you'd have to guess what they actually want \u2014 ask",
1733
+ "clarifying questions and stop. Ask as many as you genuinely need; do NOT",
1734
+ "pick an interpretation and run with it. This check comes first: confirm",
1735
+ "intent before you start investigating or making changes.",
1736
+ "",
1737
+ "# Answer first, act second (HARD RULE)",
1738
+ "If the user asked a question, answer it \u2014 do not start changing code, running",
1739
+ "mutating commands, or opening PRs. Investigating (read-only Glob/Grep/Read/`git",
1740
+ "log`/`gh ... view`) to ground the answer is expected; making changes is not.",
1741
+ "Before any mutating work (Edit/Write, `git commit`, `gh pr create`, anything",
1742
+ "that alters the repo or remote state) state the plan in a couple of bullets and",
1743
+ "stop for the user's go-ahead. Treat 'can we\u2026', 'is there a way\u2026', 'why does\u2026'",
1744
+ "as questions about what exists, not as instructions to build.",
1745
+ "",
1727
1746
  "# Investigate before you answer (HARD RULE)",
1728
1747
  "Do not answer from assumptions, training memory, or what the code 'probably'",
1729
1748
  "does. Before replying to any question about this repo \u2014 its code, behavior,",
@@ -1854,6 +1873,11 @@ ${catalog}` : basePrompt;
1854
1873
  return { exitCode: 99, error };
1855
1874
  }
1856
1875
  const reply = result.finalText.trim();
1876
+ if (reply.length === 0) {
1877
+ const error = "agent completed without producing a reply \u2014 please resend your message";
1878
+ await emit(opts.sink, "chat.error", opts.sessionId, "error", { error });
1879
+ return { exitCode: 99, error };
1880
+ }
1857
1881
  const now = (/* @__PURE__ */ new Date()).toISOString();
1858
1882
  appendTurn(opts.sessionFile, {
1859
1883
  role: "assistant",
@@ -9409,7 +9433,11 @@ async function handleChatTurn(req, res, chatId, opts) {
9409
9433
  `);
9410
9434
  endTurnIfUnterminated(opts.cwd, chatId, errMsg2);
9411
9435
  }).finally(() => {
9412
- endTurnIfUnterminated(opts.cwd, chatId, "turn ended without a result");
9436
+ endTurnIfUnterminated(
9437
+ opts.cwd,
9438
+ chatId,
9439
+ "Brain turn ended without a reply (the machine may have restarted mid-turn) \u2014 please resend your message"
9440
+ );
9413
9441
  })
9414
9442
  );
9415
9443
  streamToRes(res, opts.cwd, chatId, sinceFloor);
@@ -9809,7 +9837,6 @@ var syncFlow = async (ctx, _profile, args) => {
9809
9837
  if (announceOnSuccess) {
9810
9838
  ctx.output.exitCode = 0;
9811
9839
  ctx.output.reason = `already up to date with origin/${baseBranch}`;
9812
- tryPostPr6(prNumber, `\u2139\uFE0F kody sync: already up to date with origin/${baseBranch}`, ctx.cwd);
9813
9840
  }
9814
9841
  return;
9815
9842
  }
@@ -9824,13 +9851,6 @@ var syncFlow = async (ctx, _profile, args) => {
9824
9851
  if (announceOnSuccess) {
9825
9852
  ctx.output.exitCode = 0;
9826
9853
  ctx.output.reason = `merged origin/${baseBranch} into ${ctx.data.branch}`;
9827
- const runUrl = getRunUrl();
9828
- const runSuffix = runUrl ? ` ([logs](${runUrl}))` : "";
9829
- tryPostPr6(
9830
- prNumber,
9831
- `\u2705 kody sync: merged \`origin/${baseBranch}\` into \`${ctx.data.branch}\`${runSuffix}`,
9832
- ctx.cwd
9833
- );
9834
9854
  }
9835
9855
  };
9836
9856
  function bail2(ctx, prNumber, reason) {
@@ -47,9 +47,9 @@
47
47
  "lifecycle": "pr-branch",
48
48
  "lifecycleConfig": {
49
49
  "label": {
50
- "name": "kody:fixing",
50
+ "name": "kody:fixing-ci",
51
51
  "color": "e99695",
52
- "description": "kody: applying review feedback"
52
+ "description": "kody: fixing CI failures"
53
53
  },
54
54
  "context": "ci-fix",
55
55
  "advance": false
@@ -67,7 +67,7 @@
67
67
  "outputArtifacts": [],
68
68
  "scripts": {
69
69
  "preflight": [
70
- { "script": "setLifecycleLabel", "with": { "label": "kody:reviewing", "color": "d93f0b", "description": "kody: reviewing a PR" } },
70
+ { "script": "setLifecycleLabel", "with": { "label": "kody:reviewing-ui", "color": "d93f0b", "description": "kody: UI-reviewing a PR" } },
71
71
  { "script": "reviewFlow" },
72
72
  { "script": "loadTaskState" },
73
73
  { "script": "loadConventions" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.80",
3
+ "version": "0.4.81",
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",