Skip to content

[Bug]: --no-color tool progress emits ANSI styles into redirected stderr #1045

Closed

Description

@XuPeng-SH

Is there an existing issue for the same bug?

Version and environment

Astra CLI 0.2.11, clean main 8ee927c, Linux, ordinary one-shot chat with stderr redirected and explicit --no-color.

Actual behavior

Tool read progress still emits SGR sequences including ESC[m, ESC[1m (bold), ESC[2m (dim), ESC[0m. This adds terminal control bytes to logs despite explicit plain-output selection. Captured during real CLI tool execution; no provider credentials are needed in a deterministic regression.

Expected behavior

Honor the documented no-color/plain-output contract consistently for tool progress and redirected output. Preserve useful progress text and keep machine-readable stdout contracts intact.

Steps to reproduce

Run a normal configured CLI with --no-color --bare chat --no-resume --permission-mode bypass and a harmless read_file task; redirect stdout/stderr to separate files. Inspect stderr bytes for ESC[1m/ESC[2m/ESC[0m.

Root-cause findings and scope

command_router.rs sets NO_COLOR and assumes crossterm suppresses escape sequences globally. Tool UI directly applies bold/dim Stylize attributes. NO_COLOR color suppression alone does not provide a complete plain-style contract, and explicit reset/style commands remain visible. Existing Markdown no-color coverage does not cover live tool progress. Add a deterministic rendered-output/public-entrypoint regression rather than merely stripping output in a harness wrapper. No fix is claimed yet.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions