fix(agentmain): use pid+nanos for long-prompt temp filename#666
Open
Kailigithub wants to merge 1 commit into
Open
fix(agentmain): use pid+nanos for long-prompt temp filename#666Kailigithub wants to merge 1 commit into
Kailigithub wants to merge 1 commit into
Conversation
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.
修复
agentmain.py:148临时文件名使用秒级时间戳int(time.time()),在并发--func/run_subagents同一秒内会撞名 → 进程 A 写到user_prompt_1720xxx.md后被进程 B 覆盖;后续file_read读到的是别人任务的 prompt,产出串内容。改动
1 行:
int(time.time())→os.getpid() + time.time_ns(),与项目内code_run(用tempfile.NamedTemporaryFile)、ga_ultraplan.py _subagent(用全局递增序号)的一致性补齐。验证
/tmp/test_issue_665.py(8 threads × 50 attempts in 1s):线程池场景下,新方案 50/50 全唯一;旧方案 49/50 撞名。ProcessPool 也 30/30 唯一,覆盖
run_subagents多子进程场景。Closes #665