Skip to content

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

Merged
rekram1-node merged 8 commits intoanomalyco:devfrom
altendky:fix/tui-prompt-model-race
Mar 9, 2026
Merged

fix(tui): wait for model store before auto-submitting --prompt#7476
rekram1-node merged 8 commits intoanomalyco:devfrom
altendky:fix/tui-prompt-model-race

Conversation

@altendky
Copy link
Copy Markdown
Contributor

@altendky altendky commented Jan 9, 2026

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 #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.

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
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 9, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@altendky altendky marked this pull request as draft January 9, 2026 13:20
@altendky altendky marked this pull request as ready for review January 10, 2026 01:37
@altendky
Copy link
Copy Markdown
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?

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.

using --prompt should wait for prompt configuration loading

2 participants