@calltelemetry/openclaw-linear 0.7.1 → 0.8.1
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/README.md +834 -536
- package/index.ts +1 -1
- package/openclaw.plugin.json +3 -2
- package/package.json +1 -1
- package/prompts.yaml +46 -6
- package/src/__test__/fixtures/linear-responses.ts +75 -0
- package/src/__test__/fixtures/webhook-payloads.ts +113 -0
- package/src/__test__/helpers.ts +133 -0
- package/src/agent/agent.test.ts +192 -0
- package/src/agent/agent.ts +26 -1
- package/src/api/linear-api.test.ts +93 -1
- package/src/api/linear-api.ts +37 -1
- package/src/gateway/dispatch-methods.test.ts +409 -0
- package/src/infra/cli.ts +176 -1
- package/src/infra/commands.test.ts +276 -0
- package/src/infra/doctor.test.ts +19 -0
- package/src/infra/doctor.ts +30 -25
- package/src/infra/multi-repo.test.ts +163 -0
- package/src/infra/multi-repo.ts +29 -0
- package/src/infra/notify.test.ts +155 -16
- package/src/infra/notify.ts +26 -15
- package/src/infra/observability.test.ts +85 -0
- package/src/pipeline/artifacts.test.ts +26 -3
- package/src/pipeline/dispatch-state.ts +1 -0
- package/src/pipeline/e2e-dispatch.test.ts +584 -0
- package/src/pipeline/e2e-planning.test.ts +478 -0
- package/src/pipeline/intent-classify.test.ts +285 -0
- package/src/pipeline/intent-classify.ts +259 -0
- package/src/pipeline/pipeline.test.ts +69 -0
- package/src/pipeline/pipeline.ts +47 -18
- package/src/pipeline/planner.test.ts +159 -40
- package/src/pipeline/planner.ts +108 -60
- package/src/pipeline/tier-assess.test.ts +89 -0
- package/src/pipeline/webhook.ts +424 -251
- package/src/tools/claude-tool.ts +6 -0
- package/src/tools/cli-shared.test.ts +155 -0
- package/src/tools/code-tool.test.ts +210 -0
- package/src/tools/code-tool.ts +2 -2
- package/src/tools/dispatch-history-tool.test.ts +315 -0
- package/src/tools/planner-tools.test.ts +1 -1
- package/src/tools/planner-tools.ts +10 -2
|
@@ -172,4 +172,93 @@ describe("assessTier", () => {
|
|
|
172
172
|
expect(result.model).toBe(TIER_MODELS.junior);
|
|
173
173
|
expect(result.reasoning).toBe("Config tweak");
|
|
174
174
|
});
|
|
175
|
+
|
|
176
|
+
it("handles null description gracefully", async () => {
|
|
177
|
+
mockRunAgent.mockResolvedValue({
|
|
178
|
+
success: true,
|
|
179
|
+
output: '{"tier":"junior","reasoning":"Trivial"}',
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
const api = makeApi({ defaultAgentId: "mal" });
|
|
183
|
+
const result = await assessTier(api, makeIssue({ description: null }));
|
|
184
|
+
|
|
185
|
+
expect(result.tier).toBe("junior");
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it("handles empty labels and no comments", async () => {
|
|
189
|
+
mockRunAgent.mockResolvedValue({
|
|
190
|
+
success: true,
|
|
191
|
+
output: '{"tier":"medior","reasoning":"Standard feature"}',
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
const api = makeApi({ defaultAgentId: "mal" });
|
|
195
|
+
const result = await assessTier(api, makeIssue({ labels: [], commentCount: undefined }));
|
|
196
|
+
|
|
197
|
+
expect(result.tier).toBe("medior");
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it("falls back to medior on malformed JSON (half JSON)", async () => {
|
|
201
|
+
mockRunAgent.mockResolvedValue({
|
|
202
|
+
success: true,
|
|
203
|
+
output: '{"tier":"seni',
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
const api = makeApi({ defaultAgentId: "mal" });
|
|
207
|
+
const result = await assessTier(api, makeIssue());
|
|
208
|
+
|
|
209
|
+
expect(result.tier).toBe("medior");
|
|
210
|
+
expect(result.reasoning).toBe("Assessment failed — defaulting to medior");
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it("provides default reasoning when missing from response", async () => {
|
|
214
|
+
mockRunAgent.mockResolvedValue({
|
|
215
|
+
success: true,
|
|
216
|
+
output: '{"tier":"senior"}',
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
const api = makeApi({ defaultAgentId: "mal" });
|
|
220
|
+
const result = await assessTier(api, makeIssue());
|
|
221
|
+
|
|
222
|
+
expect(result.tier).toBe("senior");
|
|
223
|
+
expect(result.reasoning).toBe("no reasoning provided");
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
it("extracts JSON from output with success=false but valid JSON", async () => {
|
|
227
|
+
mockRunAgent.mockResolvedValue({
|
|
228
|
+
success: false,
|
|
229
|
+
output: 'Agent exited early but: {"tier":"junior","reasoning":"Simple fix"}',
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
const api = makeApi({ defaultAgentId: "mal" });
|
|
233
|
+
const result = await assessTier(api, makeIssue());
|
|
234
|
+
|
|
235
|
+
expect(result.tier).toBe("junior");
|
|
236
|
+
expect(result.reasoning).toBe("Simple fix");
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
it("defaults agentId from pluginConfig when not passed", async () => {
|
|
240
|
+
mockRunAgent.mockResolvedValue({
|
|
241
|
+
success: true,
|
|
242
|
+
output: '{"tier":"medior","reasoning":"Normal"}',
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
const api = makeApi({ defaultAgentId: "zoe" });
|
|
246
|
+
await assessTier(api, makeIssue());
|
|
247
|
+
|
|
248
|
+
const callArgs = mockRunAgent.mock.calls[0][0];
|
|
249
|
+
expect(callArgs.agentId).toBe("zoe");
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
it("uses 30s timeout for assessment", async () => {
|
|
253
|
+
mockRunAgent.mockResolvedValue({
|
|
254
|
+
success: true,
|
|
255
|
+
output: '{"tier":"medior","reasoning":"Normal"}',
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
const api = makeApi({ defaultAgentId: "mal" });
|
|
259
|
+
await assessTier(api, makeIssue());
|
|
260
|
+
|
|
261
|
+
const callArgs = mockRunAgent.mock.calls[0][0];
|
|
262
|
+
expect(callArgs.timeoutMs).toBe(30_000);
|
|
263
|
+
});
|
|
175
264
|
});
|