Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions config/codex/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ suppress_unstable_features_warning = true
web_search = "cached"
model = "gpt-5.3-codex"
model_reasoning_effort = "xhigh"
oss_provider = "lmstudio"

[features]
ghost_commit = false
Expand Down Expand Up @@ -50,14 +51,7 @@ name = "OpenRouter"
base_url = "https://openrouter.ai/api/v1"
env_key = "OPENROUTER_API_KEY"

[profiles.gpt-oss-20b]
model = "gpt-oss:20b"
model_provider = "ollama"

[profiles.gpt-oss-120b]
model = "openai/gpt-oss-120b"
model_provider = "lmstudio"

[profiles.glm-4-7-flash]
model = "zai-org/glm-4.7-flash"
[profiles.qwen-local]
model = "qwen/qwen3.5-9b"
model_provider = "lmstudio"
model_reasoning_effort = "minimal"
14 changes: 4 additions & 10 deletions config/codex/config.tpl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ suppress_unstable_features_warning = true
web_search = "cached"
model = "__GPT_CODEX__"
model_reasoning_effort = "xhigh"
oss_provider = "lmstudio"

[features]
ghost_commit = false
Expand Down Expand Up @@ -50,14 +51,7 @@ name = "OpenRouter"
base_url = "https://openrouter.ai/api/v1"
env_key = "OPENROUTER_API_KEY"

[profiles.gpt-oss-20b]
model = "gpt-oss:20b"
model_provider = "ollama"

[profiles.gpt-oss-120b]
model = "openai/gpt-oss-120b"
model_provider = "lmstudio"

