Skip to content

低优硬化:孤儿结果清扫、转录容错读、worker home 派生、跨实例读 (PR-4) - #32

Merged
Fei2411 merged 3 commits into
fix/mcp-lifecycle-acp-diagnosticsfrom
devin/fix-pr4-hardening
Oct 6, 2026
Merged

Fei2411 merged 3 commits into
fix/mcp-lifecycle-acp-diagnosticsfrom
devin/fix-pr4-hardening

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

剩余低优项的最小修复(刻意不做过度防御)。

  • A1:start() 清扫 results/ 下无 task 行引用的 task_*.txt 孤儿文件(崩溃于结果写与 save 之间的残留);foreign_task_ids 守卫——兄弟实例的文件不误删。
  • H-09:read_events 改 errors="replace",坏行走既有 JSONDecodeError skip,与 read_events_tail 行为对齐。
  • G2:build_worker_env(home=…),三个适配器传 self.home——worker 嵌套 home 从注册表 home 派生,不再误用协调器 env 里的 AGENT_BRIDGE_HOME。
  • F5:check_task/get_result 对非本实例 task 加磁盘只读回落(_merge_owned 本就留着兄弟行),返回带 from_state: true;wait_task/cancel_task 刻意不动——生命周期归 owner。
  • G5 不改码:坏 TOML fail-fast 是刻意契约(stderr 含文件名+行列+修复指引);「降级启动」需要无配置启动整条链路,收益不值改动。

测试:+4 用例,全套 625 passed / 1 skipped。

Link to Devin session: https://app.devin.ai/sessions/b270264aa3634bc5934cad9bcec9f9ae
Open in Devin Desktop: https://app.devin.ai/desktop/session/b270264aa3634bc5934cad9bcec9f9ae?variant=devin
Requested by: @FeiZhuLulu


Devin Review

- start() 清扫 results/ 里无 task 行引用的孤儿文件,foreign-live 守卫不误删兄弟实例(A1)
- read_events 改 errors=replace,与 read_events_tail 容错对齐(H-09)
- build_worker_env 增加 home 参数,worker 嵌套 home 从注册表 home 派生(G2)
- check_task/get_result 加磁盘只读回落并带 from_state 标记;生命周期仍归 owner(F5)
- G5 刻意不改码:坏 TOML fail-fast 是刻意契约,降级启动属过度设计
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

Devin Review found 3 potential issues.

Devin Review

Comment thread src/agent_bridge/registry.py
Comment thread src/agent_bridge/registry.py Outdated
Comment thread src/agent_bridge/registry.py
- 孤儿清扫在 state 文件锁内重读任务行,消除启动快照与 unlink 之间的 TOCTOU 窗口;state 不可读时整段跳过
- _load_state quarantine 置标志——state 为空是'损坏'而非'无任务',此时整段跳过清扫,防止误删 corrupt 文件中任务的结果
- 磁盘回落行的 silent_for_sec 报 None:状态时钟跟随 owner 实例,本实例无实时语义,0 会误读为刚活跃

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Devin Review

Comment thread src/agent_bridge/registry.py Outdated
FileLockTimeout 是 TimeoutError 而非 OSError——兄弟实例慢写持锁时 file_lock 超时逃出捕获域,把一个可选清扫变成了启动失败。捕获 TimeoutError 并跳过清扫
@Fei2411
Fei2411 merged commit ec83e68 into fix/mcp-lifecycle-acp-diagnostics Oct 6, 2026
5 checks passed
Fei2411 pushed a commit that referenced this pull request Oct 6, 2026
- 新增 diagnostics.redact_diagnostic,task.error/warnings、Codex/Antigravity 错误事件落盘前脱敏
- [env] deny 支持用户配置的 glob 名单,显式 set/agent env 优先;无内置禁止名单;dsh 回填同样遵守
- [agents.<name>] permission_policy:allow_once(默认)/ allow_always / deny;allow_once 下不选择 allow_always
- 同步 ORCHESTRATION、SETUP、skill 与 agents.toml.example 中 #29–#32 的契约变化
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant