Rust: subagent lifecycle hooks are logged as unknown
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 rust/src/hooks.rs 中的 dispatch_hook 开始,检查 HookType 值是如何进行匹配的。为 subagentStart 和 subagentStop 添加直通处理,然后添加一个覆盖这两个名称的针对性单元测试。当这些有效的生命周期钩子在没有警告的情况下返回标准空输出,而真正未知的名称仍然使用警告路径时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Bug
When Rust SDK hooks are enabled and the Copilot CLI starts or stops a task sub-agent, the CLI sends hooks.invoke requests with hookType values subagentStart and subagentStop. The Rust SDK logs both as unknown:
unknown hook type hook_type="subagentStart"
unknown hook type hook_type="subagentStop"
The generated HookType enum already declares both values, but rust/src/hooks.rs::dispatch_hook does not match them. The public SessionHooks API also has no dedicated callbacks for these lifecycle hooks.
Reproduction
- Create a Rust SDK session with hooks enabled.
- Invoke the built-in
tasktool so a sub-agent starts and completes. - Observe the warnings from
github_copilot_sdk::hooks.
Expected behavior
The SDK recognizes these valid callback-only lifecycle hook names and returns the standard empty output when no public callback is registered. Truly unknown hook names must continue to use the warning path.
Proposed fix
Handle subagentStart and subagentStop as pass-through hooks in dispatch_hook, with a focused unit test covering both names.
- 主要语言
- Java
- 星标
- 10.5k
- 派生
- 1.5k
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 111
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/copilot-sdk 的其他 Issue
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 68/100
github/copilot-sdk#2782 ·
维护者通常 1 天内回复
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 65/100
github/copilot-sdk#2779 ·
维护者通常 1 天内回复
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 65/100
github/copilot-sdk#2760 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
github/copilot-sdk#2759 ·
维护者通常 1 天内回复
-
documentation
难度 1/5 1 小时以内 新手友好度 85/100
github/copilot-sdk#2758 ·
维护者通常 1 天内回复
查看 github/copilot-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
checkstyle/checkstyle#21755 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
documentation Good for newcomer quick win
难度 2/5 1-3 小时 新手友好度 68/100
CodeForPhilly/benefit-decision-toolkit#519 ·
维护者通常 1 天内回复
-
area-deployment triage:bot-seen triage:needs-human
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/aspire#20533 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复