Skip to content

fix(acp): hide other choice in question card when allow_other is false - #1131

Merged
xintaofei merged 6 commits into
spacering-net:mainfrom
ana52070:fix/ask-question-allow-other
Nov 12, 2026
Merged

xintaofei merged 6 commits into
spacering-net:mainfrom
ana52070:fix/ask-question-allow-other

Conversation

@ana52070

Copy link
Copy Markdown
Contributor

问题

在当前 Codeg 中,Antigravity 和 Pi Select 渠道通过 ACP 原生权限(session/request_permission)桥接会话提问交互。

  • ACP 权限响应协议仅支持传递预设选项的 optionId 枚举,底层运行时(如 Antigravity 内部的 localharness 和 agy_acp_server)会将传入的 option_id 转换为预设索引,无法承载自由文本。
  • 然而前端 AskQuestionCard 始终无差别渲染“其他”(Other)选项和输入框。
  • 当用户在 Antigravity 提问卡片中选择“其他”并输入自由文本后,后端 antigravity_option_id 无法匹配任何预设选项,Codeg 只能以 RequestPermissionOutcome::Cancelled 回应权限请求。
  • Antigravity 接收到 Cancelled 后直接视为用户放弃/未回复(unanswered=True),导致用户辛辛苦苦输入的文字被静默吞掉、当成交互取消。

改动

采用方案 A(标准协议与渲染解耦):在 QuestionSpec 中增加 allow_other 标识,仅允许支持自由文本的渠道显示“其他”,避免误导用户。

  1. 后端数据结构与解析适配(Rust / src-tauri):

    • 在 QuestionSpec 中增加 allow_other: bool 字段,通过 #[serde(default = "default_true")] 默认向后兼容为 true。
    • 在原生权限桥接 parse_antigravity_ask 与 parse_pi_select_ask 中,明确标记 allow_other: false。
    • 在支持自由文本的渠道(parse_questions、parse_grok_ext_questions、parse_form_questions、parse_cursor_ask_questions)中保持 allow_other: true。
    • 在历史卡片输入构造 grok_result_card_input 中透传 "allowOther": s.allow_other,确保历史消息与实时提问卡片表现一致。
  2. 前端卡片渲染与类型适配(TypeScript / React / src):

    • 在 QuestionSpec (src/lib/types.ts) 中补充 allow_other?: boolean;在 AskQuestion (src/lib/ask-question.ts) 中补充 allowOther?: boolean 并进行容错解析。
    • 在 AskQuestionCard (src/components/chat/ask-question-card.tsx) 中:
      • 单选分支:当 q.allow_other === false 时,隐藏 RadioGroup 中的“其他”条目及输入框。
      • 多选分支:当 q.allow_other === false 时,隐藏 Checkbox 中的“其他”条目及输入框。
      • 卡片高度估算 maxRows 动态根据 allow_other 状态计算,避免隐藏“其他”后留出多余空白。
    • 在 AskQuestionResultCard 中透传 allow_other 字段。
  3. 双端自动化测试:

    • 前端 Vitest:
      • src/components/chat/ask-question-card.test.tsx:新增单选和多选下 allow_other: false 时隐藏“其他”选项及输入框的断言,全量 33 个用例全部 PASS。
      • src/lib/ask-question.test.ts:兼容缺失与显式标记,57 个用例全部 PASS。
    • 后端 Rust (question.rs):增加 parse_antigravity_ask 和 parse_pi_select_ask 的 allow_other == false 断言,以及标准解析下的 allow_other == true 断言。

界面与效果展示

1. Antigravity 提问卡片(allow_other: false)

  • 界面仅展示预设选项,不再显示“其他”单选项和自定义文本输入框,引导用户从预设选项中选择,交互响应 100% 成功映射为原生 optionId。

2. 标准问答与 Codex 卡片(allow_other: true)

  • 保持既有行为不受任何影响,用户仍可正常选择“其他”并输入自由文本。

测试

@xintaofei

Copy link
Copy Markdown
Collaborator

codeg work task 516 is done — #1131 (5 files, +103/-7).

@xintaofei
xintaofei merged commit de59736 into spacering-net:main Nov 12, 2026
10 checks passed
xintaofei added a commit that referenced this pull request Nov 12, 2026
This release adds conversation moves between folders, clearer tracking of background work, and more convenient repository collaboration, while improving file search, memory usage and agent compatibility.

## New

- **Move idle conversations that are not tied to a task between open folders**, individually or in bulk, with menu selection and folder search while keeping their history.
- **Control the desktop Web Service from the status bar**, with its current status, start/stop controls and a new option to allow connections only from this computer.
- **PR/MR lists show CI status, passing/total counts and approval reminders**, with direct access to check details and approval of GitHub workflows awaiting maintainer authorization.
- **Agents can attach files and images when creating to-do tasks**, keeping reference material alongside the task instructions.

## Improved