[profiles.glm-4-7-flash]
model = "zai-org/glm-4.7-flash"
[profiles.qwen-local]
model = "__QWEN_LOCAL__"
model_provider = "lmstudio"
model_reasoning_effort = "minimal"
16 changes: 3 additions & 13 deletions config/opencode/opencode.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,8 @@
"baseURL": "http://127.0.0.1:1234/v1"
},
"models": {
"openai/gpt-oss-20b": {
"name": "OpenAI: gpt-oss-20b"
},
"openai/gpt-oss-120b": {
"name": "OpenAI: gpt-oss-120b"
},
"zai-org/glm-4.7-flash": {
"name": "GLM-4.7 Flash (via LM Studio)"
"qwen/qwen3.5-9b": {
"name": "Qwen 3.5 9B (via LM Studio)"
}
}
},
Expand All @@ -111,11 +105,7 @@
"options": {
"baseURL": "http://localhost:11434/v1"
},
"models": {
"openai/gpt-oss-20b": {
"name": "OpenAI: gpt-oss-20b"
}
}
"models": {}
},
"openai": {
"options": {
Expand Down
16 changes: 3 additions & 13 deletions config/opencode/opencode.tpl.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,8 @@
"baseURL": "http://127.0.0.1:1234/v1"
},
"models": {
"openai/gpt-oss-20b": {
"name": "OpenAI: gpt-oss-20b"
},
"openai/gpt-oss-120b": {
"name": "OpenAI: gpt-oss-120b"
},
"zai-org/glm-4.7-flash": {
"name": "GLM-4.7 Flash (via LM Studio)"
"__QWEN_LOCAL__": {
"name": "Qwen 3.5 9B (via LM Studio)"
}
}
},
Expand All @@ -111,11 +105,7 @@
"options": {
"baseURL": "http://localhost:11434/v1"
},
"models": {
"openai/gpt-oss-20b": {
"name": "OpenAI: gpt-oss-20b"
}
}
"models": {}
},
"openai": {
"options": {
Expand Down
4 changes: 4 additions & 0 deletions home-manager/programs/fish/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@
kyberd = "_kyberd_function";
kyberm = "_kyberm_function";
ocxe = "_ocxe_function";
ocxel = "_ocxel_function";
ocxeh = "_ocxeh_function";
ocxelh = "_ocxelh_function";
pixe = "_pixe_function";
pixeh = "_pixeh_function";
sag = "_ssh_add_github";
Expand Down Expand Up @@ -209,7 +211,9 @@
"_kyberd_function"
"_kyberm_function"
"_ocxe_function"
"_ocxel_function"
"_ocxeh_function"
"_ocxelh_function"
"_pixe_function"
"_pixeh_function"
"_ssh_add_github"
Expand Down
8 changes: 4 additions & 4 deletions home-manager/programs/fish/functions/_coxel_function.fish
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function _coxel_function --description "Run Codex with a free-form prompt using the local glm-4-7-flash model"
# 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...>]

if test (count $argv) -eq 0
codex --profile 'glm-4-7-flash' --full-auto -c model_reasoning_summary_format=experimental
codex --oss --local-provider lmstudio --model 'qwen/qwen3.5-9b' --full-auto -c model_reasoning_effort=minimal
else
set -l prompt (string join " " -- $argv)
codex exec --profile 'glm-4-7-flash' --full-auto -c model_reasoning_summary_format=experimental -- "$prompt"
codex exec --oss --local-provider lmstudio --model 'qwen/qwen3.5-9b' --full-auto -c model_reasoning_effort=minimal -- "$prompt"
end
end
11 changes: 11 additions & 0 deletions home-manager/programs/fish/functions/_coxel_function.tpl.fish
Original file line number Diff line number Diff line change
@@ -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...>]

@cubic-dev-ai cubic-dev-ai Bot Mar 13, 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.

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>
Fix with Cubic


if test (count $argv) -eq 0
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 '__QWEN_LOCAL__' --full-auto -c model_reasoning_effort=minimal -- "$prompt"
end
Comment on lines +5 to +10

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

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

end
6 changes: 3 additions & 3 deletions home-manager/programs/fish/functions/_coxelh_function.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function _coxelh_function --description "Run Codex headlessly with local glm-4-7-flash model"
# Prompt for input and run Codex with local model
function _coxelh_function --description "Run Codex headlessly with the local Qwen model"
# Prompt for input and run Codex with the local Qwen model
# Usage: coxelh

read -P "Prompt: " prompt
Expand All @@ -8,5 +8,5 @@ function _coxelh_function --description "Run Codex headlessly with local glm-4-7
return 1
end

codex exec --profile 'glm-4-7-flash' --full-auto -c model_reasoning_summary_format=experimental -- "$prompt"
codex exec --oss --local-provider lmstudio --model 'qwen/qwen3.5-9b' --full-auto -c model_reasoning_effort=minimal -- "$prompt"
end
12 changes: 12 additions & 0 deletions home-manager/programs/fish/functions/_coxelh_function.tpl.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function _coxelh_function --description "Run Codex headlessly with the local Qwen model"
# Prompt for input and run Codex with the local Qwen model
# Usage: coxelh

read -P "Prompt: " prompt
if test -z "$prompt"
echo "No prompt provided, aborting." >&2
return 1
end

codex exec --oss --local-provider lmstudio --model '__QWEN_LOCAL__' --full-auto -c model_reasoning_effort=minimal -- "$prompt"
end
11 changes: 11 additions & 0 deletions home-manager/programs/fish/functions/_ocxel_function.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function _ocxel_function --description "Run OpenCode with a free-form prompt using the local Qwen model"
# Run OpenCode with a free-form prompt (spaces allowed) using the local Qwen model
# Usage: ocxel [<prompt words...>]

if test (count $argv) -eq 0
opencode -m 'lmstudio/qwen/qwen3.5-9b'
else
set -l prompt (string join " " -- $argv)
opencode run "$prompt" -m 'lmstudio/qwen/qwen3.5-9b'
end
end
11 changes: 11 additions & 0 deletions home-manager/programs/fish/functions/_ocxel_function.tpl.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function _ocxel_function --description "Run OpenCode with a free-form prompt using the local Qwen model"
# Run OpenCode with a free-form prompt (spaces allowed) using the local Qwen model
# Usage: ocxel [<prompt words...>]

if test (count $argv) -eq 0
opencode -m 'lmstudio/__QWEN_LOCAL__'

@cubic-dev-ai cubic-dev-ai Bot Mar 13, 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: 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>
Fix with Cubic

else
set -l prompt (string join " " -- $argv)
opencode run "$prompt" -m 'lmstudio/__QWEN_LOCAL__'
end
end
12 changes: 12 additions & 0 deletions home-manager/programs/fish/functions/_ocxelh_function.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function _ocxelh_function --description "Run OpenCode headlessly with the local Qwen model"
# Prompt for input and run OpenCode with the local Qwen model
# Usage: ocxelh

read -P "Prompt: " prompt
if test -z "$prompt"
echo "No prompt provided, aborting." >&2
return 1
end

opencode run "$prompt" -m 'lmstudio/qwen/qwen3.5-9b'
end
12 changes: 12 additions & 0 deletions home-manager/programs/fish/functions/_ocxelh_function.tpl.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function _ocxelh_function --description "Run OpenCode headlessly with the local Qwen model"
# Prompt for input and run OpenCode with the local Qwen model
# Usage: ocxelh

read -P "Prompt: " prompt
if test -z "$prompt"
echo "No prompt provided, aborting." >&2
return 1
end

opencode run "$prompt" -m 'lmstudio/__QWEN_LOCAL__'
end
3 changes: 2 additions & 1 deletion models.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"gemini-pro": "gemini-3.1-pro-preview",
"gemini-flash": "gemini-3.1-flash-preview",
"glm": "glm-4.7",
"minimax": "minimax-m2.5"
"minimax": "minimax-m2.5",
"qwen-local": "qwen/qwen3.5-9b"
}
4 changes: 4 additions & 0 deletions scripts/llm-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ declare -A TEMPLATES=(
["config/pi/settings.tpl.json"]=config/pi/settings.json
["home-manager/programs/fish/functions/_coxe_function.tpl.fish"]=home-manager/programs/fish/functions/_coxe_function.fish
["home-manager/programs/fish/functions/_coxeh_function.tpl.fish"]=home-manager/programs/fish/functions/_coxeh_function.fish
["home-manager/programs/fish/functions/_coxel_function.tpl.fish"]=home-manager/programs/fish/functions/_coxel_function.fish
["home-manager/programs/fish/functions/_coxelh_function.tpl.fish"]=home-manager/programs/fish/functions/_coxelh_function.fish
["home-manager/programs/fish/functions/_ocxe_function.tpl.fish"]=home-manager/programs/fish/functions/_ocxe_function.fish
["home-manager/programs/fish/functions/_ocxel_function.tpl.fish"]=home-manager/programs/fish/functions/_ocxel_function.fish
["home-manager/programs/fish/functions/_ocxeh_function.tpl.fish"]=home-manager/programs/fish/functions/_ocxeh_function.fish
["home-manager/programs/fish/functions/_ocxelh_function.tpl.fish"]=home-manager/programs/fish/functions/_ocxelh_function.fish
["home-manager/programs/fish/functions/_pixe_function.tpl.fish"]=home-manager/programs/fish/functions/_pixe_function.fish
["home-manager/programs/fish/functions/_pixeh_function.tpl.fish"]=home-manager/programs/fish/functions/_pixeh_function.fish
)
Expand Down
28 changes: 28 additions & 0 deletions spec/fish/_coxel_function.tpl_test.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
set fn (status dirname)/../../home-manager/programs/fish/functions
source $fn/_coxel_function.tpl.fish

