Repository navigation
[RT14 partial] 校验小型上下文的工具配对,保留执行器与确认验收缺口 - #720
Merged
Merged
Conversation
…p ci] Related to #711, RT14 partial work. Reuse the existing protocol validator for small contexts as well. Preserve valid conversations and existing compaction behavior. Selected-file offline regressions pass; full executor, confirmation, database and local-model testing remain unverified.
LIghtJUNction
marked this pull request as ready for review
October 11, 2026 12:40
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
13 tasks
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.
LMM API Pull Request
变更说明 / Summary
RT14 部分交付,不是助手权限或用户意图验收通过。保持 Draft,不合并、不发布、不部署。
基线:
2f4164978cf27f6e0e605b0589fbe631aef2c441。未采用 #675 的实现或测试替身。提交前读取的 main 为ed147e1d24c6fc127f898592f4f8639ca92e97db,相关context.go仍与基线相同。本次实际复现的局部问题:
internal/agent.Compact在上下文未超过字节上限时提前返回,未执行已有的工具调用/结果配对检查。因此,相同的不完整或不匹配工具交换会因字节上限不同而被接受或拒绝。本 PR 仅修改两个文件:新增独立回归测试;将现有配对检查移到体积快捷返回之前。不新增权限模型,不改提示词、奖励政策、MCP OAuth、支付或部署逻辑。合法完整对话的输出保持不变。此前被静默接受的小型非法工具交换现在返回错误。
这个局部问题不是已证实的越权、付费、数据外传或确认绕过。实际用户输入能否把这种结构送入应用,以及模型、执行器和数据库的完整链路,均未验证。
测试与修复分开提交:
a53fd01dfcd96b2c445a5c6c3150d18e6ca517b5:仅回归测试。a3ff114f1299c268f01533244590d5910140090a:仅移动现有检查位置。与上游的关系 / Upstream relationship
上游参考 / Upstream reference:本仓库内置助手上下文处理。保留已有版权和协议声明。
关联 Issue / Related issue
Related to #711。不关闭审计,不宣称 RT14 完成。
变更类型 / Type of change
验证 / Verification
实际环境:Go 1.23.2,离线。项目要求 Go 1.25.1;容器无法解析 GitHub 和 Go 依赖代理域名,无法取得完整可构建仓库和依赖。因此只运行下面这些原始源码文件,不是完整包、控制器或应用测试;未修改项目 go.mod。
原始源码均校验 Git blob:
context.go基线463438bef9ee4683fc68a45aa9c3b688d22cee79protocol.go基线ff15face0cf32ea427387f76cca8299ff6c4fca8提交后读回的修复源码与本机已测试内容一致:
context.go:0f3916688d39669b342eb10f123603bc268d2908f49e575e65e8fe4ead4197582724379d69b178c2另有两项本机补充检查:工具结果中的 JSON 控制字段不会自动变成结构化调用;失败记录在压缩后不会变成成功。它们只检查真实上下文函数,没有调用模型或实际工具执行器,不代表四类外部入口都已测试。
RT14 主验收状态:
搜索、MCP、文档模拟服务,四类外部内容入口,跨账号资料读取、超范围 Key、接收人替换,以及金额/接收人/工具/安装版本/参数变更后的旧确认重放,均未完成动态验证。没有实际本地模型测试,模型抗诱导行为未验证。不能把上表的“未执行”写成“被成功拦截”。
后续验收仍须通过实际执行器和独立数据库,并分别记录四层结果。本次源码中的角色与会话检查,不等于已验证本轮用户意图绑定。
截图或日志 / Screenshots or logs
完整本机修复前后日志、源码校验值及离线复跑脚本通过会话附件交付。公开 PR 仅保留不含真实秘密的结构回归用例;没有上传可利用的业务攻击载荷。无界面改动。
提交检查 / Checklist
已核对
.github/workflows在基线及提交前 main 的目录树一致;已读触发块均为workflow_dispatch。未触发远程 CI,未访问生产,未使用真实资金或通知,未发布、部署或合并。