fix: verbose logic & insight wording & file_read anchor skip

This commit is contained in:
Liang Jiaqing
2026-04-10 09:56:22 +08:00
parent 2977be33c6
commit cc283a96f3
2 changed files with 6 additions and 5 deletions

View File

@@ -1,9 +1,9 @@
Facts(L2): ../memory/global_mem.txt | Code: ../ | SOPs(L3): ../memory/*.md or *.py | META-SOP(L0): ../memory/memory_management_sop.md
Insight是极简索引L2/L3变更时同步Insight索引必须极简。写记忆前先读META-SOP(L0)。
L1 Insight是极简索引L2/L3变更时同步L1索引必须极简。写记忆前先读META-SOP(L0)。
[CONSTITUTION]
1. 改自身源码先请示;./内可自主实验允许装包和portable工具
2. 决策前查记忆;未查证不断言
2. 决策前查记忆有SOP/utils必用多次失败回看SOP;未查证不断言
3. 分步执行控制粒度限制失败半径3次失败请求干预
4. 密钥文件仅引用,不读取/移动
5. 写任何记忆前读META-SOP核验memory下文件只能patch修改除非新建

3
ga.py
View File

@@ -413,7 +413,7 @@ class GenericAgentHandler(BaseHandler):
result = tips + result
if ' ... [TRUNCATED]' in result: result += '\n\n(某些行被截断,如需完整内容可改用 code_run 读取)'
result = smart_format(result, max_str_len=20000, omit_str='\n\n[omitted long content]\n\n')
next_prompt = self._get_anchor_prompt()
next_prompt = self._get_anchor_prompt(skip=args.get('_index', 0) > 0)
log_memory_access(path)
if 'memory' in path or 'sop' in path:
next_prompt += "\n[SYSTEM TIPS] 正在读取记忆或SOP文件若决定按sop执行请提取sop中的关键点特别是靠后的update working memory."
@@ -493,6 +493,7 @@ class GenericAgentHandler(BaseHandler):
prompt += f"\nCurrent turn: {self.current_turn}\n"
if self.working.get('key_info'): prompt += f"\n<key_info>{self.working.get('key_info')}</key_info>"
if self.working.get('related_sop'): prompt += f"\n有不清晰的地方请再次读取{self.working.get('related_sop')}"
if getattr(self.parent, 'verbose', False):
try: print(prompt)
except: pass
return prompt