agentscope-ai / agentscope-ai/agentscope

[Bug]: Agent compress memory: summary_template can not handle summary without 'next_steps'

Ouverte
#1,388 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
stale-issue
Langage dominant
Python
Étoiles
31.5k
Forks
3.5k
Merge moyen
1 j 23 h
PR mergées (30 j)
95

Description

**AgentScope is an open-source project. To involve a broader community, we recommend asking your questions in English.**

**Describe the bug**
```
File "/home/admin/.local/lib/python3.11/site-packages/agentscope/pipeline/_functional.py", line 192, in stream_printing_messages
raise exception from None
File "/home/admin/.local/lib/python3.11/site-packages/agentscope/agent/_agent_base.py", line 455, in __call__
reply_msg = await self.reply(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/admin/.local/lib/python3.11/site-packages/agentscope/agent/_agent_meta.py", line 120, in async_wrapper
current_output = await original_func(
^^^^^^^^^^^^^^^^^^^^
File "/home/admin/.local/lib/python3.11/site-packages/agentscope/tracing/_trace.py", line 431, in wrapper
raise e from None
File "/home/admin/.local/lib/python3.11/site-packages/agentscope/tracing/_trace.py", line 422, in wrapper
res = await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/admin/.local/lib/python3.11/site-packages/agentscope/agent/_react_agent.py", line 434, in reply
await self._compress_memory_if_needed()
File "/home/admin/.local/lib/python3.11/site-packages/agentscope/agent/_react_agent.py", line 1111, in _compress_memory_if_needed
self.compression_config.summary_template.format(
KeyError: 'next_steps'
```

**To Reproduce**
Steps to reproduce the behavior:

The issue only happens sometimes when compressed model does not contain 'next_steps'.

```
agentscope==1.0.16
```
my code simple react agent
```
agent = ReActAgent(
name="xxx",
model=DashScopeChatModel(
model_name="qwen3.5-plus",
enable_thinking=False,
multimodality=True,
stream=True
),
sys_prompt=sys_prompt,
toolkit=toolkit,
memory=RedisMemory(),
formatter=DashScopeChatFormatter(),
plan_notebook=plan_notebook,
max_iters=20,
compression_config=ReActAgent.CompressionConfig(
enable=True,
agent_token_counter=CharTokenCounter(),
trigger_threshold=50000,
keep_recent=3,
),
)
```

**Expected behavior**
A clear and concise description of what you expected to happen.

**Error messages**
Detailed error messages.

**Environment (please complete the following information):**

- AgentScope Version: 1.0.16
- Python Version: 3.11
- OS: Linux

**Additional context**
Add any other context about the problem here.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.