@teamscala/service-boot 0.23.331 → 0.23.332
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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
},
|
|
7
7
|
"name": "@teamscala/service-boot",
|
|
8
8
|
"type": "module",
|
|
9
|
-
"version": "0.23.
|
|
9
|
+
"version": "0.23.332",
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"files": [
|
|
12
12
|
"src"
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"@teamscala/proc-walker": "*",
|
|
39
39
|
"@teamscala/realtime-utils": "*",
|
|
40
40
|
"@teamscala/resolver-engine": "*",
|
|
41
|
+
"@teamscala/safe-fallback": "*",
|
|
41
42
|
"@teamscala/timing": "*",
|
|
42
43
|
"@teamscala/tool-executor": "*",
|
|
43
44
|
"@teamscala/watchdog": "*",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
import { getAppLogger } from "@teamscala/logger/app-loggers";
|
|
41
41
|
import { recordEvent } from "@teamscala/event-log/record-event";
|
|
42
42
|
import { getPlatformOrgId } from "@teamscala/db/registry/platform";
|
|
43
|
+
import { createSafeFallback } from "@teamscala/safe-fallback/create-safe-fallback";
|
|
43
44
|
import { authed, type Context } from "./auth-router.ts";
|
|
44
45
|
import { notifyLaneOfTaskChange } from "./task-sync-dispatch.ts";
|
|
45
46
|
import { resolveLaneTask, resolveLaneWorkName } from "./task-sync-lane.ts";
|
|
@@ -173,6 +174,12 @@ export function resolveBindOrg(explicit?: string): string {
|
|
|
173
174
|
return explicit ?? getPlatformOrgId();
|
|
174
175
|
}
|
|
175
176
|
|
|
177
|
+
const laneTaskCreateFallback = createSafeFallback<WorkItem | null>({
|
|
178
|
+
name: "task-sync:lane-task-create-race",
|
|
179
|
+
onFailure: "fail-open-noisy",
|
|
180
|
+
degradedResult: null,
|
|
181
|
+
});
|
|
182
|
+
|
|
176
183
|
/**
|
|
177
184
|
* Record a task-sync hook DISCARD to event_log so it is observable + queryable,
|
|
178
185
|
* not silently swallowed by the hook command's `>/dev/null 2>&1 || true`. The
|
|
@@ -288,8 +295,8 @@ async function ensureLaneTask(
|
|
|
288
295
|
const name = pane ? await resolveLaneWorkName(prisma, pane) : null;
|
|
289
296
|
if (!name || name.trim().toLowerCase() === "lane") return null;
|
|
290
297
|
const lane: LaneIdentity = { pane: pane ?? "", session, cli_kind: "claude-code", role: "agent" };
|
|
291
|
-
|
|
292
|
-
|
|
298
|
+
const created = await laneTaskCreateFallback.call(() =>
|
|
299
|
+
prisma.work_items.create({
|
|
293
300
|
data: {
|
|
294
301
|
kind: "task",
|
|
295
302
|
parent_id: null,
|
|
@@ -301,10 +308,9 @@ async function ensureLaneTask(
|
|
|
301
308
|
assignee_id: session,
|
|
302
309
|
kind_data: { lane },
|
|
303
310
|
},
|
|
304
|
-
})
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
311
|
+
}),
|
|
312
|
+
);
|
|
313
|
+
return created ?? resolveLaneTask(prisma, session);
|
|
308
314
|
}
|
|
309
315
|
|
|
310
316
|
|