Skip to content

rtk init --opencode: dry-run previews an install the real run refuses, and opencode --version has no timeout #4519

Open

Description

@KuSh

rtk init -g --opencode reads opencode --version and writes nothing below the plugin's floor (1.18.29, #4187).

  • Dry run: the floor check is skipped there, so rtk init -g --opencode --dry-run with OpenCode 1.1.4 on PATH previews writing ~/.config/opencode/plugins/rtk.ts. The same command without --dry-run prints "OpenCode 1.1.4 is older than 1.18.29 … installed nothing". Reading the version is side-effect free, so the dry run could apply the same check.
  • No timeout: opencode --version runs through Command::output(). An opencode wrapper that hangs (a shim that fetches, a first-run migration) blocks rtk init with no output.

Found while reviewing #4187.

Rows a fix has to pass:

  • With 1.1.4 on PATH, the dry run and the real run say the same thing.
  • With an opencode stub that sleeps, rtk init -g --opencode finishes, and installs the plugin as if no version had been read.

Activity

  1. rtk-wshm-sync-bot commented on Oct 11, 2026

    @rtk-wshm-sync-bot

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟡 Priority medium
    🎯 Confidence 90%

    Summary

    OpenCode version check is skipped on dry-run (previewing installs the real run refuses) and has no timeout, letting a hanging opencode --version block rtk init.

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

    📁 Relevant files
    • src/init/opencode.rs
    • src/init/mod.rs

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

  2. cestercian commented on Oct 12, 2026

    @cestercian

    Claiming this, will open a PR shortly.

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:clibugopencodepriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions