Skip to content

fix: add AIDER_CHAT_MODE env var for --chat-mode alias (issue #5367)#5368

Open
chrislazar25 wants to merge 1 commit into
Aider-AI:mainfrom
chrislazar25:fix/env-chat-mode-5367
Open

fix: add AIDER_CHAT_MODE env var for --chat-mode alias (issue #5367)#5368
chrislazar25 wants to merge 1 commit into
Aider-AI:mainfrom
chrislazar25:fix/env-chat-mode-5367

Conversation

@chrislazar25

Copy link
Copy Markdown

Summary: Add AIDER_CHAT_MODE env var support for the --chat-mode / --edit-format argument. Previously only AIDER_EDIT_FORMAT was recognized (auto-derived from --edit-format), but the --chat-mode alias was missing its own env var.

Technical Details:

  • Root Cause: configargparse.auto_env_var_prefix derives env var names from the first option string only. For --edit-format / --chat-mode, only AIDER_EDIT_FORMAT is auto-generated; AIDER_CHAT_MODE is not.
  • Mechanism: Set action.env_var = "AIDER_CHAT_MODE" on the argument after parser creation. For backward compatibility, also inject AIDER_CHAT_MODE from AIDER_EDIT_FORMAT if only the latter is set. Priority: CLI > AIDER_CHAT_MODE > AIDER_EDIT_FORMAT > config file > default.

Verification: Confirmed adherence to CONTRIBUTING.md. Ran python -m pytest tests/. 455 passed, 1 pre-existing env failure (test_voice requires audio hardware). Pre-commit hooks (isort, black, flake8, codespell) all green. Manual E2E:

  • AIDER_CHAT_MODE=askedit_format=ask
  • AIDER_EDIT_FORMAT=architectedit_format=architect (backward compat)
  • CLI --chat-mode ask + env var → CLI wins

Blast Radius:

  • Impact: Low. Adds a new env var. Existing AIDER_EDIT_FORMAT usage continues to work.
  • Trade-offs: When both AIDER_CHAT_MODE and AIDER_EDIT_FORMAT are set, AIDER_CHAT_MODE takes priority.

Fixes #5367

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add AIDER_CHAT_MODE variable

1 participant