Skip to content

fix: update local model to qwen/qwen3.5-9b and extract obsidian inline script - #1415

Merged
shunkakinoki merged 3 commits into
mainfrom
fix/shell-tests-and-inline-check
Apr 10, 2026
Merged

fix: update local model to qwen/qwen3.5-9b and extract obsidian inline script#1415
shunkakinoki merged 3 commits into
mainfrom
fix/shell-tests-and-inline-check

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Apr 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace Gemma model references with qwen/qwen3.5-9b in all codex/opencode/pi fish functions (both .fish and .tpl.fish)
  • Extract inline shell script from obsidian/default.nix to external obsidian-headless.sh using pkgs.replaceVars

Fixes

  • shell-test: 15 failing tests expecting __QWEN_LOCAL__ placeholder in templates and qwen/qwen3.5-9b in non-template functions
  • shell-inline-check: writeShellScriptBin with inline string in obsidian module

Summary by cubic

Switch the local LLM from Gemma to Qwen 3.5 9B across Codex/OpenCode/Pi fish helpers and extract the Obsidian headless launcher into an external script with tests. Fixes failing shell tests and the inline script check; also applies Nix formatting across configs.

  • Bug Fixes

    • Update fish functions to use qwen/qwen3.5-9b and templates to use __QWEN_LOCAL__, resolving 15 shell-test failures.
    • Replace inline writeShellScriptBin in the obsidian module with external obsidian-headless.sh via pkgs.replaceVars (uses xvfb-run and obsidian); add a test spec and include the script in coverage, satisfying the shell-inline-check.
  • Refactors

    • Apply Nix formatting across config and module files (no functional changes).

Written for commit 4e66eb9. Summary will update on new commits.

Copilot AI review requested due to automatic review settings April 10, 2026 21:30
@mesa-dot-dev

mesa-dot-dev Bot commented Apr 10, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@coderabbitai

coderabbitai Bot commented Apr 10, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Refactored the Obsidian headless shim to load its script from an external file and added that script plus tests; updated multiple Fish helper functions to switch configured AI model identifiers from Gemma variants to Qwen variants.

Changes

Cohort / File(s) Summary
Obsidian headless shim
home-manager/modules/obsidian/default.nix, home-manager/modules/obsidian/obsidian-headless.sh, spec/obsidian_headless_spec.sh
Moved inline shell body into obsidian-headless.sh and use builtins.readFile/pkgs.replaceVars in Nix; added tests for the new script.
ShellSpec coverage
spec/coverage_spec.sh
Added home-manager/modules/obsidian/obsidian-headless.sh to the covered scripts list.
Codex functions (Fish)
home-manager/programs/fish/functions/_coxel_function.fish, home-manager/programs/fish/functions/_coxel_function.tpl.fish, home-manager/programs/fish/functions/_coxelh_function.fish, home-manager/programs/fish/functions/_coxelh_function.tpl.fish
Replaced Gemma model identifiers with Qwen equivalents (qwen/qwen3.5-9b or __QWEN_LOCAL__) and updated descriptions/comments; logic unchanged.
OpenCode functions (Fish)
home-manager/programs/fish/functions/_ocxel_function.fish, home-manager/programs/fish/functions/_ocxel_function.tpl.fish, home-manager/programs/fish/functions/_ocxelh_function.fish, home-manager/programs/fish/functions/_ocxelh_function.tpl.fish
Swapped model identifiers from Gemma to Qwen across all execution paths and updated descriptions/comments; control flow unchanged.
Pixel functions (Fish)
home-manager/programs/fish/functions/_pixel_function.fish, home-manager/programs/fish/functions/_pixelh_function.fish
Updated invoked model from lmstudio/qwen3.5-0.8b-optiq to lmstudio/qwen/qwen3.5-9b.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped a path from Gemma's glen,
Found Qwen's bright meadow, trotted in,
I pulled the script out, neat and small,
Pushed tests and models — spring for all! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: updating the local model to Qwen and extracting the Obsidian inline script to an external file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly outlines the changes: replacing Gemma model references with Qwen across fish functions and extracting an inline Obsidian script to an external file. These match the changeset summary.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/shell-tests-and-inline-check

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mesa-dot-dev

mesa-dot-dev Bot commented Apr 10, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Replaced Gemma LLM with Qwen 3.5 9B across Codex/OpenCode/Pi fish functions and extracted the Obsidian headless launcher into an external script, along with associated tests.

What changed?

