fix: defensive CDP config init (makedirs+try/except); tweak autonomous sop wording
This commit is contained in:
@@ -24,7 +24,10 @@ if not os.path.exists(mem_insight):
|
||||
open(mem_insight, 'w', encoding='utf-8').write(open(t, encoding='utf-8').read() if os.path.exists(t) else '')
|
||||
cdp_cfg = os.path.join(script_dir, 'assets/tmwd_cdp_bridge/config.js')
|
||||
if not os.path.exists(cdp_cfg):
|
||||
open(cdp_cfg, 'w', encoding='utf-8').write(f"const TID = '__ljq_{hex(random.randint(0, 99999999))[2:8]}';")
|
||||
try:
|
||||
os.makedirs(os.path.dirname(cdp_cfg), exist_ok=True)
|
||||
open(cdp_cfg, 'w', encoding='utf-8').write(f"const TID = '__ljq_{hex(random.randint(0, 99999999))[2:8]}';")
|
||||
except Exception as e: print(f'[WARN] CDP config init failed: {e} — advanced web features (tmwebdriver) will be unavailable.')
|
||||
|
||||
def get_system_prompt():
|
||||
with open(os.path.join(script_dir, 'assets/sys_prompt.txt'), 'r', encoding='utf-8') as f: prompt = f.read()
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
0. 从 `TODO.txt` 取一条作为当前任务
|
||||
1. update_working_checkpoint: `{选定的当前任务}\n(自主行动时长期保留)subagent任务完成后需重读自主行动sop确定验收流程`
|
||||
2. 按 subagent_sop 召唤 subagent,input 需要包含以下全部内容:
|
||||
- **任务**:详细介绍和要求当前任务 + 验收标准 + 一句话预期收益
|
||||
- **任务**:详细介绍和要求深入执行当前任务 + 验收标准 + 一句话预期收益
|
||||
- **权限边界**:可执行只读和实验性操作;严禁修改核心记忆/系统设置;严禁读取敏感数据(可检测存在性);控制在30回合内
|
||||
- 无需批准:只读探测、cwd 内写操作/脚本实验
|
||||
- 需要报告:修改 global_mem.txt / memory/ 下 SOP、安装软件、外部 API 调用、删除非临时文件
|
||||
|
||||
Reference in New Issue
Block a user