[PR #7476] fix(tui): wait for model store before auto-submitting --prompt #12411

Open
opened 2026-02-16 18:17:19 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7476

State: open
Merged: No


fixes #7485--prompt submits before model store loads, causing wrong model. Now waits for sync.ready && local.model.ready."

fix last manually verified on february 16, 2026


longer form...

What does this PR do?

fixes https://github.com/anomalyco/opencode/issues/7485

When using --prompt, the prompt was being submitted in onMount()
before sync data and model store were fully loaded, causing it to use
a different default model than expected. Now uses a createEffect to
wait for both sync.ready and local.model.ready before submitting.

To debug model selection, run:
cd packages/opencode && bun dev --print-logs --log-level=DEBUG --prompt "hey"

Related issues: #7211, #7099

How did you verify your code works?

i compared running bun dev and waiting for it to load and then submitting a prompt vs. bun dev --prompt "heya". i observed both using the desired model with this change.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7476 **State:** open **Merged:** No --- fixes #7485 — `--prompt` submits before model store loads, causing wrong model. Now waits for sync.ready && local.model.ready." fix last manually verified on february 16, 2026 --- longer form... ### What does this PR do? fixes https://github.com/anomalyco/opencode/issues/7485 When using `--prompt`, the prompt was being submitted in onMount() before sync data and model store were fully loaded, causing it to use a different default model than expected. Now uses a createEffect to wait for both `sync.ready` and `local.model.ready` before submitting. To debug model selection, run: cd packages/opencode && bun dev --print-logs --log-level=DEBUG --prompt "hey" Related issues: #7211, #7099 ### How did you verify your code works? i compared running `bun dev` and waiting for it to load and then submitting a prompt vs. `bun dev --prompt "heya"`. i observed both using the desired model with this change.
yindo added the pull-request label 2026-02-16 18:17:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12411