@coda-console/claude 1.15.0 → 1.16.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/README.md +5 -0
- package/agent/questions.mjs +5 -1
- package/agent/registry.mjs +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,6 +30,11 @@ SDK 的查询自己结束(Claude 进程被杀、崩溃、正常退出)时,
|
|
|
30
30
|
会话已结束后再来的 `session/prompt` 当场拒绝,错误文字是 `Claude 会话未在运行:<原因>`,标 `session_ended`、`input: "not_accepted"`(输入没有进原生会话,Coda 整条重发)。
|
|
31
31
|
换模型服务时重启查询失败、输入还没交给新查询的,同样是 `session_ended` + `not_accepted`;失败本身已带别的类别(如额度、服务)的保留原类别,类别允许 `input` 时补上 `not_accepted`(`auth_required` 不带 `input`,原样保留)。设置项请求(`session/set_config_option`)只带原因,不带标记。
|
|
32
32
|
|
|
33
|
+
## 提问被拒绝
|
|
34
|
+
|
|
35
|
+
Claude 的提问(AskUserQuestion)是一张表单,回包不是 `accept` 就回给 Claude `deny`。宿主当场拒绝表单(回 `decline`,`_meta.coda.reason` 是非空文字,协议「宿主当场拒绝表单」)时,`deny.message` 就是这段文字原文;
|
|
36
|
+
不带 reason 的 `decline` 与 `cancel` 仍是「用户取消了问答」。
|
|
37
|
+
|
|
33
38
|
## 失败怎样分类
|
|
34
39
|
|
|
35
40
|
一轮失败时,入口(`agent/errors.mjs` 的 `claudeFailure`,纯函数)只按最终错误标失败类别(协议 `failure.json`),重试策略归 Coda,插件里没有重试或等待。
|
package/agent/questions.mjs
CHANGED
|
@@ -19,7 +19,11 @@ export function questionForm({ sessionId, toolCallId, input }) {
|
|
|
19
19
|
const params = { sessionId, ...(toolCallId ? { toolCallId } : {}), mode: 'form', message: 'Claude 需要你的回答',
|
|
20
20
|
requestedSchema: { type: 'object', properties, required: questions.map((_, i) => `q${i}`) } };
|
|
21
21
|
const answer = response => {
|
|
22
|
-
if (response?.action !== 'accept')
|
|
22
|
+
if (response?.action !== 'accept') {
|
|
23
|
+
// The host's own refusal of the form (coda-protocol「宿主当场拒绝表单」) carries its text; the model gets it as it is.
|
|
24
|
+
const reason = response?.action === 'decline' ? response._meta?.coda?.reason : null;
|
|
25
|
+
return { behavior: 'deny', message: typeof reason === 'string' && reason.trim() ? reason : '用户取消了问答' };
|
|
26
|
+
}
|
|
23
27
|
const content = response.content ?? {};
|
|
24
28
|
return { behavior: 'allow', updatedInput: { ...input, answers: Object.fromEntries(questions.map((q, i) => {
|
|
25
29
|
const other = String(content[`q${i}_other`] ?? '').trim() || '其他', pick = value => value === OTHER ? other : value;
|
package/agent/registry.mjs
CHANGED
|
@@ -61,6 +61,7 @@ export const MESSAGES = {
|
|
|
61
61
|
'system/task_summary': internal,
|
|
62
62
|
'system/session_metadata': internal,
|
|
63
63
|
'system/dev_intent': internal,
|
|
64
|
+
'system/permission_check_status': internal,
|
|
64
65
|
active_goal: internal,
|
|
65
66
|
autocompact_state: internal,
|
|
66
67
|
command_lifecycle: internal,
|