Repository navigation
fix(init): honor RTK_TELEMETRY_DISABLED in consent prompt (#1307) - #2477
Merged
Merged
Conversation
ousamabenyounes
added a commit
to ousamabenyounes/rtk
that referenced
this pull request
Jun 18, 2026
Address KuSh review on rtk-ai#2477: export the `RTK_TELEMETRY_DISABLED` opt-out check as a public `telemetry_cmd::telemetry_disabled_by_env()` instead of a private copy in `init.rs`. Collapses the three duplicated `std::env::var("RTK_TELEMETRY_DISABLED") == "1"` checks (init prompt, `telemetry status`, `telemetry::maybe_ping`) into one function, so the accepted values can evolve (e.g. "true"/"y") in a single place without divergence. Behavior-preserving: the rtk-ai#1307 regression test (env opt-out short-circuits the consent prompt) is unchanged and still green; suite 2200/2200. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
KuSh
requested changes
Jun 18, 2026
ousamabenyounes
force-pushed
the
fix/issue-1307
branch
from
July 6, 2026 12:43
21d6981 to
7040dc6
Compare
ousamabenyounes
added a commit
to ousamabenyounes/rtk
that referenced
this pull request
Jul 6, 2026
Address KuSh review on rtk-ai#2477: export the `RTK_TELEMETRY_DISABLED` opt-out check as a public `telemetry_cmd::telemetry_disabled_by_env()` instead of a private copy in `init.rs`. Collapses the three duplicated `std::env::var("RTK_TELEMETRY_DISABLED") == "1"` checks (init prompt, `telemetry status`, `telemetry::maybe_ping`) into one function, so the accepted values can evolve (e.g. "true"/"y") in a single place without divergence. Behavior-preserving: the rtk-ai#1307 regression test (env opt-out short-circuits the consent prompt) is unchanged and still green; suite 2200/2200. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
`rtk init -g --hook-only --auto-patch` hangs in non-interactive environments (devcontainer postCreateCommand, some CI agents) when `is_terminal()` returns true on a pseudo-TTY that nobody can answer. Setting `RTK_TELEMETRY_DISABLED=1` used to only gate `telemetry::maybe_ping`, so the documented workaround still hit the blocking prompt. Short-circuit `prompt_telemetry_consent` on that env var before the TTY heuristic so the init flow exits cleanly in any non-interactive context. Fixes rtk-ai#1307
Address KuSh review on rtk-ai#2477: export the `RTK_TELEMETRY_DISABLED` opt-out check as a public `telemetry_cmd::telemetry_disabled_by_env()` instead of a private copy in `init.rs`. Collapses the three duplicated `std::env::var("RTK_TELEMETRY_DISABLED") == "1"` checks (init prompt, `telemetry status`, `telemetry::maybe_ping`) into one function, so the accepted values can evolve (e.g. "true"/"y") in a single place without divergence. Behavior-preserving: the rtk-ai#1307 regression test (env opt-out short-circuits the consent prompt) is unchanged and still green; suite 2200/2200. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
ousamabenyounes
force-pushed
the
fix/issue-1307
branch
from
July 9, 2026 12:38
7040dc6 to
46ca979
Compare
Contributor
Author
|
Rebased this PR onto current It is mergeable again with no base lag. Waiting for review when you have a moment, @aeppling. |
KuSh
approved these changes
Jul 20, 2026
Merged
agogo233
pushed a commit
to agogo233/rtk
that referenced
this pull request
Jul 21, 2026
Address KuSh review on rtk-ai#2477: export the `RTK_TELEMETRY_DISABLED` opt-out check as a public `telemetry_cmd::telemetry_disabled_by_env()` instead of a private copy in `init.rs`. Collapses the three duplicated `std::env::var("RTK_TELEMETRY_DISABLED") == "1"` checks (init prompt, `telemetry status`, `telemetry::maybe_ping`) into one function, so the accepted values can evolve (e.g. "true"/"y") in a single place without divergence. Behavior-preserving: the rtk-ai#1307 regression test (env opt-out short-circuits the consent prompt) is unchanged and still green; suite 2200/2200. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
4 tasks
gatezh
added a commit
to gatezh/devcontainers
that referenced
this pull request
Sep 8, 2026
rtk-ai/rtk#1307 is fixed: PR rtk-ai/rtk#2477 (in v0.44.0+, and #121 has now pinned the images to 0.48.0) makes RTK_TELEMETRY_DISABLED=1 short-circuit the telemetry consent prompt before the TTY heuristic. The env var is therefore no longer a workaround but the documented opt-out, so the three "remove when upstream fixes it" comments were actively misleading. Upstream deliberately did not add non-TTY auto-detection — the original TTY check is what failed, because a devcontainer postCreateCommand is handed a pseudo-TTY and the prompt believes it is interactive. Record that, so nobody drops the env var on the assumption that rtk now detects CI by itself. Keep the `timeout` guard as a deliberate backstop rather than deleting it as redundant: rtk-ai/rtk#3693 (open, priority:high) is a live bug against this same `rtk init -g` invocation, and the root .devcontainer/Dockerfile resolves rtk from releases/latest at build time, so a future regression would land unpinned. Comment-only; no behaviour change. Refs #117
This was referenced Sep 8, 2026
Merged
gatezh
added a commit
to gatezh/devcontainers
that referenced
this pull request
Sep 9, 2026
…) (#125) * docs(rtk): record RTK_TELEMETRY_DISABLED as the supported opt-out (#117) rtk-ai/rtk#1307 is fixed: PR rtk-ai/rtk#2477 (in v0.44.0+, and #121 has now pinned the images to 0.48.0) makes RTK_TELEMETRY_DISABLED=1 short-circuit the telemetry consent prompt before the TTY heuristic. The env var is therefore no longer a workaround but the documented opt-out, so the three "remove when upstream fixes it" comments were actively misleading. Upstream deliberately did not add non-TTY auto-detection — the original TTY check is what failed, because a devcontainer postCreateCommand is handed a pseudo-TTY and the prompt believes it is interactive. Record that, so nobody drops the env var on the assumption that rtk now detects CI by itself. Keep the `timeout` guard as a deliberate backstop rather than deleting it as redundant: rtk-ai/rtk#3693 (open, priority:high) is a live bug against this same `rtk init -g` invocation, and the root .devcontainer/Dockerfile resolves rtk from releases/latest at build time, so a future regression would land unpinned. Comment-only; no behaviour change. Refs #117 * fix(rtk): restore exec bits and correct the ralphex-fe scope comment Review follow-ups on this branch. The previous commit silently flipped .devcontainer/init-plugins.sh and ralphex-fe/init-docker.sh from 100755 to 100644. Neither is executed via its exec bit (the first two are templates invoked as `bash <path>`, the third is chmod +x'd at ralphex-fe/Dockerfile:154), so nothing broke — but the change was undeclared, and the "every changed line begins with #" check that vouched for this branch cannot see mode bits. Restored both. ralphex-fe/init-docker.sh claimed the rtk init covers "standalone usage (no host mount)", but the block sits inside `if [ -d /mnt/claude ]` — precisely the condition that is false without the mount, so rtk is silently inert there. Say what the code actually does instead. The behavioural gap is left alone: fixing it needs the mkdir/chown above moved out of the guard too, which is more than a docs branch should carry.
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.
Fixes #1307.
rtk init's telemetry consent prompt only bailed on a non-TTY check. Some non-interactive environments (devcontainerpostCreateCommand, certain CI agents) hand rtk a pseudo-TTY, sois_terminal()returns true and the prompt blocks forever waiting on stdin.RTK_TELEMETRY_DISABLED=1is the documented opt-out and is honoured bytelemetry::maybe_ping, but the consent prompt ignored it.Fix
Add a
telemetry_disabled_by_env()helper and short-circuitprompt_telemetry_consent()withreturn Ok(())whenRTK_TELEMETRY_DISABLED=1, before the TTY heuristic — mirroring the check already used inmaybe_ping.Test verification (RED → GREEN)
The hang itself only reproduces under a real pseudo-TTY, which the test harness can't provide; the original regression remains guarded by the unit test on
telemetry_disabled_by_env().RED - patch reverted (helper removed):
GREEN - with the original fix:
Reviewer follow-up RED - with the test-location change reverted:
Reviewer follow-up GREEN - after moving the test to
telemetry_cmd:Full gate after rebase onto current
develop:(Re-proposes the accidentally-closed #1369, rebased onto current
develop.)