@sema-agent/server 5.5.0 → 5.7.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.
- package/dist/boot/execution-env.js +10 -1
- package/dist/config-types.d.ts +7 -1
- package/dist/config.js +13 -9
- package/dist/fleet-client.d.ts +4 -0
- package/dist/fleet-client.js +10 -3
- package/dist/plugins/background-agent-store-sql.js +3 -6
- package/dist/plugins/scheduler-support.js +12 -3
- package/package.json +2 -2
|
@@ -163,7 +163,16 @@ export function createExecutionEnv(ctx) {
|
|
|
163
163
|
// [1009]② host-signal: the spawning shell knows whether a resident daemon will honor session
|
|
164
164
|
// wakeups — SCHEDULER_SESSION_WAKEUP=false flips the capability off at CONSTRUCTION (instance-
|
|
165
165
|
// lifetime snapshot, core TOCTOU 契约) so core's ScheduleWakeup refuses up front.
|
|
166
|
-
|
|
166
|
+
// [2436] session-lifetime 同族 host-signal(5.6.0):headless(无 daemon 收割)⇒
|
|
167
|
+
// supportsSessionLifetime:false ⇒ CronCreate 前门拒收 + backend 第二道拒落盘,孤儿不产生。
|
|
168
|
+
...(config.schedulerSessionWakeup === false || config.schedulerSessionLifetime === false
|
|
169
|
+
? {
|
|
170
|
+
caps: {
|
|
171
|
+
...(config.schedulerSessionWakeup === false ? { supportsSessionWakeup: false } : {}),
|
|
172
|
+
...(config.schedulerSessionLifetime === false ? { supportsSessionLifetime: false } : {}),
|
|
173
|
+
},
|
|
174
|
+
}
|
|
175
|
+
: {}),
|
|
167
176
|
})
|
|
168
177
|
: undefined;
|
|
169
178
|
if (hostScheduler)
|
package/dist/config-types.d.ts
CHANGED
|
@@ -615,6 +615,12 @@ export interface ServiceConfigFlat {
|
|
|
615
615
|
* of parking a wakeup that would never fire (TB background-reap族 [991]②b). Default ON (the co-resident
|
|
616
616
|
* TOC daemon does honor its own sessions' wakeups); opt-out only — SCHEDULER_ENABLED 同门. */
|
|
617
617
|
schedulerSessionWakeup: boolean;
|
|
618
|
+
/** [2425]/[2436] session-lifetime 同族 host-signal(5.6.0):headless 部署(spawn 时已知无常驻 daemon
|
|
619
|
+
* 收割 session-lifetime 记录)设 `SCHEDULER_SESSION_LIFETIME=false` ⇒ capability 面
|
|
620
|
+
* `supportsSessionLifetime:false` ⇒ core 的 CronCreate 前门拒收 durable:false(fail-closed 于工具层),
|
|
621
|
+
* backend.schedule 第二道同拒——session 记录不落盘=孤儿不产生。Default ON(co-resident TOC daemon
|
|
622
|
+
* 真会收割);opt-out only,WAKEUP 同形。 */
|
|
623
|
+
schedulerSessionLifetime: boolean;
|
|
618
624
|
/** R-survey/EnterPlanMode (core 1.167): MODEL-DRIVEN plan mode. When true, runs start with
|
|
619
625
|
* `TaskSpec.enablePlanMode:true` but NOT `handsReadOnly` (writable-start) → core auto-mounts `enter_plan_mode`
|
|
620
626
|
* (+ `present_plan`) so the model can self-call `enter_plan_mode` at ANY time it judges a task needs planning
|
|
@@ -879,7 +885,7 @@ export type ServiceMemoryConfig = Pick<ServiceConfigFlat, "memoryEngineEnabled"
|
|
|
879
885
|
* 函数不产出它,但它与 `autonomy` 是同一根治理棒的两半,归本组。 */
|
|
880
886
|
export type ServiceAuthConfig = Pick<ServiceConfigFlat, "authToken" | "authTokens" | "allowUnauthedWrites" | "corsOrigins" | "principalHeader" | "requirePrincipal" | "autonomy" | "commandPolicy" | "operatorPrincipals" | "principalJwtPubkeys" | "principalJwtIss" | "principalJwtAud" | "principalJwtMaxTtlSec" | "bindHost" | "bindHostSource">;
|
|
881
887
|
/** 组:orchestration(编排 + 执行车道 + 沙箱面 + workflow/后台 agent 存留)。 */
|
|
882
|
-
export type ServiceOrchestrationConfig = Pick<ServiceConfigFlat, "remoteExec" | "worktreeIsolation" | "leaderEnabled" | "leaderFanoutEnabled" | "routerEnabled" | "selfOrchestrationEnabled" | "selfOrchestrationModels" | "selfOrchestrationWorkerIsolation" | "forkEnabled" | "experimentalObserverAgents" | "schedulerEnabled" | "schedulerSessionWakeup" | "schedulerStorePath" | "planModeEnabled" | "workflowRunStoreBackend" | "workflowOrphanGraceMs" | "workflowJournalRetentionMs" | "workflowRunRetentionMs" | "workflowAgentsReadOnly" | "workflowSizeGuideline" | "backgroundAgentRetentionMs" | "backgroundAgentStaleRunningMs" | "backgroundAgentParkClaimStaleMs" | "rosterRetentionMs" | "scratchpadSweepTtlMs" | "sandboxPkgSource" | "sessionAutoTitle" | "selectEnvironmentTool" | "envFactsEnabled" | "toolDeferLongtail" | "lspEnabled" | "lspHostEnabled" | "imageBakes">;
|
|
888
|
+
export type ServiceOrchestrationConfig = Pick<ServiceConfigFlat, "remoteExec" | "worktreeIsolation" | "leaderEnabled" | "leaderFanoutEnabled" | "routerEnabled" | "selfOrchestrationEnabled" | "selfOrchestrationModels" | "selfOrchestrationWorkerIsolation" | "forkEnabled" | "experimentalObserverAgents" | "schedulerEnabled" | "schedulerSessionWakeup" | "schedulerSessionLifetime" | "schedulerStorePath" | "planModeEnabled" | "workflowRunStoreBackend" | "workflowOrphanGraceMs" | "workflowJournalRetentionMs" | "workflowRunRetentionMs" | "workflowAgentsReadOnly" | "workflowSizeGuideline" | "backgroundAgentRetentionMs" | "backgroundAgentStaleRunningMs" | "backgroundAgentParkClaimStaleMs" | "rosterRetentionMs" | "scratchpadSweepTtlMs" | "sandboxPkgSource" | "sessionAutoTitle" | "selectEnvironmentTool" | "envFactsEnabled" | "toolDeferLongtail" | "lspEnabled" | "lspHostEnabled" | "imageBakes">;
|
|
883
889
|
/** 组:limitsHttp(HTTP 面 + 各类上限/配额/回收窗)。 */
|
|
884
890
|
export type ServiceLimitsHttpConfig = Pick<ServiceConfigFlat, "port" | "attachmentOrphanGraceMs" | "workspaceFileMaxBytes" | "attachmentMaxBytes" | "attachmentMimeAllowlist" | "attachmentUnboundTtlMs" | "infraCostRates" | "drainGraceMs" | "sighupIdleGraceMs" | "rateLimitPerMin" | "maxTaskCostUsd" | "maxTaskTokens" | "maxPrincipalCostUsd" | "costQuotaWindowSec" | "reapIntervalSec" | "runStaleSec" | "toolResultTtlSec">;
|
|
885
891
|
/** 组:observability(可观测)。 */
|
package/dist/config.js
CHANGED
|
@@ -448,7 +448,7 @@ function parseStoreDomain(ctx) {
|
|
|
448
448
|
const needsDb = needsTidb;
|
|
449
449
|
return {
|
|
450
450
|
sessionBackend,
|
|
451
|
-
sessionCacheTtlSec:
|
|
451
|
+
sessionCacheTtlSec: numEnv("SESSION_CACHE_TTL_SEC", "300"), // A2 同族:NaN ⇒ `> 0` 假 ⇒ 缓存静默关
|
|
452
452
|
rewindSnapshotMaxMb: optFinitePositiveEnv("REWIND_SNAPSHOT_MAX_MB"), // soft knob (S20: bad value warns + default)
|
|
453
453
|
dbBackend,
|
|
454
454
|
dbBackendExplicit: dbBackendSet,
|
|
@@ -748,7 +748,7 @@ function parseModelDomain() {
|
|
|
748
748
|
baseUrl: firstSetEnv("ANTHROPIC_BASE_URL"),
|
|
749
749
|
version: process.env.ANTHROPIC_VERSION,
|
|
750
750
|
cacheBreakpoints: (process.env.ANTHROPIC_CACHE_BREAKPOINTS ?? "true") === "true",
|
|
751
|
-
...(process.env.ANTHROPIC_MAX_RETRIES ? { maxRetries:
|
|
751
|
+
...(process.env.ANTHROPIC_MAX_RETRIES ? { maxRetries: numEnv("ANTHROPIC_MAX_RETRIES", "2") } : {}), // A1 同族:NaN 会把 SDK 重试面折没
|
|
752
752
|
}
|
|
753
753
|
: undefined,
|
|
754
754
|
resilience: {
|
|
@@ -756,16 +756,19 @@ function parseModelDomain() {
|
|
|
756
756
|
// timer only arms AFTER the first token (bumpIdle lives in sawContentToken), so with these
|
|
757
757
|
// two off a stream that opens but never emits hangs unbounded — the one true blind spot the
|
|
758
758
|
// fleet audit found. Values follow the [880] recommendation; =0 restores off.
|
|
759
|
-
|
|
760
|
-
|
|
759
|
+
// 鲁棒性批1 A1(2026-08-03):这五个是 TASK_TIMEOUT_SEC 同族的**危险方向**键——NaN 在 core 的
|
|
760
|
+
// `if (x && x > 0)` 门下判假 ⇒ 看门狗/熔断静默关(设了收紧值反而更松)。当年 gap-sweep 的棘轮
|
|
761
|
+
// 正则只抓 process.env 直读拼法,这批「裸 Number 包 env() helper」从盲区漏网;门已补第二正则。
|
|
762
|
+
connectTimeoutMs: numEnv("MODEL_CONNECT_TIMEOUT_MS", "30000"),
|
|
763
|
+
firstTokenTimeoutMs: numEnv("MODEL_FIRST_TOKEN_TIMEOUT_MS", "120000"),
|
|
761
764
|
// BEHAVIOR CHANGE (CC 196 parity): mid-stream stall watchdog default ON at 5min —
|
|
762
765
|
// after output starts, 5min of zero deltas cancels the stream as a retryable [network] failure
|
|
763
766
|
// (retry/failover recovers; without it a hung gateway pins the turn until the user Escapes).
|
|
764
767
|
// MODEL_IDLE_TIMEOUT_MS=0 restores off.
|
|
765
|
-
idleTimeoutMs:
|
|
768
|
+
idleTimeoutMs: numEnv("MODEL_IDLE_TIMEOUT_MS", "300000"),
|
|
766
769
|
circuitBreaker: boolEnv("MODEL_CIRCUIT_BREAKER", false),
|
|
767
|
-
failureThreshold:
|
|
768
|
-
cooldownMs:
|
|
770
|
+
failureThreshold: numEnv("MODEL_CB_FAILURE_THRESHOLD", "5"),
|
|
771
|
+
cooldownMs: numEnv("MODEL_CB_COOLDOWN_MS", "30000"),
|
|
769
772
|
},
|
|
770
773
|
model,
|
|
771
774
|
models,
|
|
@@ -1179,6 +1182,7 @@ function parseOrchestrationDomain(ctx) {
|
|
|
1179
1182
|
planModeEnabled: boolEnv("PLAN_MODE_ENABLED", true), // EnterPlanMode (core 1.167) model-driven plan; 🆕 default ON (resident — clay), PLAN_MODE_ENABLED=false opts out
|
|
1180
1183
|
...(process.env.SCHEDULER_STORE_PATH ? { schedulerStorePath: process.env.SCHEDULER_STORE_PATH } : {}),
|
|
1181
1184
|
schedulerSessionWakeup: boolEnv("SCHEDULER_SESSION_WAKEUP", true), // [1009]② host-signal: default ON, the spawning shell opts a daemon-less engine out (PLAN_MODE_ENABLED 同形解析)
|
|
1185
|
+
schedulerSessionLifetime: boolEnv("SCHEDULER_SESSION_LIFETIME", true), // [2436] 同族 host-signal(5.6.0):headless=false ⇒ CronCreate 前门拒 session-lifetime,孤儿不落盘
|
|
1182
1186
|
selfOrchestrationModels: csv("SELF_ORCHESTRATION_MODELS"),
|
|
1183
1187
|
selfOrchestrationWorkerIsolation: boolEnv("SELF_ORCHESTRATION_WORKER_ISOLATION", false),
|
|
1184
1188
|
...(workflowSizeGuideline ? { workflowSizeGuideline } : {}),
|
|
@@ -1247,7 +1251,7 @@ function parseLimitsHttpDomain() {
|
|
|
1247
1251
|
costQuotaWindowSec: numEnv("COST_QUOTA_WINDOW_SEC", "86400"),
|
|
1248
1252
|
reapIntervalSec: numEnv("REAP_INTERVAL_SEC", "60"),
|
|
1249
1253
|
runStaleSec: numEnv("REAP_RUN_STALE_SEC", "120"),
|
|
1250
|
-
toolResultTtlSec:
|
|
1254
|
+
toolResultTtlSec: numEnv("TOOL_RESULT_TTL_SEC", "86400"), // A2 同族:NaN ⇒ reapOlderThan(NaN) 永不回收且被 .catch 吞
|
|
1251
1255
|
};
|
|
1252
1256
|
}
|
|
1253
1257
|
/** 域:observability(可观测)—— 指标/追踪令牌、工具与思考轨迹开关、日志档位、OTLP 出口。 */
|
|
@@ -1326,7 +1330,7 @@ const AUTH_GROUP_KEYS = [
|
|
|
1326
1330
|
const ORCHESTRATION_GROUP_KEYS = [
|
|
1327
1331
|
"remoteExec", "worktreeIsolation", "leaderEnabled", "leaderFanoutEnabled", "routerEnabled", "selfOrchestrationEnabled",
|
|
1328
1332
|
"selfOrchestrationModels", "selfOrchestrationWorkerIsolation", "forkEnabled", "experimentalObserverAgents",
|
|
1329
|
-
"schedulerEnabled", "schedulerSessionWakeup", "schedulerStorePath", "planModeEnabled", "workflowRunStoreBackend",
|
|
1333
|
+
"schedulerEnabled", "schedulerSessionWakeup", "schedulerSessionLifetime", "schedulerStorePath", "planModeEnabled", "workflowRunStoreBackend",
|
|
1330
1334
|
"workflowOrphanGraceMs", "workflowJournalRetentionMs", "workflowRunRetentionMs", "workflowAgentsReadOnly",
|
|
1331
1335
|
"workflowSizeGuideline", "backgroundAgentRetentionMs", "backgroundAgentStaleRunningMs",
|
|
1332
1336
|
"backgroundAgentParkClaimStaleMs", "rosterRetentionMs", "scratchpadSweepTtlMs", "sandboxPkgSource",
|
package/dist/fleet-client.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ import { UsageReport } from "@sema-agent/registry-core/fleet";
|
|
|
16
16
|
/** Bound on distinct principal×model keys per window — a runaway/multi-tenant burst collapses into
|
|
17
17
|
* `__other__` instead of growing unbounded (same posture as budget.ts cardinalityGuard). */
|
|
18
18
|
export declare const FLEET_USAGE_KEY_CAP = 1024;
|
|
19
|
+
/** C1(2026-08-03):announce/usage/deregister 三站点的 fetch 上界(fleet-lease `LEASE_FETCH_TIMEOUT_MS`
|
|
20
|
+
* 同款判据的普适形)。比 lease 的 2500 略宽——这三条不在提交热路径,5s 足以吃掉慢网 RTT,又远小于
|
|
21
|
+
* undici 默认 ~300s headersTimeout(此前半开 center 把 stop()/心跳各钉住到那个量级)。 */
|
|
22
|
+
export declare const FLEET_CLIENT_FETCH_TIMEOUT_MS = 5000;
|
|
19
23
|
/**
|
|
20
24
|
* Per-window principal×model usage accumulator, fed from the tracer's `brain.call` hook (which carries the
|
|
21
25
|
* ALS principal — reaches council/team sub-task spend too, same attribution point costQuota uses). Sync,
|
package/dist/fleet-client.js
CHANGED
|
@@ -16,6 +16,10 @@ import { InstanceAnnouncement, UsageReport, DEFAULT_HEARTBEAT_MS } from "@sema-a
|
|
|
16
16
|
/** Bound on distinct principal×model keys per window — a runaway/multi-tenant burst collapses into
|
|
17
17
|
* `__other__` instead of growing unbounded (same posture as budget.ts cardinalityGuard). */
|
|
18
18
|
export const FLEET_USAGE_KEY_CAP = 1024;
|
|
19
|
+
/** C1(2026-08-03):announce/usage/deregister 三站点的 fetch 上界(fleet-lease `LEASE_FETCH_TIMEOUT_MS`
|
|
20
|
+
* 同款判据的普适形)。比 lease 的 2500 略宽——这三条不在提交热路径,5s 足以吃掉慢网 RTT,又远小于
|
|
21
|
+
* undici 默认 ~300s headersTimeout(此前半开 center 把 stop()/心跳各钉住到那个量级)。 */
|
|
22
|
+
export const FLEET_CLIENT_FETCH_TIMEOUT_MS = 5000;
|
|
19
23
|
/**
|
|
20
24
|
* Per-window principal×model usage accumulator, fed from the tracer's `brain.call` hook (which carries the
|
|
21
25
|
* ALS principal — reaches council/team sub-task spend too, same attribution point costQuota uses). Sync,
|
|
@@ -122,7 +126,10 @@ export function startFleetClient(opts) {
|
|
|
122
126
|
heartbeatMs,
|
|
123
127
|
};
|
|
124
128
|
try {
|
|
125
|
-
|
|
129
|
+
// 鲁棒性批1 C1(2026-08-03):三条对 center 的 fetch 全部界上 abort(fleet-lease O1 同款判据的
|
|
130
|
+
// 普适形)——半开 center 下此前各挂 undici 默认 ~300s headersTimeout,stop() 的滚动更新被单个
|
|
131
|
+
// 半开连接钉住;心跳侧每 tick 叠一个在飞请求。
|
|
132
|
+
const res = await f(`${base}/api/fleet/instances`, { method: "POST", headers, body: JSON.stringify(body), signal: AbortSignal.timeout(FLEET_CLIENT_FETCH_TIMEOUT_MS) });
|
|
126
133
|
if (!res.ok)
|
|
127
134
|
throw new Error(`announce ${res.status}`);
|
|
128
135
|
if (failStreak > 0)
|
|
@@ -147,7 +154,7 @@ export function startFleetClient(opts) {
|
|
|
147
154
|
return; // nothing accrued — skip the POST entirely
|
|
148
155
|
const report = { worker: opts.center.worker, instanceId: opts.instanceId, windowStartMs: start, windowEndMs, entries };
|
|
149
156
|
try {
|
|
150
|
-
const res = await f(`${base}/api/fleet/usage`, { method: "POST", headers, body: JSON.stringify({ reports: [report] }) });
|
|
157
|
+
const res = await f(`${base}/api/fleet/usage`, { method: "POST", headers, body: JSON.stringify({ reports: [report] }), signal: AbortSignal.timeout(FLEET_CLIENT_FETCH_TIMEOUT_MS) });
|
|
151
158
|
if (!res.ok)
|
|
152
159
|
throw new Error(`usage ${res.status}`);
|
|
153
160
|
}
|
|
@@ -171,7 +178,7 @@ export function startFleetClient(opts) {
|
|
|
171
178
|
clearInterval(uw);
|
|
172
179
|
await flushUsage(); // final partial window — best-effort
|
|
173
180
|
try {
|
|
174
|
-
await f(`${base}/api/fleet/instances`, { method: "DELETE", headers, body: JSON.stringify({ instanceId: opts.instanceId, worker: opts.center.worker }) });
|
|
181
|
+
await f(`${base}/api/fleet/instances`, { method: "DELETE", headers, body: JSON.stringify({ instanceId: opts.instanceId, worker: opts.center.worker }), signal: AbortSignal.timeout(FLEET_CLIENT_FETCH_TIMEOUT_MS) });
|
|
175
182
|
}
|
|
176
183
|
catch {
|
|
177
184
|
/* deregistration is best-effort — staleness (2× heartbeatMs) reaps us anyway */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BackgroundAgentStoreError, } from "@sema-agent/core";
|
|
1
|
+
import { BackgroundAgentStoreError, STALE_RUNNING_REAP_ATTRIBUTION, } from "@sema-agent/core";
|
|
2
2
|
import { pgSafeJsonStringify, pgSanitizeText } from "./pg-safe-json.js";
|
|
3
3
|
export const BACKGROUND_AGENT_TABLE = "background_agents";
|
|
4
4
|
const SUMMARY_COLS = "handle, owner, session_scoped, session_id, parent_session_id, root_session_id, name, agent_type, status, spawned_at_ms, updated_at_ms, settled_at_ms, usage_json";
|
|
@@ -66,11 +66,8 @@ function rowToSummary(r) {
|
|
|
66
66
|
: {}),
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
* exports 图拒绝),已在提货回执里请 core 上包根,到货后换 import。漂移钉=backgroundAgentStoreContract
|
|
72
|
-
* 的 stale-running 条目逐字断言这句(store-contract-kit-db-integration §4.5,真双库)——core 改句必红。 */
|
|
73
|
-
const STALE_RUNNING_REAP_ATTRIBUTION = "the host process was interrupted while this agent was running — its in-process state was lost. Check its worktree / output file for partial work before assuming the task landed (stale running row reaped).";
|
|
69
|
+
// 共享归因句:core 5.4.0 起上包根([2436] 请求→[2437] 兑现),值拷贝退役——同一常量,双生与
|
|
70
|
+
// InMemory 语义源头彻底同源;试剂盒条目仍逐字断言它(真双库),但漂移自此在编译期就不可能发生。
|
|
74
71
|
/** core reap 的 staleRunning 翻转形(逐字段照抄 InMemory,background-agent-store.js:266-272):
|
|
75
72
|
* summary **和 error** 都只在缺席时补共享归因句——error 半边 5.2.0 起就该有,双生此前只写 summary
|
|
76
73
|
* 且是手写旧句(core 5.3.0 新试剂盒首跑两方言一致揪红,[2425] bg-agent B 族同源),真失败文本永不覆写。 */
|
|
@@ -145,6 +145,12 @@ export class FileSchedulerBackend {
|
|
|
145
145
|
if (intent.lifetime === "session" && !ctx.sessionId) {
|
|
146
146
|
return err(new SchedulerError("invalid_schedule", 'lifetime:"session" requires a session to bind to (ctx.sessionId missing)'));
|
|
147
147
|
}
|
|
148
|
+
// [2436] 纵深(5.6.0):能力面已声明无 daemon 收割 session-lifetime(headless 部署形,
|
|
149
|
+
// SCHEDULER_SESSION_LIFETIME=false)⇒ 落盘一条即必然孤儿([2425] 外溢病)。core 的 CronCreate 读
|
|
150
|
+
// 能力面在工具层前门拒是第一道;这里是第二道——错装配宿主绕过工具层直调也不许落盘。
|
|
151
|
+
if (intent.lifetime === "session" && this.schedulerCapabilities.supportsSessionLifetime === false) {
|
|
152
|
+
return err(new SchedulerError("invalid_schedule", 'lifetime:"session" is not supported on this deployment (no resident daemon reaps session-lifetime records — the row would be an orphan)'));
|
|
153
|
+
}
|
|
148
154
|
const records = this.load();
|
|
149
155
|
const key = dedupKey(ctx.scope, intent, ctx.sessionId);
|
|
150
156
|
const existingIdx = records.findIndex((r) => {
|
|
@@ -194,9 +200,12 @@ export class FileSchedulerBackend {
|
|
|
194
200
|
async cancel(id, ctx) {
|
|
195
201
|
const records = this.load();
|
|
196
202
|
const idx = records.findIndex((r) => r.id === id);
|
|
197
|
-
// 🔴 scope isolation:
|
|
198
|
-
|
|
199
|
-
|
|
203
|
+
// 🔴 scope isolation + 假肯定病修([2425]/[2209],5.6.0):missing 与 non-own-scope **同折**
|
|
204
|
+
// err(not_found)——存在性仍不泄露(错 id/别人的任务/已删的重试三条到达路径一个答案),但不再
|
|
205
|
+
// ok(undefined) 谎报「删掉了」。旧形的代价是真实的:模型删错 id 得到成功回执,真任务继续按点起跑。
|
|
206
|
+
if (idx < 0 || records[idx].scope !== ctx.scope) {
|
|
207
|
+
return err(new SchedulerError("not_found", `no scheduled task ${id} in your scope (wrong id, already cancelled, or not yours)`));
|
|
208
|
+
}
|
|
200
209
|
records.splice(idx, 1);
|
|
201
210
|
try {
|
|
202
211
|
this.save(records);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.7.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": "^5.
|
|
57
|
+
"@sema-agent/core": "^5.4.0",
|
|
58
58
|
"@sema-agent/registry-core": "^0.13.0",
|
|
59
59
|
"e2b": "^2.28.0",
|
|
60
60
|
"libsodium-wrappers": "^0.8.4",
|