Suppress version hints when stderr is not a TTY#562
Draft
dan-manges wants to merge 1 commit into
Draft
Conversation
The CLI upgrade hint and agent-skill hint added noise to captured output when rwx is used in scripts, pipelines, or CI. Both hints write to stderr, so gate them on Config.StderrIsTTY: when stderr is not a terminal, suppress automatically. The existing RWX_HIDE_LATEST_VERSION / MINT_HIDE_LATEST_VERSION / RWX_HIDE_SKILL_HINT env vars remain as explicit overrides. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Automatically suppress the two stderr "nag" hints — the CLI upgrade hint ("A new release of rwx is available…") and the agent-skill hint ("A new version of the RWX agent skill is available…") — when stderr is not a terminal.
Why
When
rwxruns inside a script, pipeline, or CI job, these hints add noise to captured output. Previously the only way to silence them was to set an env var explicitly. Now scripts get clean output by default.How
Both hints write to
s.Stderr, and the CLI already detects whether stderr is a terminal viaConfig.StderrIsTTY(set incmd/rwx/root.gousingterm.IsTerminal). The change adds a!s.StderrIsTTYguard to each hint function ininternal/cli/service.go— no new plumbing, env vars, or fields.The existing env-var opt-outs (
RWX_HIDE_LATEST_VERSION/ legacyMINT_HIDE_LATEST_VERSION, andRWX_HIDE_SKILL_HINT) remain as explicit overrides for users who want to suppress hints even in an interactive terminal.Behavior change to note
Most CI runners present stderr as a non-TTY, so upgrade/skill hints will no longer appear in CI logs. This is the intended outcome of "disable hints in scripts."
Tests
StderrIsTTY: true(it previously relied on the defaultfalse).go build ./cmd/rwxandgo test ./internal/cli/... ./cmd/...pass.🤖 Generated with Claude Code