Files
nexus/wiki/concepts/竞态条件.md
2026-04-17 19:17:27 +08:00

17 lines
588 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "竞态条件"
type: concept
tags: []
---
## Definition
Sub-agent 并发编辑共享文件时导致的静默失败问题。原因是 edit tool 需要精确的 oldText 匹配,如果子代理在主会话读取和编辑之间修改了文件,编辑会静默失败。
## Solution
分离任务文件为两个角色:
1. `AUTONOMOUS.md` — 只读主文件,只包含目标和开放 backlog只有主会话编辑
2. `memory/tasks-log.md` — 追加日志,子代理只追加新行,从不编辑现有行
## Related
- [[Goal-Driven Autonomous Tasks]]
- [[Subagent 管理]]