Skip to content

rtk init hangs in non-interactive environments (v0.36.0 telemetry consent gate) #1307

Closed

Description

@gatezh

Description

rtk init -g --hook-only --auto-patch hangs indefinitely in non-interactive environments
(Docker/devcontainer builds, CI) since v0.36.0. The hook setup completes and output is printed,
but the process never exits — it blocks waiting for stdin on the telemetry consent prompt.

Reproduction

# In any non-interactive context (Dockerfile, devcontainer postCreateCommand, CI):
rtk init -g --hook-only --auto-patch                                                             
# Process prints hook setup output, then hangs forever

Last visible output before hang:

RTK hook already up to date (hook-only mode).

  Hook: /home/node/.claude/hooks/rtk-rewrite.sh                                                  
  Note: No RTK.md created. Claude won't know about meta commands (gain, discover, proxy).
                                                                                                 
  settings.json: hook already present                                                          
  Restart Claude Code. Test with: git status

Expected behavior

rtk init should detect non-interactive environments (e.g., ! -t 0 / no TTY on stdin) and skip
the consent prompt, or respect RTK_TELEMETRY_DISABLED=1 to suppress it entirely.

Actual behavior

The process blocks on stdin waiting for consent input that will never come.
RTK_TELEMETRY_DISABLED=1 does not prevent the prompt — it only disables data collection after
consent is given.

Workaround

RTK_TELEMETRY_DISABLED=1 timeout 10 rtk init -g --hook-only --auto-patch 2>/dev/null || true

Environment

  • RTK: v0.36.0 (v0.35.0 worked fine)
  • OS: Debian Trixie (Docker container, node:24-trixie-slim)
  • Arch: ARM64 (Apple Silicon via Docker Desktop)
  • Context: devcontainer postCreateCommand (no TTY)

Activity

  1. added
    bug
    effort-small
    good first issue
    on Apr 17, 2026
  2. pszymkowiak commented on Apr 17, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟠 Priority high
    🎯 Confidence 95%

    Summary

    rtk init hangs indefinitely in non-interactive/CI environments since v0.36.0 due to telemetry consent prompt blocking on stdin; fix should detect TTY absence and skip/auto-decline prompt.

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.

    📁 Relevant files
    • src/cli/init.rs
    • src/telemetry/consent.rs

    Triaged automatically by wshm · This is an automated analysis, not a human review.

  3. added
    resolved-pending-close
    on Apr 22, 2026
  4. added a commit that references this issue on Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clibugeffort-smallgood first issueneeds-reproductionpriority:highresolved-pending-close

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions