Skip to content

feat(qoder): bridge native AskUserQuestion over ACP form elicitation - #915

Open
Liang-HZ wants to merge 1 commit into
spacering-net:mainfrom
Liang-HZ:feat/qoder-ask-elicitation
Open

Liang-HZ wants to merge 1 commit into
spacering-net:mainfrom
Liang-HZ:feat/qoder-ask-elicitation

Conversation

@Liang-HZ

Copy link
Copy Markdown
Contributor

背景

qodercli 内置的 AskUserQuestion 对 ACP 客户端的传输方式是 form elicitation(elicitation/create)——客户端不声明这个能力时,该工具在 ACP 下完全不可用,模型只能绕道其他提问渠道(我们这边实测是去调 codeg-mcp 的 ask_user_question,还因为裸名调用报了 Tool "ask_user_question" not found)。

codeg 的 form elicitation 桥已经完整(classify_elicitation → 同一张提问卡;build_elicitation_response → 类型化答案),之前只是没有把 Qoder 放进声明名单。本 PR 把 AgentType::Qoder 加进 build_client_capabilities 的 form elicitation 名单,并补能力门断言与实测报文 fixture 测试。

原始线验证(qodercli 1.1.67,2026-10-10)

用裸 ACP 客户端 initialize 声明 elicitation: {form:{}},再提示模型调用 AskUserQuestion:

  • CLI 先发 tool_call(title Ask user,toolCallId call_…),随后发 elicitation/create:
{"mode":"form","sessionId":"…","toolCallId":"call_d341dc678fad4b7a8ea5f42e","message":"Answer Questions",
 "requestedSchema":{"type":"object","properties":{"q0":{"type":"string","title":"选择",
   "description":"选 A 还是 B?\nA: 选择 A 选项。\nB: 选择 B 选项。",
   "oneOf":[{"const":"A","title":"A"},{"const":"B","title":"B"}]}},"required":["q0"]},
 "_meta":{"qoder":{"toolName":"AskUserQuestion"}}}

—— crate 的 flatten 会把外层的 sessionId/toolCallId 落进 ElicitationSessionScope,现有分类器原样读出题目(description)/表头(title)/oneOf 选项/toolCallId。

  • MCP 工具审批不受影响:声明该能力后,MCP 调用仍然走 session/request_permission(proceed_always_and_save / proceed_once / cancel)——用一个临时 stdio MCP server 实测确认,所以这次改动只影响“提问”这一条通道。

测试

  • classify_elicitation_reads_qoder_ask_user_question_form:按实测报文写 fixture(题目、表头、选项、toolCallId)。
  • client_capabilities_gate_per_agent:补 Qoder 断言。

(探测脚本和原始帧留在本机,需要可以附上。)

qodercli 1.1.67 runs its built-in AskUserQuestion over ACP `elicitation/create`
(form) when the client advertises form elicitation — without the bit the tool
is unusable over ACP (the model then flails onto the codeg-mcp ask tool).
Verified on the raw wire (2026-10-10, probe against 1.1.67):
- question form: prose in `description`, header in `title`, `oneOf` choices,
  scope flattened as top-level `sessionId`/`toolCallId`
- MCP tool-call approvals KEEP using `session/request_permission`, so only the
  question surface changes

- connection.rs: advertise `elicitation.form` to Qoder + capability test
- question.rs: fixture test off the real wire (classification + toolCallId)
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.

1 participant