LLM Model Updates (Gemma to Qwen 3.5 9B)

  • home-manager/programs/fish/functions/_coxel_function.fish: Updated codex command's default local model to qwen/qwen3.5-9b.
  • home-manager/programs/fish/functions/_coxel_function.tpl.fish: Changed default LLM from 'Gemma' to 'Qwen' for codex commands in the template.
  • home-manager/programs/fish/functions/_coxelh_function.fish: Switched codex exec command's model from Gemma to Qwen.
  • home-manager/programs/fish/functions/_coxelh_function.tpl.fish: Updated the template for _coxelh_function.
  • home-manager/programs/fish/functions/_ocxel_function.fish: Changed opencode command's default local model to lmstudio/qwen/qwen3.5-9b.
  • home-manager/programs/fish/functions/_ocxel_function.tpl.fish: Updated template for _ocxel_function.
  • home-manager/programs/fish/functions/_ocxelh_function.fish: Switched opencode run command's model from Gemma to Qwen.
  • home-manager/programs/fish/functions/_ocxelh_function.tpl.fish: Updated _ocxelh_function template to use lmstudio/__QWEN_LOCAL__.
  • home-manager/programs/fish/functions/_pixel_function.fish: Updated pi command's model to lmstudio/qwen/qwen3.5-9b.
  • home-manager/programs/fish/functions/_pixelh_function.fish: Updated headless pi command's model to lmstudio/qwen/qwen3.5-9b.

Obsidian Headless Script Extraction

  • home-manager/modules/obsidian/default.nix: Refactored obsidianHeadless to source its shell script from the new external obsidian-headless.sh using pkgs.replaceVars.
  • home-manager/modules/obsidian/obsidian-headless.sh: New script enabling headless or automated Obsidian operation.

Testing and Coverage

  • spec/coverage_spec.sh: Included home-manager/modules/obsidian/obsidian-headless.sh in the coverage list.
  • spec/obsidian_headless_spec.sh: Added new shellspec test file for validating obsidian-headless.sh's behavior, including shebang, syntax, placeholders, exec usage, argument passing, and xvfb-run -a flag.

Description generated by Mesa. Update settings

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Obsidian headless shim to use an external script via pkgs.replaceVars and updates several Fish functions (Coxel, OpenCode, and Pi) to transition from Gemma and older Qwen models to qwen/qwen3.5-9b. Feedback highlights that models.json must be updated to ensure the __QWEN_LOCAL__ placeholder resolves correctly and notes that the template files for the pixel functions are missing from the current changes.

codex resume $argv[2]
else if test (count $argv) -eq 0
codex --oss --local-provider lmstudio --model '__GEMMA__' --full-auto -c model_reasoning_effort=minimal
codex --oss --local-provider lmstudio --model '__QWEN_LOCAL__' --full-auto -c model_reasoning_effort=minimal

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The template now uses the __QWEN_LOCAL__ placeholder, which likely maps to the qwen-local key in models.json. However, the current models.json (visible in the repository context) still defines qwen-local as qwen3.5-0.8b-optiq.

To ensure that generated functions correctly use the new model and match the hardcoded .fish files updated in this PR, models.json should be updated to point to qwen/qwen3.5-9b.


if test (count $argv) -gt 0; and contains -- "$argv[1]" --resume -r --continue -c
pi --model 'lmstudio/qwen3.5-0.8b-optiq' --resume $argv[2]
pi --model 'lmstudio/qwen/qwen3.5-9b' --resume $argv[2]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The pull request description states that Gemma model references are being replaced in all codex, opencode, and pi fish functions, including both .fish and .tpl.fish versions. While the .fish files for pixel and pixelh are updated here, their corresponding template files (_pixel_function.tpl.fish and _pixelh_function.tpl.fish) are missing from the changes. If these templates exist in the repository, they should be updated to maintain consistency with the other functions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates local LLM wrapper scripts and the Obsidian headless shim to align with the new default local model and to satisfy repository checks around inline shell strings.

Changes:

  • Switch Codex/OpenCode/Pi fish wrappers (both .fish and .tpl.fish) from Gemma/older Qwen references to qwen/qwen3.5-9b (and __QWEN_LOCAL__ in templates).
  • Standardize fish wrapper descriptions/comments to reference the local Qwen model.
  • Extract the Obsidian xvfb-run wrapper into obsidian-headless.sh and inject paths via pkgs.replaceVars.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
