Update happy with opencode support#459
Conversation
|
Hi @vinnymac, great to see OpenCode support on the way! I haven't tested your branch yet, but one thing caught my eye: supporting only the build and plan modes. I assume this means the oh-my-opencode plugin isn't supported since it adds its own modes? Is it not possible to dynamically look up available models from OpenCode? |
Unfortunately I can’t answer this question, as I don't use this plugin. Not sure if supporting third party plugins is a goal of Happy Coder, but if it is, I can certainly look into it. Officially supported modes is always going to be easier to maintain though.
Yes and no. I mention this in the PR description. Opencode has a models command, which simply fetches from models.dev. We could either try using the models command or models.dev, but either way, it’s easier for now to just have the user specify the model they want to use. If Happy has an existing pattern for controlling models via the Web / Mobile UI, I can steer this PR toward customizing that with OpenCode supported models. If it doesn’t exist that would be a separate goal from this pull request. Regardless this PR should support all of the models that OpenCode supports, even if it doesn’t currently show the user all of those (160+) options. Cheers |
|
@akaihola is there any timeline for adding in opencode and merging this PR? |
This integrates OpenCode into happy, following the patterns established in the Claude Code and Gemini PRs. The PR was dogfooded - built entirely using OpenCode itself (alternating between Opus 4.5 and Sonnet 4.5).
What's included:
New happy opencode command for both CLI and expo-app
Support for OpenCode's build and plan modes (the only two that exist currently)
Model selection via --model flag or fallback to opencode config
Full integration with models.dev's model registry
Model selection:
Run opencode models --refresh to fetch the current list, then opencode models to view available options. Fair warning: there are 160+ models in that list. Suggestions welcome on how to make this more user-friendly.
Example:
Feedback warmly welcomed 🤗
Closes #265