lalph 0.3.113 → 0.3.115

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lalph",
3
3
  "type": "module",
4
- "version": "0.3.113",
4
+ "version": "0.3.115",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -44,8 +44,8 @@
44
44
  "@linear/sdk": "^80.0.0",
45
45
  "@octokit/plugin-rest-endpoint-methods": "^17.0.0",
46
46
  "@octokit/types": "^16.0.0",
47
- "@typescript/native-preview": "7.0.0-dev.20260324.1",
48
- "clanka": "^0.2.38",
47
+ "@typescript/native-preview": "7.0.0-dev.20260326.1",
48
+ "clanka": "^0.2.41",
49
49
  "concurrently": "^9.2.1",
50
50
  "effect": "4.0.0-beta.40",
51
51
  "husky": "^9.1.7",
@@ -53,7 +53,7 @@
53
53
  "octokit": "^5.0.5",
54
54
  "oxlint": "^1.57.0",
55
55
  "prettier": "^3.8.1",
56
- "tsdown": "^0.21.4",
56
+ "tsdown": "^0.21.5",
57
57
  "typescript": "^6.0.2",
58
58
  "yaml": "^2.8.3"
59
59
  },
@@ -41,6 +41,7 @@ export const agentChooser = Effect.fnUntraced(function* (options: {
41
41
  model: options.preset.extraArgs.join(" "),
42
42
  prompt: promptGen.promptChooseClanka({ gitFlow }),
43
43
  mode: "choose",
44
+ stallTimeout: options.stallTimeout,
44
45
  }).pipe(
45
46
  Effect.provideService(ChosenTaskDeferred, deferred),
46
47
  Effect.flatMap(() => Effect.fail(new ChosenTaskNotFound())),
@@ -26,5 +26,6 @@ export const agentResearcher = Effect.fnUntraced(function* (options: {
26
26
  prompt: promptGen.promptResearch({
27
27
  task: options.task,
28
28
  }),
29
+ stallTimeout: options.stallTimeout,
29
30
  }).pipe(Effect.asSome)
30
31
  })
@@ -48,6 +48,7 @@ export const agentReviewer = Effect.fnUntraced(function* (options: {
48
48
  gitFlow,
49
49
  }),
50
50
  ),
51
+ stallTimeout: options.stallTimeout,
51
52
  mode,
52
53
  })
53
54
  return ExitCode(0)
@@ -47,6 +47,7 @@ export const agentTimeout = Effect.fnUntraced(function* (options: {
47
47
  model: options.preset.extraArgs.join(" "),
48
48
  system: timeoutMode.system,
49
49
  prompt: timeoutMode.clankaPrompt,
50
+ stallTimeout: options.stallTimeout,
50
51
  mode: timeoutMode.mode,
51
52
  })
52
53
  return ExitCode(0)
@@ -50,6 +50,7 @@ ${research}`,
50
50
  }),
51
51
  maxContext: options.maxContext,
52
52
  steer: options.steer,
53
+ stallTimeout: options.stallTimeout,
53
54
  mode: CurrentTask.$match(options.currentTask, {
54
55
  task: () => "default" as const,
55
56
  ralph: () => "ralph" as const,
package/src/Clanka.ts CHANGED
@@ -3,6 +3,7 @@ import * as OutputFormatter from "clanka/OutputFormatter"
3
3
  import {
4
4
  Cause,
5
5
  Config,
6
+ Duration,
6
7
  Effect,
7
8
  identity,
8
9
  Layer,
@@ -19,6 +20,7 @@ import type { Prompt } from "effect/unstable/ai"
19
20
  import { OpenAiClient, OpenAiEmbeddingModel } from "@effect/ai-openai"
20
21
  import { Worktree } from "./Worktree.ts"
21
22
  import { SemanticSearch } from "clanka"
23
+ import { withStallTimeout } from "./shared/stream.ts"
22
24
 
23
25
  export const ClankaMuxerLayer = Layer.effectDiscard(
24
26
  Effect.gen(function* () {
@@ -73,6 +75,7 @@ export const runClanka = Effect.fnUntraced(
73
75
  readonly prompt: Prompt.RawInput
74
76
  readonly system?: string | undefined
75
77
  readonly maxContext?: number | undefined
78
+ readonly stallTimeout?: Duration.Duration | undefined
76
79
  readonly steer?: Stream.Stream<string> | undefined
77
80
  readonly mode?: "ralph" | "choose" | "default" | undefined
78
81
  }) {
@@ -99,7 +102,11 @@ export const runClanka = Effect.fnUntraced(
99
102
  )
100
103
  }
101
104
 
102
- return yield* output.pipe(
105
+ const stream = options.stallTimeout
106
+ ? withStallTimeout(options.stallTimeout)(output)
107
+ : output
108
+
109
+ return yield* stream.pipe(
103
110
  options.maxContext
104
111
  ? Stream.tap((part) => {
105
112
  if (part._tag !== "Usage") return Effect.void
@@ -5,6 +5,7 @@ import {
5
5
  Effect,
6
6
  FiberHandle,
7
7
  Option,
8
+ Schedule,
8
9
  Schema,
9
10
  ScopedCache,
10
11
  ServiceMap,
@@ -114,8 +115,9 @@ export class IssueSource extends ServiceMap.Service<
114
115
  Effect.tap((issues) =>
115
116
  SubscriptionRef.set(ref, IssuesChange.External({ issues })),
116
117
  ),
117
- Effect.ignoreCause,
118
118
  Effect.delay(Duration.seconds(30)),
119
+ Effect.sandbox,
120
+ Effect.retry(Schedule.forever),
119
121
  Stream.fromEffectDrain,
120
122
  ),
121
123
  ),