Conversation
|
Thanks for the report! The fix is minimal — Let me know if you'd like any adjustments! |
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEADFor a same-repository clone whose Keep the DCO |
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=xhigh
动机
Windows 上接收带有本地输入文件的协作请求的用户和工作 Agent,会在读取 Inbox 时遇到这个问题。
例如,请求引用已经放在工作区里的需求文件。旧代码在打开文件前访问 Windows 不存在的标志,整个 Inbox 命令异常退出,而读回执已经写下;修复后能返回输入是否可用、是否变更的实际状态,让接收方继续独立评估。
独立探针走真实 manager-inbox 命令、持久请求与文件系统:缺标志的五类原失败均被修好,正常 Unix 与越界返回完整内容保持一致;没有把读取回执当成工作完成。
这是消除缺失 OS 标志崩溃的局部兼容修复,不改请求归属、读回执顺序或工作验收,也不宣称整条协作流程、所有 Windows 特殊设备或已安装版本完成资格验证。
代码修复已通过独立验证;本次 REQUEST_CHANGES 仅要求补齐贡献者签署,不把提交合规问题说成产品回归。
改动思路
继续使用现有 Inbox、原请求身份和工作区读取 owner,只把可选 OS 标志改为能力探测。支持该标志的 Unix 路径仍传同一值;不支持时传零,继续原来的常规文件检查、四 MiB 上限、摘要和不可用状态。请求读回执、独立评估、采纳、工作完成和返回结果仍是不同事实。此处 Python 是本地文件系统适配,不新造通用控制面决策,也无需扩大为 TS 迁移。
已检查同仓 collaboration_mcp.py:867 和 completion_result.py:32 的既有 getattr 用法。采用同一防御惯例合理;为了两处相似表达式增加全局抽象不会改善当前语义归属。
具体改动
完整 diff 仅 peers.py 一行 +1/-1。原始规范:spec_ref=https://github.com/loopx-project/loopx/issues/5511,spec_revision=body-sha256:81e75fa1e83883cf18316dc92842c93c234fa584c536afb05153b491dfaff4be(原正文创建/最后修改均为 2026-10-03T04:52:45Z)。逐项映射:1. 输入主读取路径不因缺标志崩溃 implemented;2. 原故障留下的读回执与真正返回分开判断 implemented,读回执顺序未改变,不宣称解决任意未来异常的事务语义。另有原贡献契约 CONTRIBUTING.md @ 12d60f1,License And DCO Sign-Off → not_met。
关键代码讲解
- input_readiness(peers.py:496,改动 :534):解析原工作区中的明确输入,getattr 只决定 open 的可选标志;fstat 非常规文件拒绝、大小限制、完整 SHA 和 content_supplied=false 都保留。输入不存在返回 unavailable,而非“没有工作”。
- read_inbox(peers.py:565):先读精确接收方请求并写 receiver_cli_read,再调用上述读取,最后返回原 brief 与状态。修复后这条真实生产命令确实可以返回;读取仍不代表 comprehension、adopt 或 Todo complete。没有改 Todo、租约或跨 Agent 权限。
对主干的风险
P2:唯一新增提交 1103984 没有 Signed-off-by trailer。已直接读取 Git 原提交、父提交及仓库 .github/workflows/dco.yml 的原正则,当前检查失败;这是普通单父贡献提交,不能使用 GitHub 签名双父整合提交的例外。未查询、等待或推断远端 CI 状态。请由贡献者本人按 CONTRIBUTING.md 在原提交上执行 git commit --amend -s,并更新此 PR 分支;不要由评审者替作者作 DCO 认证。新 head 再核验 trailer 与同一回归。
其他代码路径通过:四个完整仓库测试文件共123项;独立真实 CLI 七案例当前7 passed,冻结基线2 passed/5 failed,五个失败都为缺标志 AttributeError,并且各已有读回执。当前新增两个同请求文件恢复/新明确输入测试通过。七案例覆盖正常、缺标志、变更、缺失、越界、过大及目录;原 Unix FIFO bounded case也在123项中。正常 Unix完整返回与回执的归一化 SHA为10b18fafecade1219dc6f818510e5990cf9ac8fa6d3788f0eb5322aa42a9fce3,base/head完全相同;仅归一化生成的请求/来源 ID 和时钟,保留所有诊断、brief、状态、hash和receipt字段,越界返回也完全相同。fixture SHA4053b559ea03008d46959d1dad57e098a028e7d232b4a6a8765408c5d3ba0f7e。
先 advisory 后 full semantic,再 Ruff、mypy、diff check、control-plane typecheck 六项都通过。缺标志是在子进程内模拟,走真实 CLI/后端/文件,而不是只 mock helper;这不是原生 Windows 重新运行,也未验证所有 Windows 特殊设备。保留这项局限,不把它泛化成浏览器或授权缺口。DCO检查脚本文件名首次猜错的命令是评审者 selector 错误,已用实际仓库工作流表达式核验,不算产品失败。
typed-state、domain-neutrality、behavior disclosure、guidance-vs-obligation、authority 六类 lens 已核对:没有新状态、字符串分类或权限,OS默认变化已披露;不是 opt-in,不会引入 feature-off 例外、自动启动或新的强制工作。
我的整体评价
局部崩溃修复 goal_achieved;long_horizon improved,重复读取可继续,原请求和 brief 未丢失;user_experience improved,实际输入反馈恢复。它不关闭更大的协作 RFC。范围 proportionate,兼容性保留合理;future-facing pass 认为 OS 适配不需新 helper/平行 TS owner,增加一个耐久缺标志回归有价值但不是凭空的新框架要求。
代码无已验证阻塞缺陷;当前仅贡献 DCO not_met,所以 REQUEST_CHANGES。补签后产生新 head,应复核签署和同一读取回归,不必扩大运行时修复。未批准、未合并,也未撤销任何尚未解决的评审。
English verdict: REQUEST_CHANGES - HEAD 1103984. The missing-flag code fix passes independent production-CLI/store qualification and full Unix parity. The sole blocker is the unsigned contribution commit required by CONTRIBUTING.md and the source DCO workflow. Please self-certify with git commit --amend -s and update this PR. Native Windows/device and installed-runtime qualification are not claimed; no CI polling or merge.
os.O_NONBLOCK is a Unix-only flag that does not exist on Windows. On Windows, os.open() with os.O_NONBLOCK raises AttributeError, crashing the inbox read path whenever a peer request brief carries inputs. Use getattr(os, 'O_NONBLOCK', 0) so the flag degrades to blocking mode (0) on Windows, where regular file reads are already safe. Fixes loopx-project#5511 Signed-off-by: Jah-yee <166608075+Jah-yee@users.noreply.github.com>
1103984 to
6fc15f7
Compare
|
Thanks for the thorough review! DCO sign-off has been added (Signed-off-by: Jah-yee 166608075+Jah-yee@users.noreply.github.com). The +1/-1 peers.py fix is unchanged — only the trailer was appended. Ready for re-review. |
|
Thank you for the thorough review. DCO sign-off has been added — the updated commit |
|
Closing this PR — the os.O_NONBLOCK fix has already been merged to main via PR #5456. The fix (getattr(os, 'O_NONBLOCK', 0) guard) is present in the latest main branch. Thanks! |
Summary
Fixes
AttributeErroron Windows whenpeers.py's inbox read path encounters a peer request brief withinputs.Problem
os.O_NONBLOCKis a Unix-only flag that does not exist on Windows. On Windows,os.open(path, os.O_RDONLY | os.O_NONBLOCK)raisesAttributeError: module 'os' has no attribute 'O_NONBLOCK', crashing the inbox read path.Fix
Replace
os.O_NONBLOCKwithgetattr(os, 'O_NONBLOCK', 0). On Windows this degrades to blocking mode (0), which is safe for regular file reads. On Unix/Linux/macOS the flag is preserved as-is.Location
loopx/control_plane/collaboration/peers.py:534Testing
python3 -m py_compilepassesFixes #5511