@tarcisiopgs/lisa 1.38.3 → 1.38.5

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.
@@ -1188,6 +1188,27 @@ function emptyCommitFailure(result) {
1188
1188
  ]
1189
1189
  });
1190
1190
  }
1191
+ async function pullBaseBranch(config) {
1192
+ const workspace = resolve3(config.workspace);
1193
+ const baseBranch = config.base_branch;
1194
+ const repoPaths = [workspace];
1195
+ if (config.repos.length > 0) {
1196
+ for (const repo of config.repos) {
1197
+ repoPaths.push(resolve3(workspace, repo.path));
1198
+ }
1199
+ }
1200
+ for (const repoPath of repoPaths) {
1201
+ try {
1202
+ await execa("git", ["pull", "--ff-only", "origin", baseBranch], {
1203
+ cwd: repoPath,
1204
+ reject: true,
1205
+ timeout: 3e4
1206
+ });
1207
+ } catch (err) {
1208
+ warn(`Failed to pull ${baseBranch} in ${repoPath}: ${formatError(err)}`);
1209
+ }
1210
+ }
1211
+ }
1191
1212
  function appendSessionLog(logFile, result) {
1192
1213
  try {
1193
1214
  appendFileSync(
@@ -2656,7 +2677,11 @@ function cleanupManifest(cwd, issueId) {
2656
2677
  function readManifestFile(filePath) {
2657
2678
  if (!existsSync6(filePath)) return null;
2658
2679
  try {
2659
- return JSON.parse(readFileSync6(filePath, "utf-8").trim());
2680
+ const parsed = JSON.parse(readFileSync6(filePath, "utf-8").trim());
2681
+ if (Array.isArray(parsed)) {
2682
+ return parsed.find((m) => m.prUrl) ?? null;
2683
+ }
2684
+ return parsed;
2660
2685
  } catch {
2661
2686
  return null;
2662
2687
  }
@@ -3505,6 +3530,7 @@ async function runConcurrentLoop(config, source, models, workspace, opts) {
3505
3530
  kanbanEmitter.emit("issue:started", issue.id);
3506
3531
  await moveToInProgress(issue, source, config);
3507
3532
  activeCleanups.set(issue.id, { previousStatus, source, sourceConfig: config.source_config });
3533
+ await pullBaseBranch(config);
3508
3534
  let sessionResult;
3509
3535
  try {
3510
3536
  sessionResult = await runWorktreeSession(
@@ -3890,10 +3916,25 @@ async function runBranchSession(config, issue, logFile, session, models, source,
3890
3916
  await reporter.fail("Implementation failed");
3891
3917
  return failureResult(result.providerUsed, result);
3892
3918
  }
3893
- const hasChanges = await hasCodeChanges(workspace, config.base_branch);
3894
- if (!hasChanges) {
3895
- await reporter.fail("No code changes produced");
3896
- return emptyCommitFailure(result);
3919
+ const manifest = readManifestFile(manifestPath);
3920
+ try {
3921
+ unlinkSync4(manifestPath);
3922
+ } catch {
3923
+ }
3924
+ let prUrl = manifest?.prUrl;
3925
+ if (!prUrl) {
3926
+ const extractedUrl = extractPrUrlFromOutput(result.output);
3927
+ if (extractedUrl) {
3928
+ warn(`Manifest missing prUrl for ${issue.id}, extracted from output: ${extractedUrl}`);
3929
+ prUrl = extractedUrl;
3930
+ }
3931
+ }
3932
+ if (!prUrl) {
3933
+ const hasChanges = await hasCodeChanges(workspace, config.base_branch);
3934
+ if (!hasChanges) {
3935
+ await reporter.fail("No code changes produced");
3936
+ return emptyCommitFailure(result);
3937
+ }
3897
3938
  }
3898
3939
  const pow = await runProofOfWork(
3899
3940
  config,
@@ -3937,22 +3978,10 @@ async function runBranchSession(config, issue, logFile, session, models, source,
3937
3978
  await reporter.fail("Spec compliance failed");
3938
3979
  return failureResult(result.providerUsed, result);
3939
3980
  }
3940
- const manifest = readManifestFile(manifestPath);
3941
- try {
3942
- unlinkSync4(manifestPath);
3943
- } catch {
3944
- }
3945
- let prUrl = manifest?.prUrl;
3946
3981
  if (!prUrl) {
3947
- const extractedUrl = extractPrUrlFromOutput(result.output);
3948
- if (extractedUrl) {
3949
- warn(`Manifest missing prUrl for ${issue.id}, extracted from output: ${extractedUrl}`);
3950
- prUrl = extractedUrl;
3951
- } else {
3952
- error(`Agent did not produce a manifest with prUrl for ${issue.id}.`);
3953
- await reporter.fail("No PR URL produced");
3954
- return failureResult(result.providerUsed, result);
3955
- }
3982
+ error(`Agent did not produce a manifest with prUrl for ${issue.id}.`);
3983
+ await reporter.fail("No PR URL produced");
3984
+ return failureResult(result.providerUsed, result);
3956
3985
  }
3957
3986
  ok(`PR created by provider: ${prUrl}`);
3958
3987
  await appendPlatformAttribution(prUrl, result.providerUsed, config.platform);
@@ -4142,6 +4171,7 @@ async function runSequentialLoop(config, source, models, workspace, opts) {
4142
4171
  kanbanEmitter.emit("issue:started", issue.id);
4143
4172
  await moveToInProgress(issue, source, config);
4144
4173
  activeCleanups.set(issue.id, { previousStatus, source, sourceConfig: config.source_config });
4174
+ await pullBaseBranch(config);
4145
4175
  let sessionResult;
4146
4176
  try {
4147
4177
  sessionResult = config.workflow === "worktree" ? await runWorktreeSession(config, issue, logFile, session, models, source) : await runBranchSession(config, issue, logFile, session, models, source);
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  runLoop,
15
15
  saveConfig,
16
16
  validateConfig
17
- } from "./chunk-MT25TNW3.js";
17
+ } from "./chunk-CR3KNSTM.js";
18
18
  import {
19
19
  CliError,
20
20
  buildExecutionWaves,
@@ -1850,7 +1850,7 @@ async function reviewAndCreate(plan2, planPath, opts) {
1850
1850
  log("Run `lisa run` when ready.");
1851
1851
  return;
1852
1852
  }
1853
- const { runLoop: runLoop2 } = await import("./loop-FR2ZJUX5.js");
1853
+ const { runLoop: runLoop2 } = await import("./loop-ZPBH3SLB.js");
1854
1854
  const waves = buildExecutionWaves(plan2.issues);
1855
1855
  const maxWaveSize = Math.max(...waves.map((w) => w.length));
1856
1856
  await runLoop2(config2, {
@@ -4,7 +4,7 @@ import {
4
4
  cleanupEventListeners,
5
5
  runDemoLoop,
6
6
  runLoop
7
- } from "./chunk-MT25TNW3.js";
7
+ } from "./chunk-CR3KNSTM.js";
8
8
  import {
9
9
  WATCH_POLL_INTERVAL_MS
10
10
  } from "./chunk-246P5Z5G.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarcisiopgs/lisa",
3
- "version": "1.38.3",
3
+ "version": "1.38.5",
4
4
  "description": "Autonomous issue resolver",
5
5
  "keywords": [
6
6
  "loop",