fix: use script_dir for cwd path instead of relative path

This commit is contained in:
Liang Jiaqing
2026-04-14 23:38:32 +08:00
parent d18c8438d3
commit d0a9b5de08

2
ga.py
View File

@@ -522,7 +522,7 @@ def get_global_memory():
script_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(script_dir, 'memory/global_mem_insight.txt'), 'r', encoding='utf-8', errors='replace') as f: insight = f.read()
with open(os.path.join(script_dir, 'assets/insight_fixed_structure.txt'), 'r', encoding='utf-8') as f: structure = f.read()
prompt += f'cwd = {os.path.abspath("./temp")} (用./引用)\n'
prompt += f'cwd = {os.path.join(script_dir, "temp")} (用./引用)\n'
prompt += f"\n[Memory] (../memory)\n"
prompt += structure + '\n../memory/global_mem_insight.txt:\n'
prompt += insight + "\n"