# ── no args: interactive mode ─────────────────────────────
set log1 (mktemp)
function codex; echo $argv >> $log1; end

_coxel_function

@test "no args uses QWEN_LOCAL placeholder" (grep -c "__QWEN_LOCAL__" $log1) -ge 1
@test "no args enables oss mode" (grep -c -- "--oss" $log1) -ge 1
@test "no args uses lmstudio local provider" (grep -c -- "local-provider lmstudio" $log1) -ge 1
@test "no args lowers reasoning effort" (grep -c "model_reasoning_effort=minimal" $log1) -ge 1

# ── with args: exec mode ──────────────────────────────────
set log2 (mktemp)
function codex; echo $argv >> $log2; end

_coxel_function hello world

@test "with args uses exec subcommand" (grep -c "^exec " $log2) -ge 1
@test "with args builds prompt" (grep -c "hello world" $log2) -ge 1
@test "with args uses QWEN_LOCAL placeholder" (grep -c "__QWEN_LOCAL__" $log2) -ge 1
@test "with args enables oss mode" (grep -c -- "--oss" $log2) -ge 1
@test "with args uses lmstudio local provider" (grep -c -- "local-provider lmstudio" $log2) -ge 1
@test "with args lowers reasoning effort" (grep -c "model_reasoning_effort=minimal" $log2) -ge 1

rm -f $log1 $log2
9 changes: 8 additions & 1 deletion spec/fish/_coxel_function_test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ function codex; echo $argv >> $log1; end

_coxel_function

@test "no args calls codex with local profile" (grep -c "glm-4-7-flash" $log1) -ge 1
@test "no args uses substituted Qwen model" (grep -c "qwen/qwen3.5-9b" $log1) -ge 1
@test "no args enables oss mode" (grep -c -- "--oss" $log1) -ge 1
@test "no args uses lmstudio local provider" (grep -c -- "local-provider lmstudio" $log1) -ge 1
@test "no args lowers reasoning effort" (grep -c "model_reasoning_effort=minimal" $log1) -ge 1

# ── with args: exec mode ──────────────────────────────────
set log2 (mktemp)
Expand All @@ -17,5 +20,9 @@ _coxel_function hello world

@test "with args uses exec subcommand" (grep -c "^exec " $log2) -ge 1
@test "with args builds prompt" (grep -c "hello world" $log2) -ge 1
@test "with args uses substituted Qwen model" (grep -c "qwen/qwen3.5-9b" $log2) -ge 1
@test "with args enables oss mode" (grep -c -- "--oss" $log2) -ge 1
@test "with args uses lmstudio local provider" (grep -c -- "local-provider lmstudio" $log2) -ge 1
@test "with args lowers reasoning effort" (grep -c "model_reasoning_effort=minimal" $log2) -ge 1

