From 381388fb7428bfd8a9abef0dc8fe6c86bc228166 Mon Sep 17 00:00:00 2001 From: Serge Gatezh <2880401+gatezh@users.noreply.github.com> Date: Tue, 8 Sep 2026 17:16:39 -0600 Subject: [PATCH 1/2] docs(rtk): record RTK_TELEMETRY_DISABLED as the supported opt-out (#117) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .devcontainer/init-plugins.sh | 8 +++++--- claude-code/.devcontainer/init-plugins.sh | 8 +++++--- ralphex-fe/init-docker.sh | 7 ++++--- 3 files changed, 14 insertions(+), 9 deletions(-) mode change 100755 => 100644 .devcontainer/init-plugins.sh mode change 100755 => 100644 ralphex-fe/init-docker.sh diff --git a/.devcontainer/init-plugins.sh b/.devcontainer/init-plugins.sh old mode 100755 new mode 100644 index a4478b5..2aad0d9 --- a/.devcontainer/init-plugins.sh +++ b/.devcontainer/init-plugins.sh @@ -46,9 +46,11 @@ done # Initialize rtk global hook for Claude Code (auto-rewrite mode). # --hook-only: installs only the PreToolUse rewrite hook, no workspace artifacts. -# WORKAROUND: RTK ≥0.36.0 added a GDPR telemetry consent prompt that hangs in -# non-interactive environments. timeout + RTK_TELEMETRY_DISABLED work around it. -# Remove when upstream fixes it: https://github.com/rtk-ai/rtk/issues/1307 +# RTK_TELEMETRY_DISABLED=1 is the supported opt-out, not a workaround: since +# rtk-ai/rtk#2477 (v0.44.0+) it short-circuits the telemetry consent prompt that +# would otherwise block on stdin here. rtk's own TTY check is not enough — a +# devcontainer postCreateCommand gets a pseudo-TTY, so the prompt believes it is +# interactive. timeout stays as a backstop against a future init-time hang. echo "Initializing rtk (token optimizer)..." RTK_TELEMETRY_DISABLED=1 timeout 10 rtk init -g --hook-only --auto-patch || { echo "Note: rtk init may have already been configured or rtk not available" diff --git a/claude-code/.devcontainer/init-plugins.sh b/claude-code/.devcontainer/init-plugins.sh index 272109c..8a3ed14 100644 --- a/claude-code/.devcontainer/init-plugins.sh +++ b/claude-code/.devcontainer/init-plugins.sh @@ -70,9 +70,11 @@ done # ── rtk init (token-optimized CLI proxy) ──────────────────────────────────── # Global hook-first mode: installs only the PreToolUse rewrite hook to ~/.claude/, # no workspace artifacts (CLAUDE.md, .rtk/). Safe to run multiple times. -# WORKAROUND: RTK ≥0.36.0 added a GDPR telemetry consent prompt that hangs in -# non-interactive environments. timeout + RTK_TELEMETRY_DISABLED work around it. -# Remove when upstream fixes it: https://github.com/rtk-ai/rtk/issues/1307 +# RTK_TELEMETRY_DISABLED=1 is the supported opt-out, not a workaround: since +# rtk-ai/rtk#2477 (v0.44.0+) it short-circuits the telemetry consent prompt that +# would otherwise block on stdin here. rtk's own TTY check is not enough — a +# devcontainer postCreateCommand gets a pseudo-TTY, so the prompt believes it is +# interactive. timeout stays as a backstop against a future init-time hang. if command -v rtk &>/dev/null; then RTK_TELEMETRY_DISABLED=1 timeout 10 rtk init -g --hook-only --auto-patch 2>/dev/null || true fi diff --git a/ralphex-fe/init-docker.sh b/ralphex-fe/init-docker.sh old mode 100755 new mode 100644 index 3437245..d7a3598 --- a/ralphex-fe/init-docker.sh +++ b/ralphex-fe/init-docker.sh @@ -31,9 +31,10 @@ if [ -d /mnt/claude ]; then # ── RTK: ensure rewrite hook is configured ───────────────────────────── # Host mount usually brings the hook, but init idempotently to cover # standalone usage (no host mount). --hook-only avoids workspace artifacts. - # WORKAROUND: RTK ≥0.36.0 added a GDPR telemetry consent prompt that hangs - # in non-interactive environments. Remove when upstream fixes it: - # https://github.com/rtk-ai/rtk/issues/1307 + # RTK_TELEMETRY_DISABLED=1 is the supported opt-out, not a workaround: + # since rtk-ai/rtk#2477 (v0.44.0+) it short-circuits the telemetry consent + # prompt that would otherwise block on stdin here. timeout stays as a + # backstop against a future init-time hang. if command -v rtk >/dev/null 2>&1; then RTK_TELEMETRY_DISABLED=1 gosu app timeout 10 rtk init -g --hook-only --auto-patch 2>/dev/null || true fi From 751cdfa4d1bdb4936783772ad01784a6a98b33bc Mon Sep 17 00:00:00 2001 From: Serge Gatezh <2880401+gatezh@users.noreply.github.com> Date: Wed, 9 Sep 2026 09:31:47 -0600 Subject: [PATCH 2/2] fix(rtk): restore exec bits and correct the ralphex-fe scope comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 `, 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. --- .devcontainer/init-plugins.sh | 0 ralphex-fe/init-docker.sh | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 .devcontainer/init-plugins.sh mode change 100644 => 100755 ralphex-fe/init-docker.sh diff --git a/.devcontainer/init-plugins.sh b/.devcontainer/init-plugins.sh old mode 100644 new mode 100755 diff --git a/ralphex-fe/init-docker.sh b/ralphex-fe/init-docker.sh old mode 100644 new mode 100755 index d7a3598..7b2cbc4 --- a/ralphex-fe/init-docker.sh +++ b/ralphex-fe/init-docker.sh @@ -29,8 +29,10 @@ if [ -d /mnt/claude ]; then chown -R app:app /home/app/.claude # ── RTK: ensure rewrite hook is configured ───────────────────────────── - # Host mount usually brings the hook, but init idempotently to cover - # standalone usage (no host mount). --hook-only avoids workspace artifacts. + # The host mount usually brings the hook; re-init idempotently in case the + # mounted ~/.claude carries none. --hook-only avoids workspace artifacts. + # Scope: this sits inside the /mnt/claude guard, so a container started + # without the host mount gets no rtk hook and rtk stays inert. # RTK_TELEMETRY_DISABLED=1 is the supported opt-out, not a workaround: # since rtk-ai/rtk#2477 (v0.44.0+) it short-circuits the telemetry consent # prompt that would otherwise block on stdin here. timeout stays as a