Conversation
findOpencode() gains a win32 branch (findOpencodeWindows): OPENCODE_SCHEDULER_OPENCODE_PATH override first, then where.exe over the enhanced Windows PATH, then well-known locations (scoop shims opencode.exe, npm-global opencode.cmd, LocalAppData opencode.exe, ~/.opencode/bin), else bare opencode. getEnhancedPath() returns ;-joined Windows dirs (System32, scoop shims, APPDATA/npm, LOCALAPPDATA/Programs/opencode/bin, ~/.opencode/bin) on win32; POSIX output unchanged. POSIX body of findOpencode() byte-identical.
…pper buildWindowsTaskCommand wraps the quoted invocation in cmd.exe append-redirect form using quoteWindowsArg and getLogPath; single TR argv via execFileSync unchanged so LastResult still reflects the opencode exit code. README: stale bare-binary tasks must be re-saved to regenerate invocations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #25
Summary
schtaskstasks now invoke the absolute opencode binary instead of a bareopencodename that Task Scheduler cannot resolve (LastResult 2147942402/0x80070002).cmdwrapper, matching the launchd/systemd backends.Changes
src/index.tsfindOpencodeWindows()(scoop shim dir, default install locations,where.exe); wire intofindOpencode()onwin32;cmd-wrapper log redirect forschtaskstasks (55 lines)README.mdTest plan
schtasksjob verified:LastResult 0with absolute path (was2147942402with bare binary)mainuntouched (2 commits on top ofcd0b623)Before/after
/TR:Before: /TR bare "opencode run ..." -> LastResult 2147942402 (0x80070002). After: /TR con ruta absoluta via cmd wrapper -> LastResult 0.
Known limitation
Paths with spaces + npm shim
.cmduntested; the canary used the scoop.exeshim.Example generated /TR command (captured output)