Skip to content

fix(windows): HTTP-first version gate + PATHEXT CLI discovery#180

Merged
ajianaz merged 1 commit into
developfrom
fix/windows-cli-discovery-171
Jul 20, 2026
Merged

fix(windows): HTTP-first version gate + PATHEXT CLI discovery#180
ajianaz merged 1 commit into
developfrom
fix/windows-cli-discovery-171

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Fixes #171.

Root cause: the Documents version gate probed uteke --version via the CLI, and the CLI lookup (find_in_path / find_uteke_cli) did not handle the Windows .exe extension / PATHEXT. Result: on Windows, "uteke CLI not found" → "Detected: unknown" → Documents tab blocked, even though uteke.exe was correctly installed and the HTTP connection to uteke-serve worked (Memories & Graph fine).

Two-pronged fix:

  1. HTTP-first version gate (the real fix). resolve_uteke_version now probes the running server's /health version field for local servers too (previously only remote). The connected uteke-serve reports its version over HTTP (≥ 0.7.2, #636), so the gate no longer depends on locating the CLI binary for any modern install — including the reporter's uteke 0.8.0 on Windows. Cached uteke --version stays as fallback for servers < 0.7.2.

  2. PATHEXT-aware CLI discovery (fixes the fallback + self-update). find_in_path probes every PATHEXT ext per PATH entry on Windows; find_uteke_cli/find_uteke_serve try .exe in ~/.local/bin. PATHEXT parsing extracted into a pure expand_with_pathext helper (#[cfg(any(windows, test))]) with 3 cross-platform unit tests.

Testing note: runtime behavior verified via logic/unit tests on macOS. CI runs Linux-only (ci.yml), so the Windows branches are covered by (a) the pure unit tests and (b) the release build matrix (windows-latest). The reporter on Windows can confirm a build.

All checks green locally: cargo fmt/clippy(-D warnings)/test (17), svelte-check (0 err), vitest (61), npm build.

On Windows the Documents tab always showed "uteke CLI not found" /
"Detected: unknown" even with uteke.exe correctly on PATH, because the
Documents version gate fell back to shelling the CLI and the CLI lookup
missed the .exe extension. Two-pronged fix:

1. HTTP-first version resolution (the real fix). resolve_uteke_version
   now probes the running server's /health `version` field for LOCAL
   servers too, not just remote ones. The connected uteke-serve already
   reports its version over HTTP (>= 0.7.2, #636), so the gate no longer
   depends on locating the CLI binary at all for any modern install.
   The cached `uteke --version` CLI output remains as a fallback for
   servers older than 0.7.2 that don't report /health version.

2. PATHEXT-aware CLI discovery (fixes the fallback + self-update path).
   - find_in_path now probes every PATHEXT extension on Windows
     (uteke.exe, uteke.com, ...) per PATH entry.
   - find_uteke_cli / find_uteke_serve try the .exe variants in
     ~/.local/bin as well.
   - PATHEXT parsing extracted into a pure `expand_with_pathext` helper
     (cfg-gated) with 3 cross-platform unit tests, since CI runs only
     on Linux.

Verified locally: cargo fmt/clippy(-D warnings)/test (17), svelte-check
(0 err), vitest (61), npm build.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

⚠️ Review recommended — warnings found.

🟡 Warning (1)

  • unknown:? — Cora AI review could not complete: failed to parse LLM JSON response: parse failed (original: EOF while parsing a value at line 1 column 0, after repair: EOF while parsing a value at line 1 column 0). Review was skipped; no code quality issues were found by the automated check.

Review powered by cora-cli · BYOK · MIT

@ajianaz
ajianaz merged commit c608643 into develop Jul 20, 2026
9 checks passed
@ajianaz ajianaz mentioned this pull request Jul 20, 2026
ajianaz added a commit that referenced this pull request Jul 20, 2026
Patch release — Windows Documents-tab fix, uteke 0.8.x compatibility, and
a full dependency sweep (incl. vite 6→8).

- bump version 0.3.1 → 0.3.2 (package.json, Cargo.toml, Cargo.lock,
  tauri.conf.json)
- CHANGELOG entry

Contents (since v0.3.1):
- Fixed: Windows "uteke CLI not found" — HTTP-first version gate reads
  /health `version`; CLI discovery now PATHEXT-aware (#171, #180)
- Fixed: uteke 0.8.x room-document compat — /room/summary-document with
  legacy /room/document fallback (#178)
- Changed: version gate HTTP-first for local servers too (#180)
- Deps: vite 6→8 + @sveltejs/vite-plugin-svelte 5→7 (#179), tokio
  1.52→1.53 (#175), serde/thiserror/toml/tauri-plugin-dialog,
  @codemirror/language/dompurify/marked, actions/setup-node 6→7 (#172)
ajianaz added a commit that referenced this pull request Jul 21, 2026
Version detection no longer shells `uteke --version` on the data/version
path. The effective uteke version is resolved purely from the connected
server's /health `version` field (uteke ≥ 0.7.2) in resolve_uteke_version
— same path for local and remote servers.

Changes:
- Remove the AppState.uteke_version cache field + its startup CLI probe.
- resolve_uteke_version: merge the local/remote branches into one
  HTTP-only path (no cached fallback). Returns None when the server is
  unreachable or older than the /health version field.
- uteke_self_update: drop the now-dead cache write (keeps `uteke upgrade`
  + detect_uteke_version to read the freshly-upgraded CLI version — the
  one remaining CLI touch, which is binary maintenance, not data).

Net effect: CorIn ↔ uteke-serve is HTTP-only for all data + version
gating. The `uteke` CLI binary is invoked only by the explicit "Update
uteke" action (and by bootstrap, which spawns the uteke-serve daemon).
This completes the HTTP-first direction started in #180 and fully removes
the CLI-discovery fragility that caused #171 on Windows.

Docs: compat comments updated to uteke 0.7.x–0.9.x; module doc notes
/room/summary-document is canonical since uteke 0.9.0.

Verified: cargo fmt/clippy(-D warnings)/test (17), svelte-check (0 err),
vitest (61), npm build.
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.

[BUG] Windows: Documents tab "uteke CLI not found" — find_uteke_cli / find_in_path don't handle .exe / PATHEXT

1 participant