lalph 0.3.18 → 0.3.20

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
@@ -151449,7 +151449,9 @@ const issueSourceRuntime = atomRuntime(CurrentIssueSource.layer.pipe(orDie$3));
151449
151449
  const currentIssuesAtom = family((projectId) => pipe(issueSourceRuntime.atom(fnUntraced(function* (get) {
151450
151450
  const issues = yield* pipe((yield* IssueSource).issues(projectId), withSpan("currentIssuesAtom.refresh"));
151451
151451
  const handle = setTimeout(() => {
151452
- get.refreshSelf();
151452
+ try {
151453
+ get.refreshSelf();
151454
+ } catch {}
151453
151455
  }, 3e4);
151454
151456
  get.addFinalizer(() => clearTimeout(handle));
151455
151457
  return issues;
@@ -152486,6 +152488,10 @@ const run = fnUntraced(function* (options) {
152486
152488
  yield* fs.writeFileString(pathService.join(worktree.directory, ".lalph", "feedback.md"), feedback);
152487
152489
  }
152488
152490
  const taskPreset = getOrElse$1(yield* source.issueCliAgentPreset(chosenTask.prd), () => preset);
152491
+ const catchStallInReview = (effect) => catchIf(effect, (u) => u instanceof RunnerStalled, fnUntraced(function* (e) {
152492
+ if ((yield* prd.findById(taskId))?.state === "in-review") return;
152493
+ return yield* e;
152494
+ }));
152489
152495
  if (yield* gen(function* () {
152490
152496
  registry.update(currentWorker.state, (s) => s.transitionTo(WorkerStatus.Working({ issueId: taskId })));
152491
152497
  const instructions = (yield* PromptGen).prompt({
@@ -152499,7 +152505,7 @@ const run = fnUntraced(function* (options) {
152499
152505
  stallTimeout: options.stallTimeout,
152500
152506
  preset: taskPreset,
152501
152507
  prompt: instructions
152502
- }).pipe(withSpan("Main.agentWorker"));
152508
+ }).pipe(catchStallInReview, withSpan("Main.agentWorker"));
152503
152509
  yield* log$1(`Agent exited with code: ${exitCode}`);
152504
152510
  if (options.review) {
152505
152511
  registry.update(currentWorker.state, (s) => s.transitionTo(WorkerStatus.Reviewing({ issueId: taskId })));
@@ -152508,7 +152514,7 @@ const run = fnUntraced(function* (options) {
152508
152514
  stallTimeout: options.stallTimeout,
152509
152515
  preset: taskPreset,
152510
152516
  instructions
152511
- }).pipe(withSpan("Main.agentReviewer"));
152517
+ }).pipe(catchStallInReview, withSpan("Main.agentReviewer"));
152512
152518
  }
152513
152519
  }).pipe(timeout(options.runTimeout), tapErrorTag("TimeoutError", () => agentTimeout({
152514
152520
  specsDirectory: options.specsDirectory,
@@ -152868,7 +152874,7 @@ const commandSource = make$36("source").pipe(withDescription("Select the issue s
152868
152874
 
152869
152875
  //#endregion
152870
152876
  //#region package.json
152871
- var version = "0.3.18";
152877
+ var version = "0.3.20";
152872
152878
 
152873
152879
  //#endregion
152874
152880
  //#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.18",
4
+ "version": "0.3.20",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -171,7 +171,11 @@ export const currentIssuesAtom = Atom.family((projectId: ProjectId) =>
171
171
  Effect.withSpan("currentIssuesAtom.refresh"),
172
172
  )
173
173
  const handle = setTimeout(() => {
174
- get.refreshSelf()
174
+ try {
175
+ get.refreshSelf()
176
+ } catch {
177
+ // ignore - if the atom is no longer in use, refreshing will throw an error, which we can safely ignore
178
+ }
175
179
  }, 30_000)
176
180
  get.addFinalizer(() => clearTimeout(handle))
177
181
  return issues
@@ -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),