@coda-console/codex 2.0.1 → 2.1.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 +1 -0
- package/agent/questions.mjs +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,3 +44,4 @@ Codex Agent:Codex 插件提供的入口运行 codex-acp,报告子 Agent、
|
|
|
44
44
|
交令牌(`chatgptAuthTokens`)是 app-server 的实验接口:升级 codex-acp 或 Codex 时复核登录、`account/read` 的身份核对、续期请求与轮次边界。
|
|
45
45
|
|
|
46
46
|
「模型服务」设置、异步消息与提问见仓库根 README 的「模型服务」「Codex 异步消息与提问」。
|
|
47
|
+
异步提问被宿主当场拒绝(`decline` 带非空 `_meta.coda.reason`)时,交给 Codex 的是这段文字原文;不带 reason 的 `decline` 与 `cancel` 仍是「用户没有回答「<问题>」」。同步提问(`item/tool/requestUserInput`)由 codex-acp 回 `{ answers: {} }`,拿不到 reason。
|
package/agent/questions.mjs
CHANGED
|
@@ -51,8 +51,11 @@ export function questionForm(sessionId, questions) {
|
|
|
51
51
|
return { sessionId, mode: 'form', message: 'Codex 需要你的回答', requestedSchema: { type: 'object', properties, required: questions.map((_, i) => `q${i}`) } };
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
// What the user said to a card, as the message Codex is told, a line a question.
|
|
54
|
+
// What the user said to a card, as the message Codex is told, a line a question. A decline with the host's reason
|
|
55
|
+
// (coda-protocol「宿主当场拒绝表单」) is told as that text, once, as it is.
|
|
55
56
|
export function answerText(questions, response) {
|
|
57
|
+
const reason = response?.action === 'decline' ? response._meta?.coda?.reason : null;
|
|
58
|
+
if (typeof reason === 'string' && reason.trim()) return reason;
|
|
56
59
|
const content = response?.action === 'accept' && record(response.content) ? response.content : null;
|
|
57
60
|
return questions.map((q, i) => {
|
|
58
61
|
if (!content) return `用户没有回答「${q.title}」`;
|