Skip to content
Merged
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
16 changes: 16 additions & 0 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ func loadConfigFromViper() (*config.Config, error) {
}
cfg.Prompts = *prompts
applyPromptsEnvOverrides(cfg)
warnDeadPromptEnvVars()

remindersCfg, err := resolveRemindersConfig()
if err != nil {
Expand Down Expand Up @@ -547,6 +548,21 @@ func applyPromptsEnvOverrides(cfg *config.Config) {
}
}

// warnDeadPromptEnvVars logs a warning when a known-dead env var (renamed
// in v0.105.0) is set, so consumers following stale docs get a visible
// signal instead of silent ignore.
func warnDeadPromptEnvVars() {
deadVars := []string{
"INFER_AGENT_SYSTEM_PROMPT",
"INFER_AGENT_SYSTEM_PROMPT_PLAN",
}
for _, name := range deadVars {
if _, ok := os.LookupEnv(name); ok {
logger.Warn("environment variable is no longer supported (renamed in v0.105.0); see INFER_PROMPTS_AGENT_SYSTEM_PROMPT / INFER_PROMPTS_AGENT_SYSTEM_PROMPT_PLAN in docs/configuration-reference.md", "var", name)
}
}
}

// applyKeybindingEnvOverrides walks INFER_CHAT_KEYBINDINGS_BINDINGS_*
// environment variables and applies them directly to the in-memory
// keybindings config. Run AFTER loading keybindings.yaml so env vars win.
Expand Down
16 changes: 14 additions & 2 deletions docs/configuration-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,21 @@ and replacing dots (`.`) with underscores (`_`), then prefixing with `INFER_`.
### Agent Configuration

- `INFER_AGENT_MODEL`: Default model for agent operations (e.g., `deepseek/deepseek-v4-pro`)
- `INFER_AGENT_SYSTEM_PROMPT`: Custom system prompt for agent
- `INFER_AGENT_SYSTEM_PROMPT_PLAN`: Custom system prompt for plan mode
- `INFER_PROMPTS_AGENT_SYSTEM_PROMPT`: Custom system prompt for agent
- `INFER_PROMPTS_AGENT_SYSTEM_PROMPT_PLAN`: Custom system prompt for plan mode
- `INFER_PROMPTS_AGENT_SYSTEM_PROMPT_REMOTE`: Custom system prompt for remote agent
- `INFER_PROMPTS_AGENT_SYSTEM_PROMPT_HEARTBEAT`: Custom system prompt for heartbeat
- `INFER_PROMPTS_AGENT_SYSTEM_PROMPT_CLAUDE_CODE`: Custom system prompt for Claude Code mode
- `INFER_PROMPTS_AGENT_CUSTOM_INSTRUCTIONS`: Custom instructions for agent
- `INFER_AGENT_VERBOSE_TOOLS`: Enable verbose tool output (default: `false`)

> **Migration note (v0.105.0+):** The old `INFER_AGENT_SYSTEM_PROMPT` and
> `INFER_AGENT_SYSTEM_PROMPT_PLAN` env vars were renamed to
> `INFER_PROMPTS_AGENT_SYSTEM_PROMPT` and `INFER_PROMPTS_AGENT_SYSTEM_PROMPT_PLAN`
> respectively when agent prompts moved under the `prompts.agent.*` config tree.
> The old names are silently ignored — if you are migrating an existing
> configuration, update your env vars to the new names above.

- `INFER_AGENT_MAX_TURNS`: Maximum agent turns (default: `100`)
- `INFER_AGENT_MAX_TOKENS`: Maximum tokens per response (default: `8192`)
- `INFER_AGENT_MAX_CONCURRENT_TOOLS`: Maximum concurrent tool executions (default: `5`)
Expand Down