fix(tui): wait for model store before auto-submitting --prompt#7476
Merged
rekram1-node merged 8 commits intoanomalyco:devfrom Mar 9, 2026
Merged
fix(tui): wait for model store before auto-submitting --prompt#7476rekram1-node merged 8 commits intoanomalyco:devfrom
rekram1-node merged 8 commits intoanomalyco:devfrom
Conversation
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: anomalyco#7211, anomalyco#7099
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
Contributor
Author
|
@rekram1-node, any issues here that i should address in this bug fix, or maybe just concerns you would like me to collect some info about? |
demostanis
pushed a commit
to demostanis/opencode
that referenced
this pull request
Mar 19, 2026
demostanis
pushed a commit
to demostanis/opencode
that referenced
this pull request
Mar 20, 2026
This was referenced Mar 22, 2026
balcsida
pushed a commit
to balcsida/opencode
that referenced
this pull request
Mar 24, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #7485 —
--promptsubmits 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 #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.readyandlocal.model.readybefore 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 devand 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.