Skip to content

fix(init/opencode): apply the version floor on dry-run and time out the probe - #4534

Open
cestercian wants to merge 1 commit into
rtk-ai:developfrom
cestercian:fix/init-opencode-dry-run
Open

cestercian wants to merge 1 commit into
rtk-ai:developfrom
cestercian:fix/init-opencode-dry-run

Conversation

@cestercian

Copy link
Copy Markdown

Fixes #4519

Summary

rtk init --opencode --dry-run skipped the OpenCode 1.18.29 floor and previewed writing plugins/rtk.ts for versions a real run refuses (e.g. 1.1.4). Dry-run now runs the same version check and prints the same refusal, without writing the file.

opencode --version is capped at 5 seconds. On Unix a timeout kills the process group so a hung wrapper and its child both stop. A missing, failing, or hung probe is treated as no version, and init still installs the plugin.

Testing

  • Shared refusal message for OpenCode 1.1.4 on dry-run vs real run
  • Sleeping opencode stub still gets the plugin installed
  • Wrapper whose background child is killed by the timeout
  • cargo clippy --all-targets -- -D warnings clean

One unrelated suite failure on the agent VM (git_log_malformed_digit_run_propagates_real_git_error) is a git 2.43 vs 2.51 message mismatch, not from this change.

…he probe

Dry-run skipped the 1.18.29 check and previewed writing the plugin that a
real run refuses. It now reads the version and prints the same refusal.

The version probe is limited to 5 seconds. A hung wrapper and the child
it started are killed and treated as no version, so init still installs
the plugin.

Fixes rtk-ai#4519
@rtk-wshm-sync-bot rtk-wshm-sync-bot Bot added bug Something isn't working init opencode labels Oct 12, 2026
@rtk-wshm-sync-bot

Copy link
Copy Markdown

wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟡 Risk medium

Summary

Fixes OpenCode init dry-run to apply the same 1.18.29 version floor as a real run, previewing the same refusal instead of writing plugins/rtk.ts for versions that would actually be rejected. Also adds a 5-second timeout to the opencode --version probe, killing the process group on Unix so a hung wrapper and its children can't stall rtk init, treating missing/failing/hung probes as no version.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #4519


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

@cestercian

Copy link
Copy Markdown
Author

Friendly ping when someone has a minute, glad to adjust anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working init opencode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant