Rust: ElicitationRequest drops the tool call id from elicitation.requested

未关闭 适合新手
#2,900 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

  • #2910 来自 @FOWEPJF255 —— 已关闭,未合并

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
backend

调研方向

阅读 Rust SDK 中 ElicitationRequest 的定义,以及将 elicitation.requested 转换为发给 ElicitationHandler 的请求的会话代码。添加可选字段 tool_call_id,并从事件中复制该字段;检查现有的 Rust 测试中有关此转换的部分,并补充测试,覆盖 ID 存在和为 None 两种情况。完成标准是:提供了 ID 时,handler 能收到该 ID;由 agent 发起的表单不受影响。

由索引模型根据 Issue 内容生成。

描述

The Rust SDK drops the tool call id when it hands an elicitation request to the session's ElicitationHandler, so a host can't tell which tool call raised a form.

What happens

The elicitation.requested session event carries an optional toolCallId (ElicitationRequestedData::tool_call_id, documented as "Tool call ID from the LLM completion; used to correlate with CompletionChunk.toolCall.id for remote UIs"). When the session converts that event into the ElicitationRequest it passes to ElicitationHandler, it copies message, requested_schema, mode, elicitation_source and url, but not the tool call id. ElicitationRequest has no field for it.

Why it matters

A host that draws tool calls in a transcript needs to know which call a pending form belongs to, for example to keep that call visible and marked as waiting on the user instead of collapsing it with finished work. Today the handler can only show the form on its own, unconnected to the call that raised it. Forms raised by MCP tools during a tool call are the common case.

Suggested change

Add tool_call_id: Option<String> to ElicitationRequest and fill it from the event's tool_call_id when building the request. It stays None for forms that aren't tied to a tool call, such as agent-initiated ones, so existing handlers are unaffected.

主要语言
Java
星标
10.7k
派生
1.5k
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/copilot-sdk 的其他 Issue

查看 github/copilot-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。