Skip to content

fix(script-tool): force color off in captured script output (deterministic)#108

Merged
agjs merged 1 commit into
mainfrom
fix/script-tool-color
Jul 16, 2026
Merged

fix(script-tool): force color off in captured script output (deterministic)#108
agjs merged 1 commit into
mainfrom
fix/script-tool-color

Conversation

@agjs

@agjs agjs commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Problem

The script tool's subprocess stdout is captured — parsed by the loop and matched in tests — never shown live in a terminal, so ANSI colorization is corruption, not presentation. Bun colorizes console.log values (a numeric 403\x1b[33m403\x1b[0m) whenever it detects color support, so captured output differed between CI (no TTY → plain) and a local TTY (colored). A script-tool test asserting a literal STATUS 403 passed in CI but broke under the local pre-push hook.

Fix

Set NO_COLOR=1 / FORCE_COLOR=0 in the script subprocess env so captured output is plain and stable everywhere.

Test

New regression test forces FORCE_COLOR=1 in the parent env and asserts the captured output of console.log(403) contains no ESC byte and still contains 403.

Reviewer panel: PASS. Full bun run validate green.

…istic)

The script tool's subprocess stdout is CAPTURED — parsed by the loop and matched in
tests — never shown live in a terminal, so ANSI colorization is corruption, not
presentation. Bun colorizes console.log values (a numeric `403` becomes
\x1b[33m403\x1b[0m) whenever it detects color support, so captured output differed
between CI (no TTY, plain) and a local TTY (colored): script-tool's wrong-token test
asserts a literal 'STATUS 403' and passed in CI but broke under the local pre-push
hook. Set NO_COLOR=1 / FORCE_COLOR=0 in the script subprocess env so captured output
is plain and stable everywhere.
@agjs
agjs merged commit 1ea76db into main Jul 16, 2026
8 checks passed
@agjs
agjs deleted the fix/script-tool-color branch July 16, 2026 19:10
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.

1 participant