Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pkg/agent/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ func NewAgentInstance(
maxTokens = 8192
}

// ContextWindow defaults to 128K if not specified (most modern models support this)
// For models with smaller context, users should configure this explicitly
contextWindow := defaults.ContextWindow
if contextWindow == 0 {
contextWindow = 128000
}

temperature := 0.7
if defaults.Temperature != nil {
temperature = *defaults.Temperature
Expand All @@ -103,7 +110,7 @@ func NewAgentInstance(
MaxIterations: maxIter,
MaxTokens: maxTokens,
Temperature: temperature,
ContextWindow: maxTokens,
ContextWindow: contextWindow,
Provider: provider,
Sessions: sessionsManager,
ContextBuilder: contextBuilder,
Expand Down
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ type AgentDefaults struct {
ImageModel string `json:"image_model,omitempty" env:"PICOCLAW_AGENTS_DEFAULTS_IMAGE_MODEL"`
ImageModelFallbacks []string `json:"image_model_fallbacks,omitempty"`
MaxTokens int `json:"max_tokens" env:"PICOCLAW_AGENTS_DEFAULTS_MAX_TOKENS"`
ContextWindow int `json:"context_window" env:"PICOCLAW_AGENTS_DEFAULTS_CONTEXT_WINDOW"`
Temperature *float64 `json:"temperature,omitempty" env:"PICOCLAW_AGENTS_DEFAULTS_TEMPERATURE"`
MaxToolIterations int `json:"max_tool_iterations" env:"PICOCLAW_AGENTS_DEFAULTS_MAX_TOOL_ITERATIONS"`
}
Expand Down