Commit d5e5589
committed
fix(dashboard): include ~/.opencode/bin in opencode binary lookup
The Rust `get_available_models` command spawns `opencode models` to
populate the model picker for historian / dreamer / sidekick primary
and fallback dropdowns. GUI processes on macOS don't inherit shell
PATH, so the command tries an explicit list of candidate binary paths.
The previous candidate list missed the most important one: the official
OpenCode installer (`curl -fsSL https://opencode.ai/install | bash`)
writes the binary to `~/.opencode/bin/opencode`, NOT to ~/.local/bin
or anywhere else in the previous candidate list. Users with a stock
OpenCode install therefore got an empty `models()` array in the
dashboard, which made every model dropdown render the `<For fallback>`
empty-state ("No models found").
This bug masqueraded as a `fallback_models` filter problem in v0.3.3
because the user-visible symptom was the same — but the v0.3.3 fix
(string-vs-array normalization in the dropdown filter) only addressed
one of two distinct empty-dropdown causes. This commit fixes the
deeper one: `models()` itself was empty.
Promoted `~/.opencode/bin/opencode` to the first candidate on macOS
and Linux. Also added `%USERPROFILE%\.opencode\bin\opencode.exe` as
the first Windows candidate for symmetry. The shell-PATH `opencode`
fallback remains for users who launch OpenCode from a terminal.
After upgrade, the existing `availableModels` localStorage cache
(empty `[]` from a prior failed lookup) is overwritten by the next
`onMount` refresh, so users will see populated dropdowns on first
launch of the upgraded build with no manual cache clear required.
Verified: cargo check clean, dashboard frontend build clean.1 parent b47831b commit d5e5589
1 file changed
Lines changed: 22 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
359 | 372 | | |
360 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
361 | 378 | | |
| 379 | + | |
362 | 380 | | |
| 381 | + | |
363 | 382 | | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
| 383 | + | |
368 | 384 | | |
369 | 385 | | |
370 | 386 | | |
| |||
0 commit comments