ci: drop CLICOLOR_FORCE=1 from tend-setup action#5819
Merged
Conversation
The var forces `gh` to emit ANSI escapes in its --json output, which breaks every `gh pr view --json X | jq` pipeline used by the bundled `tend-ci-runner:running-in-ci` polling loop. CARGO_TERM_COLOR=always already covers the cargo case; the rest of the tools can use the unix-convention tty detection. Session evidence: review of PR #5816 spent 46 min bouncing between two polling attempts that could never exit because `pending()` kept parsing ANSI-prefixed JSON and returning empty/-1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove
CLICOLOR_FORCE=1from.github/actions/tend-setup. This env var silently breaks the CI-polling pattern used by every tend-review session, causing 15–20 min hangs on each polling attempt.The bug
CLICOLOR_FORCE=1tells tools to emit ANSI colour codes even when their stdout is a pipe.ghrespects this for--jsonoutput: the JSON gets prefixed with escape codes, so pipinggh pr view --json statusCheckRollup | jq ...fails withjq: parse error: Invalid numeric literal at line 1, column 2on every call.That is exactly the polling pattern the bundled
tend-ci-runner:running-in-ciskill documents:When
pending()returns an empty string (stderr-only output),[ "" -gt 0 ]is aninteger expression expectederror, so the first branch never triggers; the grace check[ "$(pending)" -eq 0 ]likewise errors and hitscontinue. The loop runs to its hardcoded timeout without ever registering that CI turned green.Session-log evidence — run 24686601620 (review of PR #5816) spent 46 minutes bouncing between two polling attempts:
Why this wasn't caught
Past review-runs entries misattributed the 15-min/25-min review wall-clock to "CI waiting for
teststo finish" (tracking issue #5787 entries for 2026-04-19 and 2026-04-20). Re-reading the raw session logs confirms the samejq: parse errorwas present in reviews for PRs #5810, #5811, and #5813 — 5+ occurrences over three days, all structurally the same.Why this is safe
CARGO_TERM_COLOR=always(kept) already forces cargo to emit coloured output — that's what most of the tend sessions actually care about.grep/lswill fall back to the unix-convention behaviour (colour when tty, plain when piped), which is what the rest of the repo's CI already does.tests.yamland the language-binding test workflows still setCLICOLOR_FORCE=1at their own workflow level — untouched. Only tend's bot sessions lose the forced colour.After this lands
gh pr view --json ... | jqpolling loop and actually seepending=0when checks settle, exiting within the real CI duration instead of padding to the full 15-min cap.Test plan
tend-reviewrun triggered by a subsequent bot PR; verify the review job exits within ~2 min of CI settling rather than hitting the 15-min timeout.jq: parse error: Invalid numeric literalin the pending() tool output.