Repository navigation
fix(chat): guide isolated writes through verified prerequisites - #7030
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
未发现阻塞性问题。在隔离项目里执行资料或代码任务的 Chat 与 Lark 用户会遇到这个问题。原来文件写入返回失败,Agent 仍可能启动依赖该文件的下一步;新增指引要求先检查退出码并读回产物,再继续。本次已验证上下文只在可写隔离项目自动增加这些指引,真实原生合成任务经历失败、修复和成功读回后才执行下一阶段。本次不修改沙箱授权、Shell 协议、FIFO 队列、停止与恢复机制。该指引不能机械保证模型每次遵守;原 Lark 安装后复验和完整社区准出仍须单独完成。
改动思路
现有上下文装配器已经覆盖本机 Chat 与绑定话题,直接补充其模型指引即可,无需新调度器、状态或权限入口。本 PR 交付范围是受限项目写入的默认准备与失败检查指引,以及中英文运行说明。没有把工具返回、生成哈希或一句成功说明当作产物已经落盘,也没有为解决临时文件失败开放额外目录。该改动提供模型指引,实际文件权限仍由原宿主执行。无需新状态机、设置或前端按钮,原有一条消息进入 Chat/Lark 的路径保持。
具体改动
_ISOLATED_WORK_GUIDANCE 说明系统临时目录限制、直接写入及退出码/前置产物核验;ChatProjectContexts.runtime_context 仅在 workspace_write 与 workspace_only 同时成立时追加它,原目标与回答约定逐字保留。运行说明增加中英文默认变化与能力限制。此处配对表只解释分支,不作为执行证据。
| 已有场景 | 本次结果 |
|---|---|
| 可写隔离项目 | 增加准备、失败检查和读回指引 |
| 只读或普通宿主 | 与原完整提示相同 |
| 管家与权限/队列/停止 | 沿原所有者,未新增策略 |
规范依据为 docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md,spec_revision 449ecdc497f06cef4e58ddbe5f4804dca4fc17e2;workspace_only 条款通过作用域反例保持隔离,Session-context 条款通过原队列/会话回归保持原上下文。参见固定规范。全量社区发布的三轮及原服务接受条件仍另行保留,不能由此 PR 的局部结果推断。
对主干的风险
主要风险是模型仍可能忽视指引。65 项既有项目、上下文和绑定回归通过;最终文档提交不改已测试源码字节,最终源码加文档的必要 premerge、编译和 Ruff 均通过。四类输入的八次真实 HTTP 到原生协议调用保留只读/普通宿主的完整提示;这一部分使用协议 fixture,不证明模型理解或沙箱安全。另一个真实原生 Codex 实例确认收到新指引,先记录失败,修正并检查前置文件,再执行后续步骤一次,原脚本保持不变。这是有界采用证据,尚无普遍可靠性或生产成功率结论。按本 Goal 的明确合同,未查询、轮询或等待 CI。
我的整体评价
我支持这一可独立回滚的有界增量:它修正已证实的默认工具使用缺口,复用现有上下文装配,没有重复权限 authority、引入协议分支或迁移已有记录。代码量为 13 行生产增量加 16 行配套说明;进一步抽象不会改善当前职责边界,因此本次无需额外重构。安装后的原 Lark 接收与返回验证由原 Bot 维护流程继续完成;完整社区准出保持独立验收,不能把本次批准当成全链路完成。
English verdict: APPROVE — exact head 3ad18cc1c0d4cfb23495503e9ec4b4140c4f5b9d. Scoped model guidance and its bilingual disclosure preserve existing authority and unaffected prompts. Existing regressions, paired HTTP/native prompt checks, one real native prerequisite-recovery case and required local premerge passed. General model reliability and installed community release remain outside this bounded approval; CI was not consulted.
When a command fails while writing an artifact, an isolated project assistant can start a dependent stage before checking the failed exit code or reading the required file. Shell here-documents also depend on temporary files outside the workspace grant.
Add guidance to the existing project context for
workspace_write+workspace_only: prefer direct workspace writes, check command results and exit codes, and read back the prerequisite artifact before proceeding. Existing read-only, ordinary host, steward, grant and sandbox behavior stays unchanged. This guides the model; it adds no hard workflow enforcement or permission.Validation: 65 existing project/context/binding regressions passed on this head, the required premerge checks passed, and the base/head scope matrix preserves all earlier instructions and unaffected contexts. One real isolated native Codex fixture observed a failed preparation, repaired and verified it, then executed the dependent stage once. That bounded observation does not establish general model reliability; installed Bot acceptance follows adoption. No CI was queried or awaited.