mirror of
https://github.com/shareAI-lab/analysis_claude_code.git
synced 2026-05-06 16:26:16 +08:00
auto_compact llm request error fixed
This commit is contained in:
@@ -117,7 +117,6 @@ def auto_compact(messages: list) -> list:
|
||||
# Replace all messages with compressed summary
|
||||
return [
|
||||
{"role": "user", "content": f"[Conversation compressed. Transcript: {transcript_path}]\n\n{summary}"},
|
||||
{"role": "assistant", "content": "Understood. I have the context from the summary. Continuing."},
|
||||
]
|
||||
|
||||
|
||||
@@ -227,6 +226,7 @@ def agent_loop(messages: list):
|
||||
if manual_compact:
|
||||
print("[manual compact]")
|
||||
messages[:] = auto_compact(messages)
|
||||
return
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -255,7 +255,6 @@ def auto_compact(messages: list) -> list:
|
||||
summary = resp.content[0].text
|
||||
return [
|
||||
{"role": "user", "content": f"[Compressed. Transcript: {path}]\n{summary}"},
|
||||
{"role": "assistant", "content": "Understood. Continuing with summary context."},
|
||||
]
|
||||
|
||||
|
||||
@@ -705,6 +704,7 @@ def agent_loop(messages: list):
|
||||
if manual_compress:
|
||||
print("[manual compact]")
|
||||
messages[:] = auto_compact(messages)
|
||||
return
|
||||
|
||||
|
||||
# === SECTION: repl ===
|
||||
|
||||
Reference in New Issue
Block a user