@kody-ade/kody-engine-lite 0.1.38 → 0.1.41
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/cli.js +26 -5
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -1081,7 +1081,7 @@ var init_verify_runner = __esm({
|
|
|
1081
1081
|
|
|
1082
1082
|
// src/observer.ts
|
|
1083
1083
|
import { execFileSync as execFileSync5 } from "child_process";
|
|
1084
|
-
async function diagnoseFailure(stageName, errorOutput, modifiedFiles, runner, model) {
|
|
1084
|
+
async function diagnoseFailure(stageName, errorOutput, modifiedFiles, runner, model, options) {
|
|
1085
1085
|
const context = [
|
|
1086
1086
|
`Stage: ${stageName}`,
|
|
1087
1087
|
``,
|
|
@@ -1100,7 +1100,8 @@ ${modifiedFiles.map((f) => `- ${f}`).join("\n")}` : "No files were modified (bui
|
|
|
1100
1100
|
model,
|
|
1101
1101
|
3e4,
|
|
1102
1102
|
// 30s timeout — this should be fast
|
|
1103
|
-
""
|
|
1103
|
+
"",
|
|
1104
|
+
options
|
|
1104
1105
|
);
|
|
1105
1106
|
if (result.outcome === "completed" && result.output) {
|
|
1106
1107
|
const cleaned = result.output.replace(/^```json\s*\n?/m, "").replace(/\n?```\s*$/m, "").trim();
|
|
@@ -1247,12 +1248,18 @@ async function executeVerifyWithAutofix(ctx, def) {
|
|
|
1247
1248
|
const errorOutput = fs7.existsSync(verifyPath) ? fs7.readFileSync(verifyPath, "utf-8") : "Unknown error";
|
|
1248
1249
|
const modifiedFiles = getModifiedFiles(ctx.projectDir);
|
|
1249
1250
|
const defaultRunner = getRunnerForStage(ctx, "taskify");
|
|
1251
|
+
const diagConfig = getProjectConfig();
|
|
1252
|
+
const diagEnv = {};
|
|
1253
|
+
if (diagConfig.agent.litellmUrl) {
|
|
1254
|
+
diagEnv.ANTHROPIC_BASE_URL = diagConfig.agent.litellmUrl;
|
|
1255
|
+
}
|
|
1250
1256
|
const diagnosis = await diagnoseFailure(
|
|
1251
1257
|
"verify",
|
|
1252
1258
|
errorOutput,
|
|
1253
1259
|
modifiedFiles,
|
|
1254
1260
|
defaultRunner,
|
|
1255
|
-
resolveModel("cheap")
|
|
1261
|
+
resolveModel("cheap"),
|
|
1262
|
+
{ cwd: ctx.projectDir, env: diagEnv }
|
|
1256
1263
|
);
|
|
1257
1264
|
if (diagnosis.classification === "infrastructure") {
|
|
1258
1265
|
logger.warn(` Infrastructure issue: ${diagnosis.reason}`);
|
|
@@ -1633,6 +1640,7 @@ function applyPreStageLabel(ctx, def) {
|
|
|
1633
1640
|
function checkQuestionsAfterStage(ctx, def, state) {
|
|
1634
1641
|
if (def.name !== "taskify" && def.name !== "plan") return null;
|
|
1635
1642
|
if (ctx.input.dryRun) return null;
|
|
1643
|
+
if (ctx.input.mode === "rerun") return null;
|
|
1636
1644
|
const paused = checkForQuestions(ctx, def.name);
|
|
1637
1645
|
if (!paused) return null;
|
|
1638
1646
|
state.state = "failed";
|
|
@@ -1987,7 +1995,15 @@ ${previousText}
|
|
|
1987
1995
|
`;
|
|
1988
1996
|
const runner = getRunnerForStage(ctx, "taskify");
|
|
1989
1997
|
const model = resolveModel("cheap");
|
|
1990
|
-
const
|
|
1998
|
+
const config = getProjectConfig();
|
|
1999
|
+
const extraEnv = {};
|
|
2000
|
+
if (config.agent.litellmUrl) {
|
|
2001
|
+
extraEnv.ANTHROPIC_BASE_URL = config.agent.litellmUrl;
|
|
2002
|
+
}
|
|
2003
|
+
const result = await runner.run("retrospective", prompt, model, 3e4, "", {
|
|
2004
|
+
cwd: ctx.projectDir,
|
|
2005
|
+
env: extraEnv
|
|
2006
|
+
});
|
|
1991
2007
|
let observation = "Retrospective analysis unavailable";
|
|
1992
2008
|
let patternMatch = null;
|
|
1993
2009
|
let suggestion = "No suggestion";
|
|
@@ -2048,6 +2064,7 @@ var init_retrospective = __esm({
|
|
|
2048
2064
|
"use strict";
|
|
2049
2065
|
init_definitions();
|
|
2050
2066
|
init_context();
|
|
2067
|
+
init_config();
|
|
2051
2068
|
init_runner_selection();
|
|
2052
2069
|
init_logger();
|
|
2053
2070
|
RETROSPECTIVE_PROMPT = `You are a pipeline retrospective analyst. You observe automated software development pipeline runs and identify flaws, patterns, and improvement opportunities.
|
|
@@ -2574,7 +2591,7 @@ function resolveForIssue(issueNumber, projectDir) {
|
|
|
2574
2591
|
return { action: "already-completed", taskId: `${issueNumber}-unknown` };
|
|
2575
2592
|
}
|
|
2576
2593
|
if (labels.includes("kody:waiting")) {
|
|
2577
|
-
return { action: "resume", taskId: `${issueNumber}-${generateTaskId()}`, fromStage: "
|
|
2594
|
+
return { action: "resume", taskId: `${issueNumber}-${generateTaskId()}`, fromStage: "taskify" };
|
|
2578
2595
|
}
|
|
2579
2596
|
} catch {
|
|
2580
2597
|
}
|
|
@@ -2705,6 +2722,10 @@ ${issue.body ?? ""}`;
|
|
|
2705
2722
|
} else {
|
|
2706
2723
|
logger.info(`LiteLLM proxy already running at ${config.agent.litellmUrl}`);
|
|
2707
2724
|
}
|
|
2725
|
+
if (config.agent.litellmUrl) {
|
|
2726
|
+
process.env.ANTHROPIC_BASE_URL = config.agent.litellmUrl;
|
|
2727
|
+
logger.info(`ANTHROPIC_BASE_URL set to ${config.agent.litellmUrl}`);
|
|
2728
|
+
}
|
|
2708
2729
|
}
|
|
2709
2730
|
const runners = createRunners(config);
|
|
2710
2731
|
const defaultRunnerName = config.agent.defaultRunner ?? Object.keys(runners)[0] ?? "claude";
|