@coda-console/plugin-check 0.8.13 → 0.8.15
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
CHANGED
|
@@ -110,10 +110,21 @@ OpenCode 遇到模型服务的 429,会照 `Retry-After` 等(OpenCode 2 每
|
|
|
110
110
|
子会话事件没有发起工具的 ID,同时有多个可能的调用时,仅在它们全部仍是同一轮的前台调用时才处理,无法确定的长等待仍由 OpenCode 自己管理。
|
|
111
111
|
Coda 自己对服务故障只等一分钟以内,所以主请求或它仍在等待的前台子会话要等超过一分钟才重试时,入口先 `session/cancel` 停下这一轮(前台子 Agent 随之停下),
|
|
112
112
|
再把这一轮答成失败,原因是服务给的原文加上 OpenCode 要等多久;停下后 OpenCode 回的是什么都不转出。一分钟以内的等待照旧由 OpenCode 自己处理。
|
|
113
|
-
|
|
114
|
-
明确的 `[ttft_admission_refused] the cell is at capacity` 容量拒绝在停下原生轮次后报告为 `service_unavailable`,
|
|
113
|
+
明确的 `[ttft_admission_refused]` 或 `[prefill_cap_refused]` 加 `the cell is at capacity` 容量拒绝、状态码 500–599 的等待,以及没有额度原文的 429,在停下原生轮次后报告为 `service_unavailable`,
|
|
115
114
|
带 `input: accepted` 与 OpenCode 实际安排的剩余等待 `retryAfterMs`;Coda 按该等待决定是否重试,长等待以已知失败结束。
|
|
116
115
|
保留服务原文(其中建议的短等待也原样保留),不把它当成 OpenCode 的实际重试时间,不把普通 429 或认证失败归为容量拒绝。
|
|
116
|
+
等待的错误是 429 且服务自己说明额度用尽(`Free usage limit reached`、`Credits exhausted`、`额度已用尽`、`用量已超出限制`,
|
|
117
|
+
前两句来自 OpenCode Zen 与 WorkBuddy 的英文提示,后两句是 WorkBuddy 的中文提示)时报 `quota_exhausted`。
|
|
118
|
+
这些原文没有带时区的恢复时刻(WorkBuddy 只给本地时间「将在 … 重置」),不推算 `resetAt`;OpenCode 自己的重试时间受 15 分钟上限,也不当作重置时间。
|
|
119
|
+
|
|
120
|
+
OpenCode 把失败的 `session/prompt` 答成 -32603 `Internal error: <原因>`,`data.errorName` 是它对模型服务响应的分类。
|
|
121
|
+
入口在转出时据此补 `error.data._meta.coda.failure`,不改原因与其他字段:`provider.quota`、`provider.free-limit` 报 `quota_exhausted`;
|
|
122
|
+
网关(WorkBuddy、OpenCode Zen 经 Magpie 等)把额度用尽答成 429,OpenCode 归为 `provider.rate-limit`,此时按上面的原文判断;
|
|
123
|
+
不带额度原文的 `provider.rate-limit`、`provider.internal`(5xx 等上游故障)、`provider.transport`(连接失败)与 `provider.timeout`(超时)
|
|
124
|
+
都是会自己好的故障,OpenCode 已重试过,报 `service_unavailable`、`input: accepted`;这条回执不带 `retryAfterMs`(OpenCode 没有说等多久)。
|
|
125
|
+
长等待路径里的 429 同理:没有额度原文就报 `service_unavailable`,带 OpenCode 实际安排的 `retryAfterMs`。
|
|
126
|
+
认证(`provider.auth`,OpenCode 答 `auth_required`)、内容过滤、请求无效(含上下文超长与参数错误)、
|
|
127
|
+
未知服务与路由、不支持的操作、输出无效等失败不带类别。登录凭据过期(OAuth 刷新失败)由 Claude、Codex、Kimi 报 `auth_required`(协议 6.2.0 的类别),Coda 提醒用户重新登录,登录后续上。WorkBuddy 经 OpenCode 使用,没有单独的插件。
|
|
117
128
|
|
|
118
129
|
OpenCode 的原生子会话经 ACP 的 `opencode/child-session-updates` 能力接入(入口 `agent/children.mjs`,核对 OpenCode 2.1.4):
|
|
119
130
|
`opencode/session/child_update` 的创建与运行状态登记成 `_coda/wait`,带原生 `childSessionId`;子会话的回复、思考与工具调用各归自己的过程,
|
|
@@ -365,8 +376,13 @@ Codex 的原生失败统一以 ACP 错误结束,包括只有 `turn/completed.f
|
|
|
365
376
|
插件将服务端内部错误、5xx、响应流中断、模型容量不足,以及已知的 `model '…' is not enabled in rustponsesapi` 报成
|
|
366
377
|
`error.data._meta.coda.failure: {kind: "service_unavailable", input: "accepted"}`。新轮请求明确被拒绝、只给
|
|
367
378
|
`Internal error` 时按临时故障报告 `input: "not_accepted"`;这表示允许有限重试,不表示已确定历史故障根因。
|
|
368
|
-
额度耗尽 `usageLimitExceeded` 单独报 `failure.kind: "quota_exhausted"
|
|
369
|
-
|
|
379
|
+
额度耗尽 `usageLimitExceeded` 单独报 `failure.kind: "quota_exhausted"`;上下文限制、参数、配置或沙箱错误不带此标记。
|
|
380
|
+
ChatGPT 登录的令牌刷新彻底失败(正文以 `Your access token could not be refreshed` 开头并含 `sign in again`:刷新令牌过期、已被使用、被撤销,或已登出、换了账号;这是 Codex 二进制里 `RefreshTokenFailedReason` 的文案)
|
|
381
|
+
报 `failure: {kind: "auth_required", login: "ChatGPT 账号"}`,仍是 -32603 的执行错误。`unauthorized` 类别和单独的 401、403 也可能是 API key 错或权限不足,重新登录解决不了,不带此标记。
|
|
382
|
+
带 HTTP 429 的 `httpConnectionFailed`(消息形如 `unexpected status 429 Too Many Requests: <响应体>, url: …`)按响应体区分:
|
|
383
|
+
含 `insufficient_quota`、`quota_exceeded`、`usage_limit_reached` 或「exceeded your current quota」「hit your usage limit」这些提供方自己的额度用词才报 `quota_exhausted`,
|
|
384
|
+
其余按限流报 `service_unavailable`,正文里的「try again in 1m30.5s」写进 `retryAfterMs`(没有就不带)。401、403 与其他状态码照旧。
|
|
385
|
+
Codex 仅从本次错误的 `additionalDetails`、`message`、`details` 或外层错误正文提取重置时间:JSON(也认嵌在 HTTP 失败消息里的响应体)的 `error.resets_at`(有效 Unix 秒),
|
|
370
386
|
或 `try again at` / `resets at` / `resets` 后明确带 `Z` 的 ISO 8601 时间;取到就写 UTC `failure.resetAt`,可读正文中的这些 ISO 时间改写为 `<t:…>`。
|
|
371
387
|
未给时间、只有相对时间或没有时区时不写。`account/rateLimits/read` 是账号级快照,可能含多个模型额度池,
|
|
372
388
|
失败未指出阻断本轮的额度池,因此不从该快照推断重置时间,也不另开连接查询。
|
|
@@ -380,7 +396,11 @@ Coda 按这个通用类别显示「额度不足」,不触发服务故障重试
|
|
|
380
396
|
插件不推算额度重置时间;其他认证失败、403、短时限流与普通错误原样保留。
|
|
381
397
|
Kimi 2.1.1 的 ACP 把失败的一轮(包括现在以 429 报的五小时额度耗尽)答成 `end_turn`,错误只记在它主 wire 的 `turn.ended` 里。
|
|
382
398
|
插件在交出 `session/prompt` 的回执前读到这一轮以 `failed` 结束,就改答 -32603,`error.message` 是这一轮的错误原文;
|
|
383
|
-
Kimi 自己归为 `APIProviderQuotaExhaustedError`
|
|
399
|
+
Kimi 自己归为 `APIProviderQuotaExhaustedError`(如 `429 You've reached your weekly (7-day) usage limit.`)的另报 `quota_exhausted`(原文没有确切恢复时间,不带 `resetAt`);
|
|
400
|
+
`APIProviderOverloadedError`、状态码 500–599、状态码 429 的非额度限流(`APIProviderRateLimitError`),以及连接失败与超时(`APIConnectionError`、`APITimeoutError`,错误码 `provider.connection_error`)
|
|
401
|
+
另报 `service_unavailable`、`input: accepted`(Kimi 自己已重试过才结束这一轮;错误里没有等待时间,不带 `retryAfterMs`);Kimi 自己的错误码 `auth.login_required`(它的 OAuth 提供方令牌刷新失败,`OAuthUnauthorizedError`,这是 Kimi 二进制里的定义)报 `auth_required`、`login: "Kimi Code OAuth"`,是 -32603 的执行错误。Kimi 的 ACP 对这样结束的一轮回的是 -32000(`Authentication required: …`,不带错误码,与握手阶段的「未登录」同形),
|
|
402
|
+
插件按这一轮 wire 里记的 `auth.login_required` 改回 -32603 并保留这一轮的原文;没有这一轮记录的 -32000(如发出前就被拒)原样转出;
|
|
403
|
+
`provider.auth_error`、401、403 等可能是 key 错或权限不足,重新登录解决不了,仍不带类别;其他失败(上下文、请求无效)不带类别。被过滤的回复 Kimi 已答 `refusal`,不改。
|
|
384
404
|
Kimi 在一轮失败后暂停 goal,goal 的定时随之以 `failed` 结束,说明是那一轮的原因,额度耗尽时标题为「额度不足」。
|
|
385
405
|
`CODA_DISABLE_RUNTIME_PATCHES=kimi` 关闭这层适配。
|
|
386
406
|
|
|
@@ -16,7 +16,6 @@ export function providerAPI({ call, watch, connection, plugin, operations, repor
|
|
|
16
16
|
delete: (kind, id) => call('delete', [kind, id]),
|
|
17
17
|
publish: (kind, id, enabled = true) => call('publish', [kind, id, enabled]),
|
|
18
18
|
// An upload of this machine a post to a session names (`upload`): `{ id, name, size, mime?, duration?, …, path }`.
|
|
19
|
-
remoteCode: id => call('remoteCode', [id]),
|
|
20
19
|
upload: id => call('upload', [id]),
|
|
21
20
|
observe,
|
|
22
21
|
handle(kind, operation, handler) {
|
package/check/coda/builtin.json
CHANGED
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"workflows": [],
|
|
86
86
|
"services": [],
|
|
87
87
|
"agents": [],
|
|
88
|
-
"instructions": "
|
|
88
|
+
"instructions": "改插件设置(如 composer.templates)时调用 workflow_run,workflow 为 change-setting,inputs 给 plugin、setting、value(新值的 JSON,null 清除)、reason(一行,必写),可加 project、machines(写到哪几台,默认装了它的各台);先不给 value 读现值。用户点「应用」才写入,密文不经这里。",
|
|
89
89
|
"commands": [],
|
|
90
90
|
"capabilities": [
|
|
91
91
|
"change-setting"
|
|
@@ -855,7 +855,7 @@
|
|
|
855
855
|
"id": "session",
|
|
856
856
|
"displayName": "会话生命周期",
|
|
857
857
|
"description": "空闲进程、归档收尾与工作树回收",
|
|
858
|
-
"version": "1.
|
|
858
|
+
"version": "1.1.0",
|
|
859
859
|
"category": "工作流程",
|
|
860
860
|
"icon": {
|
|
861
861
|
"symbol": "hourglass",
|
|
@@ -890,15 +890,6 @@
|
|
|
890
890
|
"title": "会话静止多久停掉进程",
|
|
891
891
|
"order": 5,
|
|
892
892
|
"default": "PT1H"
|
|
893
|
-
},
|
|
894
|
-
"session.subagents": {
|
|
895
|
-
"type": "integer",
|
|
896
|
-
"minimum": 1,
|
|
897
|
-
"maximum": 64,
|
|
898
|
-
"description": "Agent 开的子会话为父会话干活时各占一个名额;满了再开会当场失败,Agent 等其中一个做完再开,或者自己做。按这台机器算。",
|
|
899
|
-
"title": "同时执行的子会话",
|
|
900
|
-
"order": 10,
|
|
901
|
-
"default": 5
|
|
902
893
|
}
|
|
903
894
|
},
|
|
904
895
|
"workflows": [
|
|
@@ -909,12 +900,7 @@
|
|
|
909
900
|
"agents": [],
|
|
910
901
|
"commands": [],
|
|
911
902
|
"capabilities": [],
|
|
912
|
-
"groups": [
|
|
913
|
-
{
|
|
914
|
-
"name": "subagents",
|
|
915
|
-
"capacity": "session.subagents"
|
|
916
|
-
}
|
|
917
|
-
],
|
|
903
|
+
"groups": [],
|
|
918
904
|
"gitCredentials": [],
|
|
919
905
|
"endpoints": [],
|
|
920
906
|
"views": [],
|
|
@@ -1017,7 +1003,7 @@
|
|
|
1017
1003
|
"id": "workflows",
|
|
1018
1004
|
"displayName": "工作流",
|
|
1019
1005
|
"description": "流程模板、运行进度与流程图",
|
|
1020
|
-
"version": "1.0.
|
|
1006
|
+
"version": "1.0.3",
|
|
1021
1007
|
"category": "工作流程",
|
|
1022
1008
|
"icon": {
|
|
1023
1009
|
"symbol": "flowchart.fill",
|
|
@@ -1029,29 +1015,7 @@
|
|
|
1029
1015
|
},
|
|
1030
1016
|
"dir": "src/resources/plugins/workflows",
|
|
1031
1017
|
"title": "工作流",
|
|
1032
|
-
"properties": {
|
|
1033
|
-
"workflows.remoteCallerWorkflows": {
|
|
1034
|
-
"type": "array",
|
|
1035
|
-
"description": "本机所有绑定的会话记录共用;project 填本机目录 ID,workflow 填流程名。",
|
|
1036
|
-
"title": "远端调用方可发起的流程",
|
|
1037
|
-
"rows": {
|
|
1038
|
-
"type": "object",
|
|
1039
|
-
"columns": {
|
|
1040
|
-
"project": {
|
|
1041
|
-
"type": "string"
|
|
1042
|
-
},
|
|
1043
|
-
"workflow": {
|
|
1044
|
-
"type": "string"
|
|
1045
|
-
}
|
|
1046
|
-
},
|
|
1047
|
-
"required": [
|
|
1048
|
-
"project",
|
|
1049
|
-
"workflow"
|
|
1050
|
-
]
|
|
1051
|
-
},
|
|
1052
|
-
"default": []
|
|
1053
|
-
}
|
|
1054
|
-
},
|
|
1018
|
+
"properties": {},
|
|
1055
1019
|
"main": "main.mjs",
|
|
1056
1020
|
"workflows": [],
|
|
1057
1021
|
"services": [],
|
|
@@ -56,7 +56,7 @@ const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
|
56
56
|
export function firstMessage(value) {
|
|
57
57
|
object(value, '首次发送');
|
|
58
58
|
keys(value, ['requestId', 'projectId', 'title', 'agent', 'checkout', 'settings', 'text', 'attachments', 'quotes', 'handoffSource', 'parentThreadId',
|
|
59
|
-
'replyTo', 'threadId', 'modes', 'initiatedBy'
|
|
59
|
+
'replyTo', 'threadId', 'modes', 'initiatedBy']);
|
|
60
60
|
const initiatedBy = value.initiatedBy === undefined ? {} : (() => {
|
|
61
61
|
const source = object(value.initiatedBy, '发起会话');
|
|
62
62
|
keys(source, ['threadId', 'title']);
|
|
@@ -66,16 +66,6 @@ export function firstMessage(value) {
|
|
|
66
66
|
})();
|
|
67
67
|
const handoff = value.handoffSource === undefined ? {} : { handoffSource: text(value.handoffSource, '交接来源', 100) };
|
|
68
68
|
const parent = value.parentThreadId === undefined ? {} : { parentThreadId: text(value.parentThreadId, '父会话', 100) };
|
|
69
|
-
// A session made in a session a plugin provides, as its bot (components/session-links): the `coda/session@1` record, this
|
|
70
|
-
// machine's or another's by its `remote:` reference, and what there wakes it — a message that @s or answers it
|
|
71
|
-
// (`mention`, the default), or any (`all`). That the record is one a provider has is checked as the session is made.
|
|
72
|
-
const link = value.link === undefined ? {} : (() => {
|
|
73
|
-
const named = object(value.link, '外部会话');
|
|
74
|
-
keys(named, ['record', 'wake']);
|
|
75
|
-
check(!parent.parentThreadId && !value.initiatedBy, 'invalid_input', '外部会话里的会话须为用户新建的独立会话');
|
|
76
|
-
check([undefined, 'mention', 'all'].includes(named.wake), 'invalid_input', 'wake 须为 mention 或 all');
|
|
77
|
-
return { link: { record: text(named.record, '外部会话', 2048), wake: named.wake ?? 'mention' } };
|
|
78
|
-
})();
|
|
79
69
|
check(!parent.parentThreadId || handoff.handoffSource === parent.parentThreadId, 'invalid_input', '子会话必须引用父会话上下文');
|
|
80
70
|
// Whom a child the user starts answers (#1904「回复权」): its parent, as a call of the parent's would (`parent`, the
|
|
81
71
|
// default), or the user who started it (`sender`): under its parent all the same, which is where it belongs, not whom it
|
|
@@ -104,7 +94,6 @@ export function firstMessage(value) {
|
|
|
104
94
|
...handoff,
|
|
105
95
|
...initiatedBy,
|
|
106
96
|
...parent,
|
|
107
|
-
...link,
|
|
108
97
|
...reply,
|
|
109
98
|
...(value.threadId === undefined ? {} : { threadId: value.threadId }),
|
|
110
99
|
requestId: text(value.requestId, '请求标识', 100),
|
package/check/coda/contract.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"commit": "
|
|
2
|
+
"commit": "90e925cb08a4b4608364c9fd6161d267bcb1d075",
|
|
3
3
|
"packages": {
|
|
4
4
|
"@0dep/piso": "5.2.0",
|
|
5
5
|
"@agentclientprotocol/sdk": "2.6.0",
|
|
6
|
-
"@coda-console/protocol": "6.
|
|
6
|
+
"@coda-console/protocol": "6.2.0",
|
|
7
7
|
"ajv": "8.20.0",
|
|
8
8
|
"yaml": "2.9.1"
|
|
9
9
|
},
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"check/coda/application/contributions.mjs": "2796b02e92c7ba0805d1d1d83afd08c6f8beeab92d026381736c7d54b39b455f",
|
|
12
12
|
"check/coda/components/protocols/creation.mjs": "2b4a400d3064af4b5106077dc783c567910fef3c47b2d52af3f0d838c5accf19",
|
|
13
13
|
"check/coda/components/protocols/types.mjs": "6876689142866bd45fc085951f6ea9e1fc303334e3657e97cc9cf5e277311248",
|
|
14
|
-
"check/coda/adapters/provider-api.mjs": "
|
|
14
|
+
"check/coda/adapters/provider-api.mjs": "2b0802b52ae4d894e92f1fa7647cf727556f4008ad5e63c14e6400dc24bb3a6e",
|
|
15
15
|
"check/coda/adapters/admission-api.mjs": "f19706eb66e598fceb1a72ac81c51e48f4dc0179a18a73edaccb4d68ca629f56",
|
|
16
16
|
"check/coda/components/composers/contributions.mjs": "43d3e15fb1f63b7b5c20716030d9537613809ed5cc2fb466a3678bfa308f9f92",
|
|
17
17
|
"check/coda/components/composers/schemas.mjs": "6d497f58147756e789f9a566b2366f2fe36c0c72310421fb02508bf24a04f2c0",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"check/coda/components/plugins/plugin-source-rules.mjs": "1b6c0fb1868481627f09b7227bc64ef07fe669dcc344dad353e6743adf6c9c5d",
|
|
25
25
|
"check/coda/components/plugins/skill-document.mjs": "153ad3c096c7c9b7774bcf7dcc0ba603c962ee1ac8697c8a71e3f2c9ba9c92e6",
|
|
26
26
|
"check/coda/components/prompt-recovery/prompt-recovery.mjs": "f43f21d24c19a58113d3304f9248225b12080ab00ed15eab74bf7b94642732de",
|
|
27
|
-
"check/coda/components/session-config/commands.mjs": "
|
|
27
|
+
"check/coda/components/session-config/commands.mjs": "a303876b39478f217cb465138da96c864d68d836041e705db3a540982a014391",
|
|
28
28
|
"check/coda/components/session-config/contributions.mjs": "74d52d65dc7b6f13ef301a211bdf50cc91ae468c462cbe201f5dc34f7437b97b",
|
|
29
29
|
"check/coda/components/workflows/contributions.mjs": "43e656a2d502b851679d8da11e74a6fb843c47a1502bfc948da719855ca7b438",
|
|
30
30
|
"check/coda/domain/agent-protocol.mjs": "14ea3549a80810a2b8bcf869fc27dc799ad1beb3b77a608034345b9972c3d566",
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
"check/coda/resources/plugins/resources/panels/panels.mjs": "452860c6b1b39dd9a67a8dadf4dac8f7773741b3608274494a8ac518a01f5b33",
|
|
40
40
|
"check/coda/resources/plugins/resources/panels/rules.mjs": "80da2709985c3866fff1698ea4d1c1afdf59cac2cc955605d3ec6c35f181eec6",
|
|
41
41
|
"check/coda/resources/plugins/resources/panels/sign-in.mjs": "1271a24e33b1b882a1fb9bee03b8e240db8b9bee1b5208f0e1c84499cfb1be7e",
|
|
42
|
-
"check/coda/builtin.json": "
|
|
42
|
+
"check/coda/builtin.json": "1c77e396106383516e7f771a986406059f6328eb61108c450b8affe06a15fb29"
|
|
43
43
|
}
|
|
44
44
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coda-console/plugin-check",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.15",
|
|
4
4
|
"description": "Coda 插件的契约检查:扮演 Coda 读清单、启动 Agent 讲 ACP 与 _coda/wait、读资源类型(与旧的面板)。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@0dep/piso": "5.2.0",
|
|
26
26
|
"@agentclientprotocol/sdk": "2.6.0",
|
|
27
|
-
"@coda-console/protocol": "6.
|
|
27
|
+
"@coda-console/protocol": "6.2.0",
|
|
28
28
|
"ajv": "8.20.0",
|
|
29
29
|
"yaml": "2.9.1"
|
|
30
30
|
},
|