anomalyco / anomalyco/opencode
[FEATURE]: Expose the current TUI model to plugins
@simonklee is already working on this.
Since Aug 15, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
TUI plugins can render beside the prompt, but they cannot read the model currently selected for the next prompt. Session messages and model events only expose submitted or durable state, so plugin UI can remain stale after the user changes the model picker.
Could api.state expose a read-only accessor such as:
api.state.model.current():
| { providerID: string; modelID: string }
| undefined
This would project the same live Solid state used by the model picker and prompt submission. Reads inside plugin components or memos would update when the selection changes; reads outside a reactive scope would be point-in-time. It would return undefined until a valid model is available.
This would support model-aware prompt UI, context indicators, and provider-specific controls without switching or persisting the model.
I'm looking for design feedback on the API placement, return shape, and reactive contract before preparing a PR.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.