Skip to content

fix: render assistant replies with disabled colors - #5893

Open
emme1t wants to merge 1 commit into
Aider-AI:mainfrom
emme1t:fix/invalid-assistant-color-20261022
Open

emme1t wants to merge 1 commit into
Aider-AI:mainfrom
emme1t:fix/invalid-assistant-color-20261022

Conversation

@emme1t

@emme1t emme1t commented Oct 22, 2026

Copy link
Copy Markdown

Fixes #5873.

An invalid assistant_output_color is reset to None by color validation. Both assistant reply renderers then pass it to Rich Markdown, which raises AttributeError before the model's edits can be applied. Use Rich's default "none" style for disabled colors in the streaming and regular renderers, while preserving configured valid colors.

Validation:

  • Added real Rich-rendering regressions for invalid, None, empty, and valid colors in both renderers. The original implementation fails four subtests; all eight pass with the fix.
  • tests/basic/test_io.py and tests/basic/test_coder.py: 66 passed and 37 subtests passed. The existing test_color_initialization fails in this non-interactive Windows environment because PromptSession requires a Windows console; the same test also fails on the unchanged base checkout.
  • Six offline Coder.run scenarios use LiteLLM mock responses with streaming enabled/disabled and invalid/disabled/valid colors. Every scenario renders the reply and applies its edit to a real local file.
  • All applicable repository pre-commit hooks passed: isort, Black, flake8, and codespell.

This branch has not been deployed

No deployments
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.

BUG: invalid --assistant-output-color is reset to None, then every pretty reply crashes in Rich and its edits are not applied

1 participant