oasis_test_v2 2.2.87 → 2.2.88
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/index.js +86 -33
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -202847,7 +202847,7 @@ var init_service3 = __esm({
|
|
|
202847
202847
|
}
|
|
202848
202848
|
const actors = await this.options.resolveActors(companyId);
|
|
202849
202849
|
const bindings = await actors.listBindings();
|
|
202850
|
-
const reachability = async (actorId) => {
|
|
202850
|
+
const reachability = async (actorId, actorName) => {
|
|
202851
202851
|
const primaryReason = await (async () => {
|
|
202852
202852
|
const binding = bindings.find((b2) => b2.actorId === actorId && b2.status === "active");
|
|
202853
202853
|
if (!binding) return "\u6CA1\u6709\u63A5\u8FD0\u884C\u65F6";
|
|
@@ -202857,9 +202857,15 @@ var init_service3 = __esm({
|
|
|
202857
202857
|
})();
|
|
202858
202858
|
if (primaryReason === null) return { ok: true };
|
|
202859
202859
|
if (!this.options.probeAllocation) return { ok: false, reason: primaryReason };
|
|
202860
|
-
const alt = await this.options.probeAllocation({ actorId, ...companyId ? { companyId } : {} }).catch(() => ({ reachable: true }));
|
|
202860
|
+
const alt = await this.options.probeAllocation({ actorId, actorName, ...companyId ? { companyId } : {} }).catch(() => ({ reachable: true }));
|
|
202861
202861
|
if (alt.reachable) return { ok: true };
|
|
202862
|
-
return {
|
|
202862
|
+
return {
|
|
202863
|
+
ok: false,
|
|
202864
|
+
...alt.reason ? { allocationReason: alt.reason } : {},
|
|
202865
|
+
// 短的那一格只放主运行时那一句。整句原因走 `allocationReason`,**不在这里再拼一遍**——
|
|
202866
|
+
// 两格都放会让同一段话在报错里出现两次(括号里一遍、「原因:」那行一遍)。
|
|
202867
|
+
reason: primaryReason
|
|
202868
|
+
};
|
|
202863
202869
|
};
|
|
202864
202870
|
if (target.startsWith("actor:")) {
|
|
202865
202871
|
const actor = await actors.getActor(target);
|
|
@@ -202870,12 +202876,12 @@ var init_service3 = __esm({
|
|
|
202870
202876
|
`\u7EC4\u7EC7\u91CC\u627E\u4E0D\u5230\u5728\u5C97\u7684 ${target}\u2014\u2014\u81EA\u5DF1\u505A\uFF0C\u5E76\u5728\u56DE\u590D\u91CC\u8BF4\u660E\u8FD9\u4E00\u6BB5\u662F\u4F60\u81EA\u5DF1\u505A\u7684\u3002`
|
|
202871
202877
|
);
|
|
202872
202878
|
}
|
|
202873
|
-
const reach = await reachability(actor.id);
|
|
202879
|
+
const reach = await reachability(actor.id, actor.name);
|
|
202874
202880
|
if (!reach.ok) {
|
|
202875
202881
|
throw new DelegationError(
|
|
202876
202882
|
409,
|
|
202877
202883
|
"EXPERT_UNREACHABLE",
|
|
202878
|
-
|
|
202884
|
+
_DelegationService.unreachableText(actor.name, reach),
|
|
202879
202885
|
{ expertActorId: actor.id, expertName: actor.name }
|
|
202880
202886
|
);
|
|
202881
202887
|
}
|
|
@@ -202890,19 +202896,34 @@ var init_service3 = __esm({
|
|
|
202890
202896
|
);
|
|
202891
202897
|
}
|
|
202892
202898
|
let lastReason;
|
|
202899
|
+
let lastAllocationReason;
|
|
202893
202900
|
for (const candidate of candidates) {
|
|
202894
|
-
const reach = await reachability(candidate.id);
|
|
202901
|
+
const reach = await reachability(candidate.id, candidate.name);
|
|
202895
202902
|
if (reach.ok) return { actorId: candidate.id, name: candidate.name };
|
|
202896
202903
|
lastReason = reach.reason ?? lastReason;
|
|
202904
|
+
lastAllocationReason = reach.allocationReason ?? lastAllocationReason;
|
|
202897
202905
|
}
|
|
202898
202906
|
const first = candidates[0];
|
|
202899
202907
|
throw new DelegationError(
|
|
202900
202908
|
409,
|
|
202901
202909
|
"EXPERT_UNREACHABLE",
|
|
202902
|
-
`\u300C${target}\u300D\u5C97\u4F4D\u4E0A\u7684\u540C\u4E8B\uFF08${candidates.map((a) => a.name).join("\u3001")}\uFF09\u73B0\u5728\u90FD\u4E0D\u53EF\u7528\uFF08${lastReason ?? "\u8FD0\u884C\u65F6\u4E0D\u53EF\u8FBE"}\uFF09\u2014\u2014\u81EA\u5DF1\u505A\uFF0C\u6216\u6362\u4E00\u4E2A\u5C97\u4F4D\u3002
|
|
202910
|
+
`\u300C${target}\u300D\u5C97\u4F4D\u4E0A\u7684\u540C\u4E8B\uFF08${candidates.map((a) => a.name).join("\u3001")}\uFF09\u73B0\u5728\u90FD\u4E0D\u53EF\u7528\uFF08${lastReason ?? "\u8FD0\u884C\u65F6\u4E0D\u53EF\u8FBE"}\uFF09\u2014\u2014\u81EA\u5DF1\u505A\uFF0C\u6216\u6362\u4E00\u4E2A\u5C97\u4F4D\u3002` + (lastAllocationReason ? `
|
|
202911
|
+
\u539F\u56E0\uFF1A${lastAllocationReason}` : ""),
|
|
202903
202912
|
{ expertActorId: first.id, expertName: first.name }
|
|
202904
202913
|
);
|
|
202905
202914
|
}
|
|
202915
|
+
/**
|
|
202916
|
+
* `EXPERT_UNREACHABLE` 那句话(ADR 0616)。**结论在前、原因在后**:读它的是 LLM,
|
|
202917
|
+
* 它读完第一行就要决定改走「自己干」那条路(§8.2)。
|
|
202918
|
+
*
|
|
202919
|
+
* 分配给出原因时把**那一整句原文**单起一行,不塞进括号里——它自己已经带了机器名、为什么
|
|
202920
|
+
* (已到并发上限 / 标记为故障 / 没有可用绑定)和下一步怎么办,再套一层括号就读不成句子了。
|
|
202921
|
+
*/
|
|
202922
|
+
static unreachableText(name, reach) {
|
|
202923
|
+
const head = `${name} \u73B0\u5728\u4E0D\u53EF\u7528\uFF08${reach.reason ?? "\u8FD0\u884C\u65F6\u4E0D\u53EF\u8FBE"}\uFF09\u2014\u2014\u81EA\u5DF1\u505A\uFF0C\u6216\u6362\u4E00\u4E2A\u5C97\u4F4D\u3002`;
|
|
202924
|
+
return reach.allocationReason ? `${head}
|
|
202925
|
+
\u539F\u56E0\uFF1A${reach.allocationReason}` : head;
|
|
202926
|
+
}
|
|
202906
202927
|
/**
|
|
202907
202928
|
* 第 `attempt` 次尝试用的 label 候选(`desired`、`desired-2`、`desired-3`…)。
|
|
202908
202929
|
*
|
|
@@ -203412,6 +203433,11 @@ var init_service3 = __esm({
|
|
|
203412
203433
|
const settled = await store?.patch(record9.id, {
|
|
203413
203434
|
state: "failed",
|
|
203414
203435
|
failureKind: "not-started",
|
|
203436
|
+
/* ★ ADR 0616:**原因也要落台账**。上一版只把它写进子会话的占位行(= 用户在界面上看到的
|
|
203437
|
+
那一句)和轮次账本的 `lastError`,台账上一个字都没有——于是 `--status` 与回流给主会话的
|
|
203438
|
+
那条通告都只剩 `not-started`,派活的那一方(助理 agent)读不到「所有候选都到并发上限」
|
|
203439
|
+
这种真原因,只能猜。2026-09-24 实测它猜成了「节点掉线」。 */
|
|
203440
|
+
failureReason: message2,
|
|
203415
203441
|
settledSeq: record9.settledSeq + 1,
|
|
203416
203442
|
consecutiveFails: record9.consecutiveFails + 1,
|
|
203417
203443
|
settledAt: failedAt
|
|
@@ -203490,6 +203516,9 @@ var init_service3 = __esm({
|
|
|
203490
203516
|
consecutiveFails,
|
|
203491
203517
|
state: failureKind2 ? "failed" : "done",
|
|
203492
203518
|
failureKind: failureKind2 ?? null,
|
|
203519
|
+
/* 这几档(跑起来过之后才失败 / 跑成了)的原因已经在本轮 `roundSummaries[].text` 里,
|
|
203520
|
+
不在台账上再存一份;同时把上一轮 `not-started` 留下的原文清掉,免得读到的是过期原因。 */
|
|
203521
|
+
failureReason: null,
|
|
203493
203522
|
settledSeq: settledSeqAtRound,
|
|
203494
203523
|
settledAt: at2
|
|
203495
203524
|
}).catch(() => null);
|
|
@@ -203560,6 +203589,8 @@ var init_service3 = __esm({
|
|
|
203560
203589
|
// 退出帧丢失后被时钟闭合 = `interrupted`(§9),不是 `not-started`——它确实起来过。
|
|
203561
203590
|
// run 报的是墙钟超时时归 `timeout`(Bug 0221):同样起来过,但「到点被停」与「断了」说法不同。
|
|
203562
203591
|
failureKind: timedOut ? "timeout" : "interrupted",
|
|
203592
|
+
// 同 settleRound:这两档的原因在本轮摘要里,台账只清掉上一轮 not-started 的原文。
|
|
203593
|
+
failureReason: null,
|
|
203563
203594
|
consecutiveFails: record9.consecutiveFails + 1,
|
|
203564
203595
|
settledSeq: settledSeqAtRound,
|
|
203565
203596
|
settledAt: at2
|
|
@@ -203675,6 +203706,7 @@ var init_service3 = __esm({
|
|
|
203675
203706
|
const released = await store.patch(record9.id, {
|
|
203676
203707
|
state: "running",
|
|
203677
203708
|
failureKind: null,
|
|
203709
|
+
failureReason: null,
|
|
203678
203710
|
settledAt: null,
|
|
203679
203711
|
childRunId: null,
|
|
203680
203712
|
// 换一把轮次账本业务键 + 释放派发所有权,否则新一轮会被上一轮的预约判成 `resumed` 而永远不派。
|
|
@@ -203685,6 +203717,7 @@ var init_service3 = __esm({
|
|
|
203685
203717
|
const restore = () => store.patch(record9.id, {
|
|
203686
203718
|
state: record9.state,
|
|
203687
203719
|
failureKind: record9.failureKind ?? null,
|
|
203720
|
+
failureReason: record9.failureReason ?? null,
|
|
203688
203721
|
settledAt: record9.settledAt ?? null,
|
|
203689
203722
|
childRunId: record9.childRunId ?? null,
|
|
203690
203723
|
dispatchedAt: record9.dispatchedAt ?? null
|
|
@@ -203881,6 +203914,7 @@ ${inboundBundle.paths.map((path47) => `- ${path47}`).join("\n")}` : text7,
|
|
|
203881
203914
|
await store.patch(record9.id, {
|
|
203882
203915
|
state: "running",
|
|
203883
203916
|
failureKind: null,
|
|
203917
|
+
failureReason: null,
|
|
203884
203918
|
settledAt: null,
|
|
203885
203919
|
childRunId: null,
|
|
203886
203920
|
// 释放派发所有权:这条追加要触发新的一轮,得让下一次 `claimDispatch` 抢得到。
|
|
@@ -203944,6 +203978,8 @@ ${inboundBundle.paths.map((path47) => `- ${path47}`).join("\n")}` : text7,
|
|
|
203944
203978
|
...expert?.name ? { expertName: expert.name } : {},
|
|
203945
203979
|
state: record9.state,
|
|
203946
203980
|
...record9.failureKind ? { failureKind: record9.failureKind } : {},
|
|
203981
|
+
// ADR 0616:`--status` 要说得出「为什么没派出去」,不能只给一个 `not-started`。
|
|
203982
|
+
...record9.failureReason ? { failureReason: record9.failureReason } : {},
|
|
203947
203983
|
...record9.label ? { label: record9.label } : {},
|
|
203948
203984
|
...record9.taskDigest ? { taskDigest: record9.taskDigest } : {},
|
|
203949
203985
|
roundSummaries: record9.roundSummaries,
|
|
@@ -204539,6 +204575,7 @@ function delegationReturnText(terminal, opts) {
|
|
|
204539
204575
|
head,
|
|
204540
204576
|
`\u59D4\u6D3E id\uFF1A${record9.id.slice(0, 8)}\u3000label\uFF1A${record9.label ?? "\uFF08\u65E0\uFF09"}` + (record9.failureKind ? `\u3000\u7ED3\u675F\u539F\u56E0\uFF1A${record9.failureKind}` : "")
|
|
204541
204577
|
];
|
|
204578
|
+
if (record9.failureReason?.trim()) lines.push(`\u539F\u56E0\uFF1A${record9.failureReason.trim()}`);
|
|
204542
204579
|
const trimmed = trimRoundSummariesForReturn(record9.roundSummaries, opts.recentRounds);
|
|
204543
204580
|
if (trimmed.length > 0) {
|
|
204544
204581
|
lines.push("", `\u4E13\u5BB6\u5404\u8F6E\u5C0F\u7ED3\uFF08\u5171 ${trimmed.length} \u8F6E\uFF1B\u6700\u8FD1 ${opts.recentRounds} \u8F6E\u7ED9\u5168\u6587\uFF0C\u66F4\u65E9\u7684\u53EA\u7559\u9996\u884C\uFF0C\u5168\u6587\u7528 \`oasis delegate --status\` \u770B\uFF09\uFF1A`);
|
|
@@ -246582,32 +246619,34 @@ var init_allocate = __esm({
|
|
|
246582
246619
|
function describeRejections(rejections) {
|
|
246583
246620
|
return rejections.map((r) => `${r.nodeName} \xB7 ${r.runtimeKind}\uFF08${CAUSE_TEXT[r.cause]}${r.detail ? `\uFF1A${r.detail}` : ""}\uFF09`).join("\uFF1B");
|
|
246584
246621
|
}
|
|
246585
|
-
function
|
|
246586
|
-
if (result.ok) return result;
|
|
246622
|
+
function describeAllocationFailure(result, who) {
|
|
246587
246623
|
const subject = who?.actorName?.trim() ? `\u300C${who.actorName.trim()}\u300D` : "\u8FD9\u4F4D Agent";
|
|
246588
246624
|
const what = who?.what?.trim() ? `${who.what.trim()}\uFF1A` : "";
|
|
246589
246625
|
const detail = describeRejections(result.rejections);
|
|
246590
246626
|
if (result.reason === "no-candidates") {
|
|
246591
|
-
|
|
246592
|
-
"RUNTIME_ALLOCATION_NO_CANDIDATES",
|
|
246593
|
-
|
|
246594
|
-
|
|
246595
|
-
|
|
246627
|
+
return {
|
|
246628
|
+
code: "RUNTIME_ALLOCATION_NO_CANDIDATES",
|
|
246629
|
+
status: 409,
|
|
246630
|
+
message: `${what}${subject}\u6CA1\u6709\u53EF\u7528\u7684\u8FD0\u884C\u65F6\u76EE\u6807\uFF1A\u65E2\u6CA1\u6709\u4E3B\u8FD0\u884C\u65F6\u7ED1\u5B9A\uFF0C\u4E5F\u6CA1\u6709\u914D\u7F6E\u5019\u9009\u8FD0\u884C\u65F6\u3002\u8BF7\u5728\u5458\u5DE5\u8BE6\u60C5\u9875\u7684\u300C\u9ED8\u8BA4\u8FD0\u884C\u914D\u7F6E\u300D\u91CC\u7ED1\u5B9A\u4E00\u4E2A\u8FD0\u884C\u65F6\uFF0C\u6216\u52A0\u4E00\u6761\u5019\u9009\u8FD0\u884C\u65F6\u3002`
|
|
246631
|
+
};
|
|
246596
246632
|
}
|
|
246597
246633
|
if (result.reason === "all-at-capacity") {
|
|
246598
|
-
|
|
246599
|
-
"RUNTIME_ALLOCATION_ALL_AT_CAPACITY",
|
|
246600
|
-
|
|
246601
|
-
|
|
246602
|
-
|
|
246603
|
-
);
|
|
246634
|
+
return {
|
|
246635
|
+
code: "RUNTIME_ALLOCATION_ALL_AT_CAPACITY",
|
|
246636
|
+
status: 503,
|
|
246637
|
+
message: `${what}${subject}\u7684\u8FD0\u884C\u65F6\u5168\u90E8\u5DF2\u5230\u5E76\u53D1\u4E0A\u9650\uFF0C\u672C\u6B21\u6CA1\u6709\u6D3E\u51FA\uFF1A${detail}\u3002\u8BF7\u7B49\u5F53\u524D\u4F1A\u8BDD\u8DD1\u5B8C\uFF0C\u6216\u5728\u8FD0\u884C\u65F6\u7BA1\u7406\u9875\u628A\u8FD9\u4E9B\u8282\u70B9\u7684\u5E76\u53D1\u4E0A\u9650\u8C03\u9AD8\u3002`
|
|
246638
|
+
};
|
|
246604
246639
|
}
|
|
246605
|
-
|
|
246606
|
-
"RUNTIME_ALLOCATION_ALL_UNAVAILABLE",
|
|
246607
|
-
|
|
246608
|
-
|
|
246609
|
-
|
|
246610
|
-
|
|
246640
|
+
return {
|
|
246641
|
+
code: "RUNTIME_ALLOCATION_ALL_UNAVAILABLE",
|
|
246642
|
+
status: result.reason === "all-tried" ? 409 : 503,
|
|
246643
|
+
message: `${what}${subject}\u7684\u8FD0\u884C\u65F6\u76EE\u524D\u90FD\u4E0D\u53EF\u7528\uFF0C\u672C\u6B21\u6CA1\u6709\u6D3E\u51FA\uFF1A${detail}\u3002\u8BF7\u786E\u8BA4\u90A3\u4E9B\u673A\u5668\u5F00\u7740\u3001\u8282\u70B9\u7A0B\u5E8F\u5728\u8FD0\u884C\u3001\u8FD0\u884C\u65F6\u5DF2\u767B\u5F55\u4E14\u989D\u5EA6\u672A\u8017\u5C3D\uFF1B\u6216\u5728\u5458\u5DE5\u8BE6\u60C5\u9875\u52A0\u4E00\u6761\u522B\u7684\u5019\u9009\u8FD0\u884C\u65F6\u3002`
|
|
246644
|
+
};
|
|
246645
|
+
}
|
|
246646
|
+
function requireAllocation(result, who) {
|
|
246647
|
+
if (result.ok) return result;
|
|
246648
|
+
const failure2 = describeAllocationFailure(result, who);
|
|
246649
|
+
throw new RuntimeAllocationError(failure2.code, failure2.message, result.rejections, failure2.status);
|
|
246611
246650
|
}
|
|
246612
246651
|
var RuntimeAllocationError, CAUSE_TEXT;
|
|
246613
246652
|
var init_errors6 = __esm({
|
|
@@ -249636,6 +249675,9 @@ function renderCoordinatorView(view, taskBackground) {
|
|
|
249636
249675
|
node2.nodeState === null ? "- Attempt: \u6267\u884C\u8D26\u672C\u4E2D\u65E0 attempt \u8BB0\u5F55" : `- Attempt: ${node2.status}; continuity: ${node2.nodeState}; number: ${node2.attemptNo || "none"}`,
|
|
249637
249676
|
`- Actor: ${node2.actorId ?? "unassigned"}; role: ${node2.role ?? "unassigned"}`
|
|
249638
249677
|
);
|
|
249678
|
+
if (node2.work.failureReason?.trim() && (node2.work.state === "failed" || node2.work.state === "dead" || node2.work.state === "retry")) {
|
|
249679
|
+
lines.push(`- Work failure reason: ${node2.work.failureReason.trim()}`);
|
|
249680
|
+
}
|
|
249639
249681
|
if (node2.dependsOn.length > 0) lines.push(`- Depends on: ${node2.dependsOn.join(", ")}`);
|
|
249640
249682
|
if (node2.conclusion?.trim()) {
|
|
249641
249683
|
lines.push(node2.work.acceptedWorkId ? `- Conclusion (delivered ${node2.work.acceptedWorkId}): ${node2.conclusion.trim()}` : `- Conclusion: ${node2.conclusion.trim()}`);
|
|
@@ -250447,10 +250489,12 @@ function nodeCoordinatorFactsFromSnapshot(snapshot) {
|
|
|
250447
250489
|
for (const node2 of snapshot.nodes) {
|
|
250448
250490
|
const currentWorkId = node2.latestWorkId ?? null;
|
|
250449
250491
|
const currentWork = currentWorkId ? workById.get(currentWorkId) : void 0;
|
|
250492
|
+
const failureReason2 = typeof currentWork?.outcomeDetail?.["reason"] === "string" ? currentWork.outcomeDetail["reason"].trim() : "";
|
|
250450
250493
|
const work = {
|
|
250451
250494
|
currentWorkId,
|
|
250452
250495
|
acceptedWorkId: node2.latestAcceptId ?? null,
|
|
250453
|
-
state: currentWorkId === null ? "not_started" : currentWork ? workState(currentWork, hasOutput(currentWork, artifactCountByWork.get(currentWork.id) ?? 0)) : "unavailable"
|
|
250496
|
+
state: currentWorkId === null ? "not_started" : currentWork ? workState(currentWork, hasOutput(currentWork, artifactCountByWork.get(currentWork.id) ?? 0)) : "unavailable",
|
|
250497
|
+
...failureReason2 ? { failureReason: failureReason2 } : {}
|
|
250454
250498
|
};
|
|
250455
250499
|
const accepted = node2.latestAcceptId ? workById.get(node2.latestAcceptId) : void 0;
|
|
250456
250500
|
const conclusion = accepted?.conclusion?.trim();
|
|
@@ -268576,6 +268620,7 @@ function toRecord2(row) {
|
|
|
268576
268620
|
expertActorId: row.expert_actor_id,
|
|
268577
268621
|
state: row.state,
|
|
268578
268622
|
...row.failure_kind ? { failureKind: row.failure_kind } : {},
|
|
268623
|
+
...row.failure_reason ? { failureReason: row.failure_reason } : {},
|
|
268579
268624
|
...row.child_run_id ? { childRunId: row.child_run_id } : {},
|
|
268580
268625
|
...row.invocation_id ? { invocationId: row.invocation_id } : {},
|
|
268581
268626
|
...row.label ? { label: row.label } : {},
|
|
@@ -268638,6 +268683,9 @@ var init_postgres_delegations = __esm({
|
|
|
268638
268683
|
)`);
|
|
268639
268684
|
for (const [col, type] of [
|
|
268640
268685
|
["failure_kind", "text"],
|
|
268686
|
+
// 这次失败的原因原文(ADR 0616)。存量行 NULL = 那次失败没留下原文(本列落地之前写的),
|
|
268687
|
+
// `--status` 与回流通告照旧只打 `failure_kind`,与改动前逐字相同。
|
|
268688
|
+
["failure_reason", "text"],
|
|
268641
268689
|
["child_run_id", "text"],
|
|
268642
268690
|
["invocation_id", "text"],
|
|
268643
268691
|
["label", "text"],
|
|
@@ -268681,9 +268729,9 @@ var init_postgres_delegations = __esm({
|
|
|
268681
268729
|
const inserted = await this.pool.query(
|
|
268682
268730
|
`INSERT INTO ${this.s}.chat_session_delegations
|
|
268683
268731
|
(id, parent_session_id, parent_message_id, child_session_id, expert_actor_id, state,
|
|
268684
|
-
failure_kind, child_run_id, invocation_id, label, task_digest, round_summaries,
|
|
268732
|
+
failure_kind, failure_reason, child_run_id, invocation_id, label, task_digest, round_summaries,
|
|
268685
268733
|
consecutive_fails, settled_seq, created_at, settled_at, dispatched_at, dispatch_seq)
|
|
268686
|
-
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12::jsonb,$
|
|
268734
|
+
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13::jsonb,$14,$15,$16,$17,$18,$19)
|
|
268687
268735
|
ON CONFLICT DO NOTHING
|
|
268688
268736
|
RETURNING *`,
|
|
268689
268737
|
[
|
|
@@ -268694,6 +268742,7 @@ var init_postgres_delegations = __esm({
|
|
|
268694
268742
|
record9.expertActorId,
|
|
268695
268743
|
record9.state,
|
|
268696
268744
|
record9.failureKind ?? null,
|
|
268745
|
+
record9.failureReason ?? null,
|
|
268697
268746
|
record9.childRunId ?? null,
|
|
268698
268747
|
record9.invocationId ?? null,
|
|
268699
268748
|
record9.label ?? null,
|
|
@@ -268774,6 +268823,7 @@ var init_postgres_delegations = __esm({
|
|
|
268774
268823
|
};
|
|
268775
268824
|
if (patch.state !== void 0) put3("state", patch.state);
|
|
268776
268825
|
if (patch.failureKind !== void 0) put3("failure_kind", patch.failureKind);
|
|
268826
|
+
if (patch.failureReason !== void 0) put3("failure_reason", patch.failureReason);
|
|
268777
268827
|
if (patch.childRunId !== void 0) put3("child_run_id", patch.childRunId);
|
|
268778
268828
|
if (patch.label !== void 0) put3("label", patch.label);
|
|
268779
268829
|
if (patch.roundSummaries !== void 0) put3("round_summaries", JSON.stringify(patch.roundSummaries), "::jsonb");
|
|
@@ -268935,6 +268985,7 @@ var init_postgres_delegations = __esm({
|
|
|
268935
268985
|
if (otherPatch) {
|
|
268936
268986
|
if (otherPatch.state !== void 0) put3("state", otherPatch.state);
|
|
268937
268987
|
if (otherPatch.failureKind !== void 0) put3("failure_kind", otherPatch.failureKind);
|
|
268988
|
+
if (otherPatch.failureReason !== void 0) put3("failure_reason", otherPatch.failureReason);
|
|
268938
268989
|
if (otherPatch.childRunId !== void 0) put3("child_run_id", otherPatch.childRunId);
|
|
268939
268990
|
if (otherPatch.label !== void 0) put3("label", otherPatch.label);
|
|
268940
268991
|
if (otherPatch.consecutiveFails !== void 0) put3("consecutive_fails", otherPatch.consecutiveFails);
|
|
@@ -278991,6 +279042,7 @@ __export(src_exports2, {
|
|
|
278991
279042
|
deliverWorkorderBroadcast: () => deliverWorkorderBroadcast,
|
|
278992
279043
|
deriveNodeHealth: () => deriveNodeHealth,
|
|
278993
279044
|
describeAllocationChoice: () => describeAllocationChoice,
|
|
279045
|
+
describeAllocationFailure: () => describeAllocationFailure,
|
|
278994
279046
|
describeAttachmentsForAppend: () => describeAttachmentsForAppend,
|
|
278995
279047
|
describeNodeFault: () => describeNodeFault,
|
|
278996
279048
|
describeRejections: () => describeRejections,
|
|
@@ -285657,13 +285709,13 @@ async function startServe(opts) {
|
|
|
285657
285709
|
* 用 `tryAllocate`(不抛、不消耗重试次数):这里只是问「挑不挑得出来」,真正的分配在
|
|
285658
285710
|
* 那一轮派发时再跑一次——两次之间机器状态可能变,以派发那一次为准。
|
|
285659
285711
|
*/
|
|
285660
|
-
delegationProbeAllocation: async ({ actorId, companyId }) => {
|
|
285712
|
+
delegationProbeAllocation: async ({ actorId, actorName, companyId }) => {
|
|
285661
285713
|
const result = await runtimeAllocatorFor(companyId ?? defaultCompanyId).tryAllocate({
|
|
285662
285714
|
actorId,
|
|
285663
285715
|
unitOfWork: `delegation-preflight:${actorId}`
|
|
285664
285716
|
});
|
|
285665
285717
|
if (result.ok) return { reachable: true };
|
|
285666
|
-
return { reachable: false, reason:
|
|
285718
|
+
return { reachable: false, reason: describeAllocationFailure(result, { actorName }).message };
|
|
285667
285719
|
},
|
|
285668
285720
|
// ADR 会话投递 D4:/api/chat 与渠道入站据它占同一个会话槽(自动化侧经 automations 域接同一实例)。
|
|
285669
285721
|
chatTurns: chatTurnStore,
|
|
@@ -294803,7 +294855,7 @@ async function waitForCommandAuthorization(base, headers, draftId, fallback) {
|
|
|
294803
294855
|
}
|
|
294804
294856
|
}
|
|
294805
294857
|
}
|
|
294806
|
-
var CLI_VERSION = "2.2.
|
|
294858
|
+
var CLI_VERSION = "2.2.88" ? "2.2.88" : "dev";
|
|
294807
294859
|
function apiHeaders(token, company) {
|
|
294808
294860
|
const headers = {
|
|
294809
294861
|
authorization: `Bearer ${token}`,
|
|
@@ -295493,6 +295545,7 @@ async function runCli(argv, println = console.log, progressln = console.error) {
|
|
|
295493
295545
|
}
|
|
295494
295546
|
println(`${detail.label ?? "(\u65E0\u77ED\u540D)"} ${detail.expertName ?? detail.expertActorId} ${detail.state}${detail.failureKind ? `/${detail.failureKind}` : ""}`);
|
|
295495
295547
|
println(`id=${detail.id} \u5B50\u4F1A\u8BDD=${detail.childSessionId} \u5F85\u8F6C\u8FBE=${detail.pendingInputs} \u8FDE\u7EED\u5931\u8D25=${detail.consecutiveFails}`);
|
|
295548
|
+
if (detail.failureReason) println(`\u539F\u56E0\uFF1A${detail.failureReason}`);
|
|
295496
295549
|
if (detail.taskDigest) println(`\u4EFB\u52A1\uFF1A${detail.taskDigest}`);
|
|
295497
295550
|
for (const round of detail.roundSummaries) println(`
|
|
295498
295551
|
\u7B2C ${round.round} \u8F6E\uFF08${round.at}\uFF09\uFF1A
|
|
@@ -298773,7 +298826,7 @@ function shimScript() {
|
|
|
298773
298826
|
}
|
|
298774
298827
|
|
|
298775
298828
|
// src/index.ts
|
|
298776
|
-
var PKG_VERSION = true ? "2.2.
|
|
298829
|
+
var PKG_VERSION = true ? "2.2.88" : "dev";
|
|
298777
298830
|
var LOCAL_BIN = localBin();
|
|
298778
298831
|
var NPM_PREFIX = npmPrefix();
|
|
298779
298832
|
var INSTANCE = DEFAULT_INSTANCE;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oasis_test_v2",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.88",
|
|
4
4
|
"description": "Oasis node daemon + CLI — background daemon, auto-start, full server CLI",
|
|
5
5
|
"bin": {
|
|
6
6
|
"oasis": "./dist/index.js"
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"node": ">=20"
|
|
27
27
|
},
|
|
28
28
|
"oasisRelease": {
|
|
29
|
-
"sourceHead": "
|
|
29
|
+
"sourceHead": "1f98db00017415a0c5ddf248a1e5fe28aaa03acd"
|
|
30
30
|
}
|
|
31
31
|
}
|