feat(hooks): 开放用户 http observe hooks 与 Clawd 接入文档#623
Merged
Cai-Tang-www merged 7 commits intoMay 11, 2026
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Collaborator
Author
|
已按 review 补充修复,新增提交: 本次修复点:
回归测试已通过:
|
Collaborator
Author
|
已补充一轮严格风险修复并推送,提交: 对应本轮 review 的处理:
已通过回归:
|
Collaborator
Author
|
又做了一轮严格自检(中断风险 / 语义清晰 / 安全兜底 / 注释可维护性),并补了一个小提交: 本次变更不改行为,只提升可维护性与语义一致性:
回归通过:
|
Collaborator
Author
|
/code 帮我提高测试覆盖率,越高越好,然后完成后推送到我的分支 |
完成情况已补充并推送测试覆盖率提升提交 本次补测
验证结果
关键新增逻辑的函数覆盖率已明显提高,例如:
|
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更摘要
本 PR 以“最小可用、默认安全”为原则,开放用户可配置的
http observehooks(kind: http+mode: observe),并补齐面向用户的接入文档(含 Clawd 桌宠示例)。具体改动
1)运行时能力开放(代码)
runtime.hooks.items配置:kind: httpmode: observecommand/prompt/agent,避免能力面误扩张。http observe保持“只观测、不阻断”语义:failure_policy=fail_closedparams.url为绝对http/https地址method/headers配置合法性2)测试补齐
http/observe的通过与失败场景校验。HookKindHTTP的规范化与验证测试。command/prompt/agent仍被拒绝。3)文档更新(仓库文档 + 文档站)
docs/配置与设计文档,明确当前能力边界:builtin/sync与http/observewww/用户文档:用户价值
对普通用户
对稳定性
对接入效率
本地验证
已执行并通过以下测试:
go test ./internal/config -run "RuntimeHooks" -count=1go test ./internal/runtime/hooks -run "HookSpecNormalizeAndValidate" -count=1go test ./internal/runtime -run "HTTPObserve|ConfigureRuntimeHooksRejectsExternalKind|BuildUserHookSpecAllowsHTTPObserve" -count=1