@sema-agent/server 4.1.3 → 4.2.0

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.
@@ -670,7 +670,7 @@ async function handleRunsBody(req, res, url, ctx, miss) {
670
670
  leafId,
671
671
  gate: { kind: "task_done" },
672
672
  pendingAction: { kind: "task_done" },
673
- state: { activeTools: [], nestedStats: { tokens: 0, turns: 0, tasks: 0, costMicroUsd: 0 } },
673
+ state: { activeTools: [], nestedStats: { tokens: 0, turns: 0, tasks: 0, costMicroUsd: 0, anyUnpriced: false } },
674
674
  status: "pending",
675
675
  createdAt: Date.now(),
676
676
  sourceTaskId: taskId,
@@ -412,7 +412,10 @@ export class JournalingWorkflowRunStore {
412
412
  if (!this.fleetBus)
413
413
  return;
414
414
  const agents = run.agents ?? [];
415
- const done = agents.filter((a) => a.status === "completed" || a.status === "failed").length;
415
+ // [2336] doneCount failedCount **不相交**:done 只数 completed。契约以此为前提(fleet-bus.ts
416
+ // startedCount 注的回退式 done+failed ≤ started);把 failed 也计进 done 会让全失败 workflow 的
417
+ // 终帧渲成 "N done"(cli 4.1.3 实测 done=2 failed=2 started=2)。
418
+ const done = agents.filter((a) => a.status === "completed").length;
416
419
  const failed = agents.filter((a) => a.status === "failed").length;
417
420
  // cli [1726] 二①:CC 规模告警的分母是 **started**(已启动),而 `totalCount`(= agents.length)是**计划总数**
418
421
  // (含排队中)。判别口径走 core 导出的 `deriveAgentDisplayStatus` —— 一个 agent 已在 `run.agents` 里但
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/server",
3
- "version": "4.1.3",
3
+ "version": "4.2.0",
4
4
  "description": "Sema Server — the server/API implementation layer for Sema, wiring core, registry, model providers, and cloud agent execution. Built on @sema-agent/core.",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",
@@ -54,7 +54,7 @@
54
54
  "build:binary:run-local:darwin-arm64": "bun build --compile --target=bun-darwin-arm64 src/run-local.ts --outfile dist/run-local-darwin-arm64"
55
55
  },
56
56
  "dependencies": {
57
- "@sema-agent/core": "^3.0.0",
57
+ "@sema-agent/core": "^4.0.0",
58
58
  "@sema-agent/registry-core": "^0.13.0",
59
59
  "e2b": "^2.28.0",
60
60
  "libsodium-wrappers": "^0.8.4",