lalph 0.3.17 → 0.3.19

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/cli.mjs CHANGED
@@ -152325,6 +152325,7 @@ But you **do not** need to git push your changes or switch branches.
152325
152325
  const prd = yield* Prd;
152326
152326
  const parsed = parseBranch(targetBranch);
152327
152327
  yield* worktree.exec`git fetch ${parsed.remote}`;
152328
+ yield* worktree.exec`git restore --worktree .`;
152328
152329
  if ((yield* worktree.exec`git rebase ${parsed.branchWithRemote}`) !== 0) {
152329
152330
  yield* prd.flagUnmergable({ issueId });
152330
152331
  return yield* new GitFlowError({ message: `Failed to rebase onto ${parsed.branchWithRemote}. Aborting task.` });
@@ -152485,6 +152486,10 @@ const run = fnUntraced(function* (options) {
152485
152486
  yield* fs.writeFileString(pathService.join(worktree.directory, ".lalph", "feedback.md"), feedback);
152486
152487
  }
152487
152488
  const taskPreset = getOrElse$1(yield* source.issueCliAgentPreset(chosenTask.prd), () => preset);
152489
+ const catchStallInReview = (effect) => catchIf(effect, (u) => u instanceof RunnerStalled, fnUntraced(function* (e) {
152490
+ if ((yield* prd.findById(taskId))?.state === "in-review") return;
152491
+ return yield* e;
152492
+ }));
152488
152493
  if (yield* gen(function* () {
152489
152494
  registry.update(currentWorker.state, (s) => s.transitionTo(WorkerStatus.Working({ issueId: taskId })));
152490
152495
  const instructions = (yield* PromptGen).prompt({
@@ -152498,7 +152503,7 @@ const run = fnUntraced(function* (options) {
152498
152503
  stallTimeout: options.stallTimeout,
152499
152504
  preset: taskPreset,
152500
152505
  prompt: instructions
152501
- }).pipe(withSpan("Main.agentWorker"));
152506
+ }).pipe(catchStallInReview, withSpan("Main.agentWorker"));
152502
152507
  yield* log$1(`Agent exited with code: ${exitCode}`);
152503
152508
  if (options.review) {
152504
152509
  registry.update(currentWorker.state, (s) => s.transitionTo(WorkerStatus.Reviewing({ issueId: taskId })));
@@ -152507,7 +152512,7 @@ const run = fnUntraced(function* (options) {
152507
152512
  stallTimeout: options.stallTimeout,
152508
152513
  preset: taskPreset,
152509
152514
  instructions
152510
- }).pipe(withSpan("Main.agentReviewer"));
152515
+ }).pipe(catchStallInReview, withSpan("Main.agentReviewer"));
152511
152516
  }
152512
152517
  }).pipe(timeout(options.runTimeout), tapErrorTag("TimeoutError", () => agentTimeout({
152513
152518
  specsDirectory: options.specsDirectory,
@@ -152867,7 +152872,7 @@ const commandSource = make$36("source").pipe(withDescription("Select the issue s
152867
152872
 
152868
152873
  //#endregion
152869
152874
  //#region package.json
152870
- var version = "0.3.17";
152875
+ var version = "0.3.19";
152871
152876
 
152872
152877
  //#endregion
152873
152878
  //#region src/commands/projects/ls.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lalph",
3
3
  "type": "module",
4
- "version": "0.3.17",
4
+ "version": "0.3.19",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
package/src/GitFlow.ts CHANGED
@@ -151,6 +151,8 @@ But you **do not** need to git push your changes or switch branches.
151
151
 
152
152
  const parsed = parseBranch(targetBranch)
153
153
  yield* worktree.exec`git fetch ${parsed.remote}`
154
+
155
+ yield* worktree.exec`git restore --worktree .`
154
156
  const rebaseResult =
155
157
  yield* worktree.exec`git rebase ${parsed.branchWithRemote}`
156
158
  if (rebaseResult !== 0) {
@@ -142,6 +142,20 @@ const run = Effect.fnUntraced(
142
142
  () => preset,
143
143
  )
144
144
 
145
+ const catchStallInReview = <A, E, R>(
146
+ effect: Effect.Effect<A, E | RunnerStalled, R>,
147
+ ) =>
148
+ Effect.catchIf(
149
+ effect,
150
+ (u): u is RunnerStalled => u instanceof RunnerStalled,
151
+ Effect.fnUntraced(function* (e) {
152
+ const task = yield* prd.findById(taskId!)
153
+ const inReview = task?.state === "in-review"
154
+ if (inReview) return
155
+ return yield* e
156
+ }),
157
+ )
158
+
145
159
  const cancelled = yield* Effect.gen(function* () {
146
160
  //
147
161
  // 2. Work on task
@@ -164,7 +178,7 @@ const run = Effect.fnUntraced(
164
178
  stallTimeout: options.stallTimeout,
165
179
  preset: taskPreset,
166
180
  prompt: instructions,
167
- }).pipe(Effect.withSpan("Main.agentWorker"))
181
+ }).pipe(catchStallInReview, Effect.withSpan("Main.agentWorker"))
168
182
  yield* Effect.log(`Agent exited with code: ${exitCode}`)
169
183
 
170
184
  // 3. Review task
@@ -180,7 +194,7 @@ const run = Effect.fnUntraced(
180
194
  stallTimeout: options.stallTimeout,
181
195
  preset: taskPreset,
182
196
  instructions,
183
- }).pipe(Effect.withSpan("Main.agentReviewer"))
197
+ }).pipe(catchStallInReview, Effect.withSpan("Main.agentReviewer"))
184
198
  }
185
199
  }).pipe(
186
200
  Effect.timeout(options.runTimeout),