🐛 Fix max_tokens=0 bug — build_context now takes max_tokens from config
This commit is contained in:
@@ -301,7 +301,7 @@ impl AgentLoop {
|
||||
// Build context and call LLM (with retry)
|
||||
let context = self
|
||||
.context_compressor
|
||||
.build_context(&messages, &self.config.system_prompt, &self.tool_executor.definitions());
|
||||
.build_context(&messages, &self.config.system_prompt, &self.tool_executor.definitions(), self.config.max_tokens);
|
||||
|
||||
*self.status.lock().await = AgentStatus::Thinking;
|
||||
let response = self.call_with_retry(context).await?;
|
||||
@@ -332,7 +332,7 @@ impl AgentLoop {
|
||||
// Follow-up call with tool results
|
||||
let follow_context = self
|
||||
.context_compressor
|
||||
.build_context(&messages, &self.config.system_prompt, &self.tool_executor.definitions());
|
||||
.build_context(&messages, &self.config.system_prompt, &self.tool_executor.definitions(), self.config.max_tokens);
|
||||
|
||||
*self.status.lock().await = AgentStatus::Thinking;
|
||||
let follow_up = self.call_with_retry(follow_context).await?;
|
||||
@@ -361,7 +361,7 @@ impl AgentLoop {
|
||||
|
||||
let context = self
|
||||
.context_compressor
|
||||
.build_context(&messages, &self.config.system_prompt, &self.tool_executor.definitions());
|
||||
.build_context(&messages, &self.config.system_prompt, &self.tool_executor.definitions(), self.config.max_tokens);
|
||||
|
||||
*self.status.lock().await = AgentStatus::Thinking;
|
||||
let response = self.call_with_retry(context).await?;
|
||||
@@ -393,7 +393,7 @@ impl AgentLoop {
|
||||
|
||||
let follow_context = self
|
||||
.context_compressor
|
||||
.build_context(&messages, &self.config.system_prompt, &self.tool_executor.definitions());
|
||||
.build_context(&messages, &self.config.system_prompt, &self.tool_executor.definitions(), self.config.max_tokens);
|
||||
|
||||
*self.status.lock().await = AgentStatus::Thinking;
|
||||
let follow_up = self.call_with_retry(follow_context).await?;
|
||||
|
||||
Reference in New Issue
Block a user