fix(memory): pass temperature, max_tokens and reasoning_effort to memory consolidation

Fix issue #1823: Memory consolidation does not inherit agent temperature
and maxTokens configuration.

The agent's configured generation parameters were not being passed through
to the memory consolidation call, causing it to fall back to default values.
This resulted in the consolidation response being truncated before the
save_memory tool call was emitted.

- Pass temperature, max_tokens, reasoning_effort from AgentLoop to
  MemoryConsolidator and then to MemoryStore.consolidate()
- Forward these parameters to the provider.chat_with_retry() call

Fixes #1823
This commit is contained in:
ethanclaw
2026-03-11 14:22:33 +08:00
parent b75222d952
commit 12104c8d46
2 changed files with 23 additions and 1 deletions

View File

@@ -114,6 +114,9 @@ class AgentLoop:
context_window_tokens=context_window_tokens,
build_messages=self.context.build_messages,
get_tool_definitions=self.tools.get_definitions,
temperature=self.temperature,
max_tokens=self.max_tokens,
reasoning_effort=self.reasoning_effort,
)
self._register_default_tools()