diff --git a/agents/s06_context_compact.py b/agents/s06_context_compact.py index 04899b5..ab47bcb 100644 --- a/agents/s06_context_compact.py +++ b/agents/s06_context_compact.py @@ -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__": diff --git a/agents/s_full.py b/agents/s_full.py index 2a816b5..628aa81 100644 --- a/agents/s_full.py +++ b/agents/s_full.py @@ -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 === diff --git a/docs/en/s06-context-compact.md b/docs/en/s06-context-compact.md index d3e2d46..2fbef2e 100644 --- a/docs/en/s06-context-compact.md +++ b/docs/en/s06-context-compact.md @@ -81,7 +81,6 @@ def auto_compact(messages: list) -> list: ) return [ {"role": "user", "content": f"[Compressed]\n\n{response.content[0].text}"}, - {"role": "assistant", "content": "Understood. Continuing."}, ] ``` diff --git a/docs/ja/s06-context-compact.md b/docs/ja/s06-context-compact.md index 555cc01..6927e7d 100644 --- a/docs/ja/s06-context-compact.md +++ b/docs/ja/s06-context-compact.md @@ -81,7 +81,6 @@ def auto_compact(messages: list) -> list: ) return [ {"role": "user", "content": f"[Compressed]\n\n{response.content[0].text}"}, - {"role": "assistant", "content": "Understood. Continuing."}, ] ``` diff --git a/docs/zh/s06-context-compact.md b/docs/zh/s06-context-compact.md index c9d2a2b..cce879f 100644 --- a/docs/zh/s06-context-compact.md +++ b/docs/zh/s06-context-compact.md @@ -81,7 +81,6 @@ def auto_compact(messages: list) -> list: ) return [ {"role": "user", "content": f"[Compressed]\n\n{response.content[0].text}"}, - {"role": "assistant", "content": "Understood. Continuing."}, ] ```