feat(cli): add ogx launch opencode command#5675
feat(cli): add ogx launch opencode command#5675nathan-weinberg wants to merge 7 commits intoogx-ai:mainfrom
ogx launch opencode command#5675Conversation
Add a new `ogx launch` command group with `opencode` as the first subcommand. The command queries the running OGX server for available LLM models, generates an OpenCode-compatible provider configuration, and launches OpenCode with all models available via the OPENCODE_CONFIG_CONTENT environment variable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
|
I feel like |
For Perhaps |
| "context": 128000, | ||
| "output": 4096, |
There was a problem hiding this comment.
where did this magic come from?
There was a problem hiding this comment.
These are placeholder defaults Claude came up with - after some digging, the OGX models API doesn't currently expose context/output limits but OpenCode requires them in its config.
We could either pull these from model metadata if/when that's available, or make them CLI arguments. These are just conservative defaults that should work for most models.
There was a problem hiding this comment.
this is a place where ogx should contribute to the ecosystem. most model providers document their context lengths, but don't make them programmatically discoverable.
models.dev is handy for discovery.
however, ogx also works w/ vllm / ollama / nim, where each deployment is bespoke and cannot be covered by models.dev. for instance, i run qwen3.6, which has a 1M token context window, but i configure it to run with 125k context.
this is a separate issue, which comes up for me every time i see hardcoded lengths or embedding dims.
Replace direct httpx.get call with the openai Python client in the launch opencode command to be consistent with the rest of the codebase. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
The implementation was refactored in d913dd2 to use the OpenAI client instead of raw httpx, but the tests were not updated, causing all 9 test_launch_opencode tests to fail with 'module has no attribute httpx'. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
4c65611 to
6ea9ff7
Compare
|
@nathan-weinberg are you still working on this one? |
Yes, but I am on PTO until next Thursday w/ no laptop so I won't be able to do any additional work here until then I don't think there's any outstanding work to be done on this PR, so it can either be merged as-is or if any tweaks are desired before I return feel free to push additional commits to this branch |
|
(might need to run pre-commit because I resolved a conflict in the UI) |
Signed-off-by: Charlie Doern <cdoern@redhat.com>
What does this PR do?
Add a new
ogx launchcommand group withopencodeas the first subcommand. The command queries the running OGX server for available LLM models, generates an OpenCode-compatible provider configuration, and launches OpenCode with all models available via the OPENCODE_CONFIG_CONTENT environment variable.Closes #5639
Test Plan
Automated tests added, you can try this manually via the following steps:
gemini)ogx launch opencode/modelsin OpenCode and search forOGX