Commit graph

16 commits

Author SHA1 Message Date
777genius
4458ec1fd7 fix(opencode): wire junction diagnostics on dev 2026-05-28 13:12:02 +03:00
777genius
8abf4ea7dd fix(opencode): harden Windows junction retry 2026-05-28 13:08:55 +03:00
ComradeSwarog
b12106d8f4 fix(test): use expect.any(String) for junction error message assertions
The failure.message passed to ensureOpenCodeProfileNodeModulesJunction
comes from normalizeCommandFailure which may produce a JSON-escaped
string when the error contains structured JSON in stdout. Using the
raw runtimeMessage literal causes a mismatch in CI. Switch to
expect.any(String) to accept any string value for the errorMessage
parameter while still verifying the call happens.
2026-05-28 13:08:55 +03:00
ComradeSwarog
cc3c9f7dc7 fix(opencode): address code review feedback — extract paths from error message, fix test imports
- Extract symlink source/target paths directly from the error message
  instead of reconstructing them from process.env (Codex P2 review)
- Add extractSymlinkSourcePath and extractSymlinkTargetPath functions
- Update ensureOpenCodeProfileNodeModulesJunction to accept optional
  errorMessage parameter and use extracted paths from it
- Fix unused imports in test (remove 'os', replace 'beforeEach' with
  'afterEach' per CodeRabbit review)
- Widen fs.statSync mock signatures to use Parameters<typeof fs.statSync>
  per CodeRabbit review
- Add tests for new extraction functions
- Pass errorMessage to ensureOpenCodeProfileNodeModulesJunction calls
  in CLI client tests
2026-05-28 13:08:55 +03:00
ComradeSwarog
597c690dbc fix(opencode): add Windows junction fallback for node_modules EPERM symlink error (#187)
On Windows 10 without Developer Mode, the OpenCode runtime fails to create
a symlink from shared-cache/config-node_modules to the profile's
node_modules directory. The EPERM error blocks the entire OpenCode provider
catalog, leaving it unavailable.

Changes:
- New openCodeWindowsNodeModulesJunction module that pre-creates a Windows
  directory junction (no Developer Mode required) before the runtime call
  when an EPERM symlink error is detected
- On Windows, loadView and loadProviderDirectory now detect EPERM symlink
  errors, extract the profile ID, create the junction, and retry the
  runtime command once before falling back to the error response
- Updated diagnostic hints to accurately reflect that the runtime does not
  yet include junction fallback, and that the next runtime update will
  include it
- Added unit tests for the junction module and retry behavior
2026-05-28 13:08:54 +03:00
777genius
64fdfd2422 chore: checkpoint existing workspace changes 2026-05-23 13:48:35 +03:00
777genius
077c749cb7 fix(windows): harden elevated runtime detection 2026-05-22 18:43:50 +03:00
777genius
71bfab1758 test(runtime): cover opencode timeout diagnostics 2026-05-22 16:48:40 +03:00
777genius
6fb0c714ef fix(runtime-provider-management): surface provider diagnostics 2026-05-22 15:42:25 +03:00
777genius
3c427ac617 feat(runtime): support anthropic compatible endpoints 2026-05-22 00:16:52 +03:00
777genius
384446e83c feat(opencode): add scoped model defaults UI 2026-05-21 12:35:41 +03:00
777genius
238900f3cf feat(runtime-provider-management): expand opencode setup UI 2026-04-25 23:36:28 +03:00
777genius
41ca9fc0cb fix(runtime-provider-management): harden provider directory interactions 2026-04-25 19:48:23 +03:00
777genius
7fb5c8cf85 feat(runtime-provider-management): add provider directory bridge 2026-04-25 19:20:59 +03:00
777genius
825cfc00d1 test(runtime-provider-management): cover project-aware opencode flow 2026-04-25 18:40:01 +03:00
777genius
523d450bc8 feat(app): improve runtime provider and tmux flows 2026-04-25 17:28:56 +03:00