Source selections attached while a Copilot SDK agent is running don’t reach the model
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start with the reproduction: create an SDK session with a pausable tool, send a steering message with mode "immediate" carrying a selection attachment, and inspect the next model request. The selection is persisted in the user.message event but is missing from that request, while the same attachment sent while idle arrives. Find where immediate-mode messages are built for the model and make them handle selections as the idle path does. Done means a regression test that sends a selection during a tool call and asserts the model request includes its text, path and range.
由索引模型根据 Issue 内容生成。
描述
I ran into this while dogfooding a language-model provider for Vercel AI Gateway I'm working on, using a Copilot chat.
While the agent was working, I attached a few source selections and asked whether some verbose validation code would benefit from Zod or another approach. The selections appeared as attachment chips in my message, but the agent asked which file I meant. When I pointed out that the selections were attached, it said it had received only a browser-page attachment.
That was confusing: from my perspective, I’d already supplied exactly the context it was asking for.
What we found
I worked with an agent to trace the selections through the installed VS Code agent host. It forwards their text, file paths and ranges to the SDK, and the SDK persists them in its user.message event. However, they’re absent from the request that reaches our model provider.
We then reproduced the behavior using the installed SDK/runtime directly, with synthetic model responses and no VS Code or Vercel provider involved:
| Same selection and text-blob attachments | Selection reaches model | Text blob reaches model |
|---|---|---|
| Message sent while idle | Yes | Yes |
mode: "immediate" during a tool call |
No | Yes |
Both cases persist the attachments correctly. The comparison reproduced twice.
Reproduction
- Create an SDK session with a tool whose handler can be paused.
- Have a synthetic model response invoke that tool.
- While its handler is paused, send an immediate message containing a
selectionattachment with text, file path and range, plus a text-blob attachment as a control. - Release the tool and inspect the next model request.
The steering message and text blob are present, but the selection is missing. Sending those same attachments while idle includes the selected code and its location.
Tested with the versions bundled in my VS Code installation:
- SDK:
1.0.17-unstable.37397886721.gad270aa - Runtime:
1.0.92-4.unstable.r37397886721.gad270aa
Expected behavior
I’d expect source selections attached to a steering message to reach the model just as they do when sent while idle.
Reviewing code while an agent continues working feels like a pretty normal use of steering. Ideally, selection rendering would follow the same path for both delivery modes, with a regression test covering attachments sent during a tool call. The visible attachment chips should accurately represent the context the agent receives.
- 主要语言
- Java
- 星标
- 10.7k
- 派生
- 1.5k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/copilot-sdk 的其他 Issue
-
Rust: ElicitationRequest drops the tool call id from elicitation.requested可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
github/copilot-sdk#2900 ·
-
难度 1/5 1 小时以内 新手友好度 84/100
github/copilot-sdk#2876 · 1 条评论 · 1 个 reaction ·
-
Python ModelLimits drops max_output_tokens from model metadata可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
github/copilot-sdk#2798 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
github/copilot-sdk#2759 ·
-
docs/AGENTS.md is repo authoring guidance, but everything in docs/ gets published可能重新可做 关联的 PR 已关闭且未合并。 未关闭documentation
难度 1/5 1 小时以内 新手友好度 85/100
github/copilot-sdk#2758 ·
查看 github/copilot-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
ls1intum/thesis-management#1473 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
LunaDeerMC/Dominion#301 · 1 条评论 ·
-
[FEATURE] Expose external refresh, node-level translog and warmer stats可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭untriaged
难度 2/5 1-3 小时 新手友好度 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 2 天内回复