home-manager/programs/fish/functions/_pixelh_function.fish Update Pi headless wrapper to use the new local Qwen model ID
home-manager/programs/fish/functions/_pixel_function.fish Update Pi interactive wrapper to use the new local Qwen model ID
home-manager/programs/fish/functions/_ocxelh_function.tpl.fish Update OpenCode headless template to Qwen wording + __QWEN_LOCAL__ placeholder
home-manager/programs/fish/functions/_ocxelh_function.fish Update OpenCode headless wrapper to the new concrete Qwen model ID
home-manager/programs/fish/functions/_ocxel_function.tpl.fish Update OpenCode interactive template to Qwen wording + __QWEN_LOCAL__ placeholder
home-manager/programs/fish/functions/_ocxel_function.fish Update OpenCode interactive wrapper to the new concrete Qwen model ID
home-manager/programs/fish/functions/_coxelh_function.tpl.fish Update Codex headless template to Qwen wording + __QWEN_LOCAL__ placeholder
home-manager/programs/fish/functions/_coxelh_function.fish Update Codex headless wrapper to the new concrete Qwen model ID
home-manager/programs/fish/functions/_coxel_function.tpl.fish Update Codex interactive template to Qwen wording + __QWEN_LOCAL__ placeholder
home-manager/programs/fish/functions/_coxel_function.fish Update Codex interactive wrapper to the new concrete Qwen model ID
home-manager/modules/obsidian/obsidian-headless.sh New externalized wrapper script used to run Obsidian CLI under Xvfb
home-manager/modules/obsidian/default.nix Replace inline shell string with replaceVars + external script file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 7 to 12
else if test (count $argv) -eq 0
codex --oss --local-provider lmstudio --model '__GEMMA__' --full-auto -c model_reasoning_effort=minimal
codex --oss --local-provider lmstudio --model '__QWEN_LOCAL__' --full-auto -c model_reasoning_effort=minimal
else
set -l prompt (string join " " -- $argv)
codex exec --oss --local-provider lmstudio --model '__GEMMA__' --full-auto -c model_reasoning_effort=minimal -- "$prompt"
codex exec --oss --local-provider lmstudio --model '__QWEN_LOCAL__' --full-auto -c model_reasoning_effort=minimal -- "$prompt"
end

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These templates now use the __QWEN_LOCAL__ placeholder, but scripts/llm-update.sh sources placeholder values from the repo-level models.json key qwen-local, which currently maps to qwen3.5-0.8b-optiq. As-is, rerunning scripts/llm-update.sh will regenerate the concrete .fish wrappers back to the old model. Update models.json (qwen-local) to qwen/qwen3.5-9b (and re-run llm-update) so the placeholder-driven generation stays consistent with the committed .fish files.

Copilot uses AI. Check for mistakes.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 12 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:8">
P2: The `__QWEN_LOCAL__` placeholder will resolve to whatever value `models.json` maps for `qwen-local`. If that file still points to the old model (`qwen3.5-0.8b-optiq`), the template-generated functions will use a different model than the hardcoded `.fish` files (`qwen/qwen3.5-9b`). Ensure `models.json` is updated in this PR to keep both in sync.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

codex resume $argv[2]
else if test (count $argv) -eq 0
codex --oss --local-provider lmstudio --model '__GEMMA__' --full-auto -c model_reasoning_effort=minimal
codex --oss --local-provider lmstudio --model '__QWEN_LOCAL__' --full-auto -c model_reasoning_effort=minimal

@cubic-dev-ai cubic-dev-ai Bot Apr 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The __QWEN_LOCAL__ placeholder will resolve to whatever value models.json maps for qwen-local. If that file still points to the old model (qwen3.5-0.8b-optiq), the template-generated functions will use a different model than the hardcoded .fish files (qwen/qwen3.5-9b). Ensure models.json is updated in this PR to keep both in sync.

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 8:

<comment>The `__QWEN_LOCAL__` placeholder will resolve to whatever value `models.json` maps for `qwen-local`. If that file still points to the old model (`qwen3.5-0.8b-optiq`), the template-generated functions will use a different model than the hardcoded `.fish` files (`qwen/qwen3.5-9b`). Ensure `models.json` is updated in this PR to keep both in sync.</comment>

<file context>
@@ -1,13 +1,13 @@
     codex resume $argv[2]
   else if test (count $argv) -eq 0
-    codex --oss --local-provider lmstudio --model '__GEMMA__' --full-auto -c model_reasoning_effort=minimal
+    codex --oss --local-provider lmstudio --model '__QWEN_LOCAL__' --full-auto -c model_reasoning_effort=minimal
   else
     set -l prompt (string join " " -- $argv)
</file context>
Fix with Cubic

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.

2 participants