From adfa805fe3b4b2f30e25e5de039feabf83f9675d Mon Sep 17 00:00:00 2001 From: Liang Jiaqing Date: Sun, 26 Apr 2026 18:24:21 +0800 Subject: [PATCH] improve ask_user tool display and memory SOP prompt --- agent_loop.py | 5 +++++ ga.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/agent_loop.py b/agent_loop.py index 4f1a3947..aa250b9d 100644 --- a/agent_loop.py +++ b/agent_loop.py @@ -115,4 +115,9 @@ def _compact_tool_args(name, args): for k in ('path',): if k in a: a[k] = os.path.basename(a[k]) if name == 'update_working_checkpoint': s = a.get('key_info', ''); return (s[:60]+'...') if len(s)>60 else s + if name == 'ask_user': + q = str(a.get('question', '')) + cs = a.get('candidates') or [] + if cs: q += '\ncandidates:\n' + '\n'.join(f'- {c}' for c in cs) + return q s = json.dumps(a, ensure_ascii=False); return (s[:120]+'...') if len(s)>120 else s diff --git a/ga.py b/ga.py index a03223f3..80de3904 100644 --- a/ga.py +++ b/ga.py @@ -499,7 +499,7 @@ class GenericAgentHandler(BaseHandler): ''' + get_global_memory() yield "[Info] Start distilling good memory for long-term storage.\n" path = './memory/memory_management_sop.md' - if os.path.exists(path): result = file_read(path, show_linenos=False) + if os.path.exists(path): result = '自动读取L0内容:\n' + file_read(path, show_linenos=False) else: result = "Memory Management SOP not found. Do not update memory." return StepOutcome(result, next_prompt=prompt)