- **Track background tasks and sub-agents from the running count above the chat input**, including work that continues after a reply ends and delegated agents awaiting your response.
- **Redesigned Session Details and message navigation** make it easier to find the running message, inspect sub-agents and review file changes.
- **Codex sub-agent activities now appear as expandable timeline steps**, with task details, replies, errors and a shortcut to open the child conversation.
- **Task completion comments can include an agent-drafted reply that you review and edit before publishing**, with an optional Codeg footer.
- **File search uses less frontend memory and avoids repeatedly scanning the same workspace**, while keeping results current as files change in open projects. (#1116 by @kogekiplay)
- **Updated Cursor to 2026.11.11-b912975, Kimi Code to 2.6.0, Qoder to 1.1.87, CodeBuddy to 2.183.0 and the ZCode bridge to 0.84.2.**

## Fixed

- **Further reduced memory retained by very long tool output and closed HTML previews.** (#1132, #1137 by @kogekiplay)
- **Codex MCP screenshots and image results display correctly in desktop and Web chat**, including after reopening a conversation. (#1134 by @PengXiaoyi)
- **Kimi MCP authorization correctly shows the browser authorization link and reconnection status while waiting.** (#1133 by @Cuinnchen)
- **Kimi Code 2.6.0 plan reviews no longer incorrectly appear as tool failures when you approve, dismiss or request changes**, both during the conversation and in its history.
- **The ZCode bridge supports encrypted credentials used by ZCode 3.18+**, fixing related execution failures and improving handling of duplicate history messages and replies.
- **Interactive question cards for agents such as DeepSeek Harness correctly display the question text and option descriptions**, fixing cases where only a short label appeared. (#1140 by @mvanhorn)
- **Antigravity instances configured as custom agents correctly display interactive questions and preserve your selections in conversation history.** (#1127 by @ana52070)
- **Questions that only accept preset choices, including applicable Antigravity and Pi questions, no longer offer an unsupported “Other” input**, preventing typed answers from being treated as cancellations. (#1131 by @ana52070)
- **Custom Antigravity instances on Windows now include their startup temporary files in automatic cleanup**, reducing disk space buildup after repeated launches. (#1139 by @ana52070)
- **Long content in dialogs such as the model picker no longer causes horizontal overflow or clips buttons.**
- **Fixed an occasional cleanup error when an agent connection ends.**

Thanks to @kogekiplay, @ana52070, @PengXiaoyi, @Cuinnchen and @mvanhorn for contributing to this release.

-----------------------------

# 发布版本 0.43.0

这一版支持跨文件夹移动会话,让后台任务进度更清晰、仓库协作更方便,并改进文件搜索、内存占用和智能体兼容性。

## 新增

- **支持将未绑定任务的空闲会话单独或批量移到其他已打开的文件夹**,可通过菜单选择或搜索目标文件夹,并保留历史记录。
- **桌面端状态栏新增 Web 服务入口**,可查看运行状态、快速启停,并支持将访问范围设为仅限本机。
- **PR/MR 列表直接显示检查状态、通过数与总数,并提示等待批准的工作流**,可点击查看检查详情或批准 GitHub 工作流运行。
- **智能体创建待办任务时可以附带文件和图片**,方便将参考资料与任务说明一起交给后续执行者。

## 改进

- **输入框上方集中显示后台任务和子智能体的运行数量与详情**,回复结束后仍可跟踪未完成的工作,并提示等待你回应的委派任务。
- **重新设计会话详情与消息导航**,更方便定位正在执行的消息、查看子智能体和审阅文件改动。
- **Codex 子智能体活动统一展示为可展开的时间线步骤**,可查看任务、回复和错误,并直接打开子会话。
- **任务完成后回写到 Issue 或 PR 的评论支持由智能体起草、经你审阅修改后发布**,并可选择是否附带 Codeg 落款。
- **文件搜索减少前端内存占用和重复扫描**,并随已打开项目中的文件变化更新搜索结果。(#1116 by @kogekiplay)
- **Cursor 更新至 2026.11.11-b912975,Kimi Code 更新至 2.6.0,Qoder 更新至 1.1.87,CodeBuddy 更新至 2.183.0,ZCode 桥接更新至 0.84.2。**

## 修复

- **进一步减少超长工具输出和已关闭 HTML 预览的内存占用。**(#1132、#1137 by @kogekiplay)
- **Codex 的 MCP 截图和图片结果可在桌面端与 Web 端正常预览**,重新打开会话后也能正确显示。(#1134 by @PengXiaoyi)
- **Kimi 等待 MCP 授权时会正确显示浏览器授权链接和重连状态。**(#1133 by @Cuinnchen)
- **Kimi Code 2.6.0 中批准计划、关闭审批或要求修改后,不再误显示为工具执行失败**,实时对话和历史记录均能正确展示。
- **ZCode 桥接兼容 3.18 及更新版本的加密凭据**,修复相关执行失败,并改善历史消息和回复重复显示的问题。
- **DeepSeek Harness 等智能体的提问卡片能正确显示问题正文和选项说明**,修复只显示简短标题、缺少问题内容或选项解释的情况。(#1140 by @mvanhorn)
- **以自定义智能体接入的 Antigravity 能正常显示交互式提问**,并在历史记录中保留你的选择。(#1127 by @ana52070)
- **Antigravity、Pi 中仅支持预设选项的提问不再显示「其他」输入框**,避免手动输入的回答被误当作取消。(#1131 by @ana52070)
- **Windows 上的自定义 Antigravity 实例会将启动临时文件纳入自动清理**,减少反复启动后的磁盘空间占用。(#1139 by @ana52070)
- **模型选择等弹窗遇到较长内容时不再横向溢出或遮挡按钮。**
- **修复智能体连接结束时偶发的清理异常。**

感谢 @kogekiplay、@ana52070、@PengXiaoyi、@Cuinnchen 和 @mvanhorn 为本次发布做出的贡献。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants