Skip to content

fix(opencode-plugin): support Windows config paths and zip extraction#9

Merged
ualtinok merged 1 commit intocortexkit:mainfrom
freelanceagent1:fix/windows-aft-config-onnx
Apr 15, 2026
Merged

fix(opencode-plugin): support Windows config paths and zip extraction#9
ualtinok merged 1 commit intocortexkit:mainfrom
freelanceagent1:fix/windows-aft-config-onnx

Conversation

@freelanceagent1
Copy link
Copy Markdown
Contributor

@freelanceagent1 freelanceagent1 commented Apr 14, 2026

Summary

This PR fixes two Windows-specific issues in the OpenCode plugin:

  1. Runtime config lookup now resolves the OpenCode config directory the same way as the CLI helpers/doctor path logic.
  2. ONNX Runtime ZIP extraction no longer depends on unzip being available on Windows.

Changes

  • packages/opencode-plugin/src/config.ts
    • honor OPENCODE_CONFIG_DIR
    • use homedir() instead of process.env.HOME || "~"
  • packages/opencode-plugin/src/onnx-runtime.ts
    • for Windows ZIP extraction, try PowerShell Expand-Archive first
    • fall back to cmd.exe /c tar -xf ...
    • keep unzip for non-Windows platforms

Why

1. Runtime config mismatch on Windows

The plugin runtime was using process.env.HOME to derive ~/.config/opencode, while the doctor/config-path helpers used proper platform-aware home directory resolution. On Windows this could lead to doctor seeing a valid AFT config while the live runtime ignored it.

2. ONNX extraction failure on Windows

The semantic-search bootstrap path used unzip -q ... for ZIP archives. On a standard Windows host without unzip in PATH, ONNX download succeeded but extraction failed immediately.

Validation

  • built packages/opencode-plugin successfully from source
  • verified the built runtime contains the Windows extraction path (Expand-Archive + cmd /c tar -xf fallback)
  • exercised the local source build through OpenCode with a temporary config
  • confirmed ONNX Runtime downloaded and extracted successfully on Windows instead of failing on unzip

@ualtinok ualtinok merged commit fa26335 into cortexkit:main Apr 15, 2026
2 checks passed
@ualtinok
Copy link
Copy Markdown
Collaborator

ualtinok commented Apr 15, 2026

Thanks for the clean contribution @freelanceagent1! Merged and will ship in the next patch release.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants