You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenCode plugin (tool.execute.before) never fires on Windows — auto-rewrite broken #1993
OpenCode plugin (tool.execute.before) never fires on Windows — auto-rewrite broken
Environment
RTK: latest (binary at D:\rtk_tools\rtk.exe)
OpenCode: latest
OS: Windows 11
Shell: CMD / PowerShell
Symptom
After rtk init -g --opencode, the plugin file is created at C:\Users\<user>\.config\opencode\plugins\rtk.ts. The plugin loads successfully, but bash commands are never auto-rewritten. Running git status produces raw output instead of rtk git status.
Root cause identified
The original rtk.ts uses which rtk to detect the binary, which does not exist on Windows. This causes the plugin to immediately return {} and disable itself. Replaced with where.exe rtk as primary check with which rtk as fallback — binary is confirmed in PATH — but the tool.execute.before hook still never fires.
Steps to reproduce
Install RTK on Windows, place rtk.exe in a directory on PATH
Run rtk init -g --opencode
Open OpenCode and run any git or shell command
Observe: commands are never rewritten to rtk equivalents
OpenCode tool.execute.before hook dispatch does not fire on Windows, completely breaking auto-rewrite; investigate Windows-specific plugin execution path in hooks/opencode/rtk.ts
📁 Relevant files
hooks/opencode/rtk.ts
Triaged automatically by wshm · This is an automated analysis, not a human review.
Confirmed on Windows 11 + OpenCode CLI (rtk 0.47.0). Root causes: (1) no Bun $ shell in the plugin context → silent TypeError, hooks never register; (2) which is Unix-only; (3) rtk rewrite exits non-zero on success (exit 3), so stdout must be recovered from the exception. Same approach as #3330 (which closes #3326) works — worth combining efforts there.
Closing as a duplicate of #3326, which tracks the same problem with the more complete discussion. Please follow up there; if your case differs in a way that issue does not cover, comment here and it can be reopened.
Activity
pszymkowiak commentedon May 27, 2026
🔍 Automated Triage
bughighSummary
OpenCode
tool.execute.beforehook dispatch does not fire on Windows, completely breaking auto-rewrite; investigate Windows-specific plugin execution path in hooks/opencode/rtk.ts📁 Relevant files
hooks/opencode/rtk.tsTriaged automatically by wshm · This is an automated analysis, not a human review.
feat(environments): cross-harness «Среды» tab — skills/MCP/providers/…
amnesiaof commentedon Sep 2, 2026
Confirmed on Windows 11 + OpenCode CLI (rtk 0.47.0). Root causes: (1) no Bun
$shell in the plugin context → silent TypeError, hooks never register; (2)whichis Unix-only; (3)rtk rewriteexits non-zero on success (exit 3), so stdout must be recovered from the exception. Same approach as #3330 (which closes #3326) works — worth combining efforts there.KuSh commentedon Sep 19, 2026
Closing as a duplicate of #3326, which tracks the same problem with the more complete discussion. Please follow up there; if your case differs in a way that issue does not cover, comment here and it can be reopened.