feat: wire local qwen model into codex configs - #1078
Conversation
Entire-Checkpoint: 11bc22e092dc
Mesa DescriptionTL;DRWires local Qwen 3.5 9B model into Codex and OpenCode configurations, replacing older local GPT-OSS/GLM entries and standardizing fish wrapper templating for LM Studio integration. What changed?
Description generated by Mesa. Update settings |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request streamlines the local large language model integration within the Codex and OpenCode systems by introducing support for the Qwen 3.5 9B model. It consolidates local model configurations, removes outdated entries, and enhances the shell wrapper generation process to support templated model names, improving flexibility and maintainability for local LLM usage. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly wires up the local Qwen model, replacing old configurations. The introduction of template files for fish functions is a great improvement. My review includes suggestions to further improve maintainability by using the newly defined qwen-local profile in the fish wrapper functions instead of hardcoding the model name and provider. This would make future updates to the local model configuration easier, as changes would be centralized in the config.toml file. I've also included suggestions for updating the new test files to align with this change.
| if test (count $argv) -eq 0 | ||
| codex --model '__QWEN_LOCAL__' --full-auto -c model_provider=lmstudio -c model_reasoning_summary_format=experimental | ||
| else | ||
| set -l prompt (string join " " -- $argv) | ||
| codex exec --model '__QWEN_LOCAL__' --full-auto -c model_provider=lmstudio -c model_reasoning_summary_format=experimental -- "$prompt" | ||
| end |
There was a problem hiding this comment.
For better maintainability and consistency, consider using the qwen-local profile, which is already defined in config/codex/config.tpl.toml. This avoids hardcoding the model and provider in this script. If the local model configuration changes in the future, you would only need to update the config.toml file.
if test (count $argv) -eq 0
codex --profile 'qwen-local' --full-auto -c model_reasoning_summary_format=experimental
else
set -l prompt (string join " " -- $argv)
codex exec --profile 'qwen-local' --full-auto -c model_reasoning_summary_format=experimental -- "$prompt"
end
| return 1 | ||
| end | ||
|
|
||
| codex exec --model '__QWEN_LOCAL__' --full-auto -c model_provider=lmstudio -c model_reasoning_summary_format=experimental -- "$prompt" |
There was a problem hiding this comment.
| @test "no args uses QWEN_LOCAL placeholder" (grep -c "__QWEN_LOCAL__" $log1) -ge 1 | ||
| @test "no args forces lmstudio provider" (grep -c "model_provider=lmstudio" $log1) -ge 1 |
There was a problem hiding this comment.
| @test "with args uses QWEN_LOCAL placeholder" (grep -c "__QWEN_LOCAL__" $log2) -ge 1 | ||
| @test "with args forces lmstudio provider" (grep -c "model_provider=lmstudio" $log2) -ge 1 |
| @test "non-empty prompt uses QWEN_LOCAL placeholder" (grep -c "__QWEN_LOCAL__" $log1) -ge 1 | ||
| @test "non-empty prompt forces lmstudio provider" (grep -c "model_provider=lmstudio" $log1) -ge 1 |
Entire-Checkpoint: 882ea478a15e
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (23)
Disabled knowledge base sources:
📝 WalkthroughSummary by CodeRabbit
WalkthroughConsolidates local LLM profiles to a single Qwen 3.5 9B model via LM Studio, updates Codex/OpenCode model registries, adds four Fish shell function pairs (interactive/headless) for Codex/OpenCode, extends tests for those functions, and updates the llm-update template mappings. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…l Qwen model Entire-Checkpoint: c9a2c3f2b9ba
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
There was a problem hiding this comment.
Pull request overview
Wires a local Qwen model (qwen/qwen3.5-9b) into Codex/OpenCode configs and standardizes fish wrapper generation via templates and placeholder substitution.
Changes:
- Added
qwen-localalias inmodels.jsonand updated Codex/OpenCode configs to use Qwen via LM Studio. - Introduced templated fish wrapper functions (
*_function.tpl.fish) and updatedscripts/llm-update.shto hydrate generated wrappers. - Extended fish specs to validate both template placeholders (
__QWEN_LOCAL__) and substituted outputs.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/fish/_ocxelh_function_test.fish | Adds spec coverage for generated ocxelh OpenCode wrapper using Qwen via LM Studio. |
| spec/fish/_ocxelh_function.tpl_test.fish | Adds spec coverage for templated ocxelh wrapper verifying __QWEN_LOCAL__ placeholder. |
| spec/fish/_ocxel_function_test.fish | Adds spec coverage for generated ocxel OpenCode wrapper (interactive + run modes). |
| spec/fish/_ocxel_function.tpl_test.fish | Adds spec coverage for templated ocxel wrapper placeholder behavior. |
| spec/fish/_coxelh_function_test.fish | Extends coxelh spec to assert LM Studio provider + Qwen + minimal reasoning. |
| spec/fish/_coxelh_function.tpl_test.fish | Adds spec coverage for templated coxelh wrapper placeholder behavior. |
| spec/fish/_coxel_function_test.fish | Updates coxel spec assertions from old local model to Qwen/LM Studio flags. |
| spec/fish/_coxel_function.tpl_test.fish | Adds spec coverage for templated coxel wrapper placeholder behavior. |
| scripts/llm-update.sh | Adds template-to-generated mappings for new fish wrapper templates. |
| models.json | Adds qwen-local alias pointing to qwen/qwen3.5-9b. |
| home-manager/programs/fish/functions/_ocxelh_function.tpl.fish | New templated OpenCode headless wrapper using __QWEN_LOCAL__. |
| home-manager/programs/fish/functions/_ocxelh_function.fish | New generated OpenCode headless wrapper pinned to qwen/qwen3.5-9b. |
| home-manager/programs/fish/functions/_ocxel_function.tpl.fish | New templated OpenCode prompt wrapper (interactive/run) using __QWEN_LOCAL__. |
| home-manager/programs/fish/functions/_ocxel_function.fish | New generated OpenCode prompt wrapper pinned to qwen/qwen3.5-9b. |
| home-manager/programs/fish/functions/_coxelh_function.tpl.fish | New templated Codex headless wrapper using LM Studio + __QWEN_LOCAL__. |
| home-manager/programs/fish/functions/_coxelh_function.fish | Updates generated Codex headless wrapper to Qwen/LM Studio flags. |
| home-manager/programs/fish/functions/_coxel_function.tpl.fish | New templated Codex prompt wrapper using LM Studio + __QWEN_LOCAL__. |
| home-manager/programs/fish/functions/_coxel_function.fish | Updates generated Codex prompt wrapper to Qwen/LM Studio flags. |
| home-manager/programs/fish/default.nix | Registers new fish functions/aliases for ocxel and ocxelh. |
| config/opencode/opencode.tpl.jsonc | Replaces prior local model entries with __QWEN_LOCAL__ for LM Studio provider. |
| config/opencode/opencode.jsonc | Refreshes generated OpenCode config to use qwen/qwen3.5-9b. |
| config/codex/config.tpl.toml | Adds qwen-local profile and LM Studio OSS provider wiring via placeholders. |
| config/codex/config.toml | Refreshes generated Codex config with qwen-local profile targeting qwen/qwen3.5-9b. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| @@ -0,0 +1,11 @@ | |||
| function _coxel_function --description "Run Codex with a free-form prompt using the local Qwen model" | |||
| # Run Codex with a free-form prompt (spaces allowed) using the local Qwen model | |||
| # Usage: cxel [<prompt words...>] | |||
| # Run Codex with a free-form prompt (spaces allowed) using the local glm-4-7-flash model | ||
| function _coxel_function --description "Run Codex with a free-form prompt using the local Qwen model" | ||
| # Run Codex with a free-form prompt (spaces allowed) using the local Qwen model | ||
| # Usage: cxel [<prompt words...>] |
|
|
||
| # ── no args: interactive mode ───────────────────────────── | ||
| set log1 (mktemp) | ||
| function opencode; echo $argv >> $log1; end |
|
|
||
| # ── with args: run mode ────────────────────────────────── | ||
| set log2 (mktemp) | ||
| function opencode; echo $argv >> $log2; end |
There was a problem hiding this comment.
2 issues found across 23 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="home-manager/programs/fish/functions/_coxel_function.tpl.fish">
<violation number="1" location="home-manager/programs/fish/functions/_coxel_function.tpl.fish:3">
P3: The usage comment points to `cxel`, but this wrapper is exposed as `coxel`. Update it so the generated wrapper does not document a non-existent command.</violation>
</file>
<file name="home-manager/programs/fish/functions/_ocxel_function.tpl.fish">
<violation number="1" location="home-manager/programs/fish/functions/_ocxel_function.tpl.fish:6">
P2: This wrapper only overrides OpenCode's primary model, so lightweight `small_model` calls can still go to the remote `cliproxyapi/glm-4.7` provider.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| # Usage: ocxel [<prompt words...>] | ||
|
|
||
| if test (count $argv) -eq 0 | ||
| opencode -m 'lmstudio/__QWEN_LOCAL__' |
There was a problem hiding this comment.
P2: This wrapper only overrides OpenCode's primary model, so lightweight small_model calls can still go to the remote cliproxyapi/glm-4.7 provider.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At home-manager/programs/fish/functions/_ocxel_function.tpl.fish, line 6:
<comment>This wrapper only overrides OpenCode's primary model, so lightweight `small_model` calls can still go to the remote `cliproxyapi/glm-4.7` provider.</comment>
<file context>
@@ -0,0 +1,11 @@
+ # Usage: ocxel [<prompt words...>]
+
+ if test (count $argv) -eq 0
+ opencode -m 'lmstudio/__QWEN_LOCAL__'
+ else
+ set -l prompt (string join " " -- $argv)
</file context>
| @@ -0,0 +1,11 @@ | |||
| function _coxel_function --description "Run Codex with a free-form prompt using the local Qwen model" | |||
| # Run Codex with a free-form prompt (spaces allowed) using the local Qwen model | |||
| # Usage: cxel [<prompt words...>] | |||
There was a problem hiding this comment.
P3: The usage comment points to cxel, but this wrapper is exposed as coxel. Update it so the generated wrapper does not document a non-existent command.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At home-manager/programs/fish/functions/_coxel_function.tpl.fish, line 3:
<comment>The usage comment points to `cxel`, but this wrapper is exposed as `coxel`. Update it so the generated wrapper does not document a non-existent command.</comment>
<file context>
@@ -0,0 +1,11 @@
+function _coxel_function --description "Run Codex with a free-form prompt using the local Qwen model"
+ # Run Codex with a free-form prompt (spaces allowed) using the local Qwen model
+ # Usage: cxel [<prompt words...>]
+
+ if test (count $argv) -eq 0
</file context>
Changes
qwen-localmodel alias that resolves toqwen/qwen3.5-9bcoxelandcoxelhfish wrappers so__QWEN_LOCAL__is substituted into generated wrappersTechnical Details
--model __QWEN_LOCAL__and forcemodel_provider=lmstudioscripts/llm-update.shnow hydrates_coxel_functionand_coxelh_functionfrom template sourcesTesting
bash scripts/llm-update.shcoxelandcoxelhwrappers verifyingqwen/qwen3.5-9bwithmodel_provider=lmstudiocoxelandcoxelhwrappers verifying__QWEN_LOCAL__fishtapenot available in this shell, so the fish specs were not run end-to-endGenerated with Codex by GPT-5
Summary by cubic
Switches local Codex and OpenCode to Qwen 3.5 9B via LM Studio, adds OpenCode fish wrappers, and standardizes templating/tests. Introduces a
qwen-localalias, removes old GPT‑OSS/GLM entries, and sets minimal reasoning for local runs.New Features
qwen-localinmodels.json->qwen/qwen3.5-9b.oss_provider=lmstudio, addedprofiles.qwen-local, wrappers use--oss --local-provider lmstudio --model ...; removedgpt-oss/glm-4-7-flash.ocxel/ocxelhwrappers and templates wired to LM Studio Qwen; updatedopencode*.jsonc; mapped commands inhome-managerand added tests.scripts/llm-update.shhydrates new Codex/OpenCode templates; fish specs cover placeholders and generated wrappers.Migration
bash scripts/llm-update.shto regenerate configs and wrappers.qwen/qwen3.5-9b; usecoxel/coxelhandocxel/ocxelh, orcodex --model qwen/qwen3.5-9b/opencode -m lmstudio/qwen/qwen3.5-9b.Written for commit 713a2f4. Summary will update on new commits.