rm -f $log1 $log2
19 changes: 19 additions & 0 deletions spec/fish/_coxelh_function.tpl_test.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
set fn (status dirname)/../../home-manager/programs/fish/functions
source $fn/_coxelh_function.tpl.fish

@test "empty prompt rejects" (echo "" | _coxelh_function 2>&1) = "No prompt provided, aborting."
@test "empty prompt returns 1" (echo "" | _coxelh_function 2>/dev/null; echo $status) = 1

set log1 (mktemp)
function codex; echo $argv >> $log1; end

echo "hello world" | _coxelh_function

@test "non-empty prompt uses exec subcommand" (grep -c "^exec " $log1) -ge 1
@test "non-empty prompt uses QWEN_LOCAL placeholder" (grep -c "__QWEN_LOCAL__" $log1) -ge 1
@test "non-empty prompt enables oss mode" (grep -c -- "--oss" $log1) -ge 1
@test "non-empty prompt uses lmstudio local provider" (grep -c -- "local-provider lmstudio" $log1) -ge 1
@test "non-empty prompt lowers reasoning effort" (grep -c "model_reasoning_effort=minimal" $log1) -ge 1
@test "non-empty prompt forwards prompt" (grep -c "hello world" $log1) -ge 1

rm -f $log1
14 changes: 14 additions & 0 deletions spec/fish/_coxelh_function_test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,17 @@ source $fn/_coxelh_function.fish

@test "empty prompt rejects" (echo "" | _coxelh_function 2>&1) = "No prompt provided, aborting."
@test "empty prompt returns 1" (echo "" | _coxelh_function 2>/dev/null; echo $status) = 1

set log1 (mktemp)
function codex; echo $argv >> $log1; end

echo "hello world" | _coxelh_function

@test "non-empty prompt uses exec subcommand" (grep -c "^exec " $log1) -ge 1
@test "non-empty prompt uses substituted Qwen model" (grep -c "qwen/qwen3.5-9b" $log1) -ge 1
@test "non-empty prompt enables oss mode" (grep -c -- "--oss" $log1) -ge 1
@test "non-empty prompt uses lmstudio local provider" (grep -c -- "local-provider lmstudio" $log1) -ge 1
@test "non-empty prompt lowers reasoning effort" (grep -c "model_reasoning_effort=minimal" $log1) -ge 1
@test "non-empty prompt forwards prompt" (grep -c "hello world" $log1) -ge 1

rm -f $log1
23 changes: 23 additions & 0 deletions spec/fish/_ocxel_function.tpl_test.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
set fn (status dirname)/../../home-manager/programs/fish/functions
source $fn/_ocxel_function.tpl.fish

# ── no args: interactive mode ─────────────────────────────
set log1 (mktemp)
function opencode; echo $argv >> $log1; end

_ocxel_function

@test "no args calls opencode with templated local Qwen model" (grep -c "lmstudio/__QWEN_LOCAL__" $log1) -ge 1
@test "no args skips run subcommand" (grep -c "^run " $log1) -eq 0

# ── with args: run mode ──────────────────────────────────
set log2 (mktemp)
function opencode; echo $argv >> $log2; end

_ocxel_function hello world

@test "with args uses run subcommand" (grep -c "^run " $log2) -ge 1
@test "with args builds prompt" (grep -c "hello world" $log2) -ge 1
@test "with args uses templated local Qwen model" (grep -c "lmstudio/__QWEN_LOCAL__" $log2) -ge 1

rm -f $log1 $log2
23 changes: 23 additions & 0 deletions spec/fish/_ocxel_function_test.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
set fn (status dirname)/../../home-manager/programs/fish/functions
source $fn/_ocxel_function.fish

# ── no args: interactive mode ─────────────────────────────
set log1 (mktemp)
function opencode; echo $argv >> $log1; end

_ocxel_function

@test "no args calls opencode with local Qwen model" (grep -c "lmstudio/qwen/qwen3.5-9b" $log1) -ge 1
@test "no args skips run subcommand" (grep -c "^run " $log1) -eq 0

# ── with args: run mode ──────────────────────────────────
set log2 (mktemp)
function opencode; echo $argv >> $log2; end

_ocxel_function hello world

@test "with args uses run subcommand" (grep -c "^run " $log2) -ge 1
@test "with args builds prompt" (grep -c "hello world" $log2) -ge 1
@test "with args uses local Qwen model" (grep -c "lmstudio/qwen/qwen3.5-9b" $log2) -ge 1

rm -f $log1 $log2
Loading
Loading