fix: ljqCtrl Press list bug, update SOPs (must call working_mem), agentmain round-end marker

This commit is contained in:
Jiaqing Liang
2026-02-24 16:43:05 +08:00
parent 860d305c44
commit 07a53889fb
6 changed files with 63 additions and 20 deletions

View File

@@ -10,6 +10,8 @@
- 不满足map模式的任务 → 主agent顺序执行即可别用subagent
**额外场景SOP dry-run验证**——启动单个subagent执行目标SOP通过output日志发现SOP缺陷缺参数/选择器不准/步骤模糊主agent据此patch优化SOP。单subagent不存在资源冲突。
- 测SOP质量input指定SOP名如"用ezgmail_sop查看最近3封未读邮件"排除导航干扰失败即SOP问题
- 测导航能力input只写目标验证subagent能自主从insight找到正确SOP。禁止内联SOP内容
**标准流程map-reduce**
1. 主agent准备阶段爬取/dump数据存为多个独立输入文件
@@ -17,16 +19,23 @@
3. 收集等所有subagent完成主agent读取各输出文件汇总结果
## Task Mode 文件IO协议
- 目录:`./{task_name}/`,启动:`python agentmain.py --task {task_name} [--llm_no N]`cwd=GenericAgent根
- 目录:`temp/{task_name}/`相对代码根GenericAgent/主agent cwd在temp/时即 `./{task_name}/`
- 启动:`python agentmain.py --task {task_name} [--llm_no N]`cwd=代码根)
- 流程:写 input.txt → 启动 → 轮询 output.txt → 读回复 → 写 reply.txt 继续 → 不写则5min自动退出
- input.txt原则写目标+约束可指定SOP名。禁写具体实现步骤——除非主agent已读过该SOP确认正确。凭印象猜的步骤会误导subagent
- reply后subagent的后续输出在 output1.txt, output2.txt ... 中递增编号主agent需轮询这些文件
- output.txt 每轮覆盖写,用 mtime/size 判断新轮次
## 后台调用要点
```python
task_dir = os.path.join(agent_root, 'temp', task_name)
proc = subprocess.Popen(
[sys.executable, 'agentmain.py', '--task', task_name],
cwd=agent_root, creationflags=0x08000000)
cwd=agent_root, creationflags=0x08000000,
stdout=open(os.path.join(task_dir, 'stdout.log'), 'w', encoding='utf-8'),
stderr=open(os.path.join(task_dir, 'stderr.log'), 'w', encoding='utf-8'))
```
- 必须 Popen禁止 subprocess.run会阻塞
- stdout.log/stderr.log 用于调试subagent卡死、LLM调用失败等问题
- `--llm_no` 默认=sonnet 4.5`--llm_no 1`=opus 4.6
- 文件统一 UTF-8subagent 无 reply 5min 自动退出无需清理