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
4 changes: 2 additions & 2 deletions spec/fish/_coxel_function_test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function codex; echo $argv >> $log1; end

_coxel_function

@test "no args uses substituted Qwen model" (grep -c "qwen/qwen3.5-9b" $log1) -ge 1
@test "no args uses substituted Qwen model" (grep -c "qwen3.5-0.8b-optiq" $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
Expand All @@ -20,7 +20,7 @@ _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 uses substituted Qwen model" (grep -c "qwen3.5-0.8b-optiq" $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
Expand Down
2 changes: 1 addition & 1 deletion spec/fish/_coxelh_function_test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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 uses substituted Qwen model" (grep -c "qwen3.5-0.8b-optiq" $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
Expand Down
4 changes: 2 additions & 2 deletions spec/fish/_ocxel_function_test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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 calls opencode with local Qwen model" (grep -c "lmstudio/qwen3.5-0.8b-optiq" $log1) -ge 1
@test "no args skips run subcommand" (grep -c "^run " $log1) -eq 0

# ── with args: run mode ──────────────────────────────────
Expand All @@ -18,6 +18,6 @@ _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
@test "with args uses local Qwen model" (grep -c "lmstudio/qwen3.5-0.8b-optiq" $log2) -ge 1

rm -f $log1 $log2
2 changes: 1 addition & 1 deletion spec/fish/_ocxelh_function_test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo "hello world" | _ocxelh_function

@test "non-empty prompt uses run subcommand" (grep -c "^run " $log1) -ge 1
@test "non-empty prompt builds prompt" (grep -c "hello world" $log1) -ge 1
@test "non-empty prompt uses local Qwen model" (grep -c "lmstudio/qwen/qwen3.5-9b" $log1) -ge 1
@test "non-empty prompt uses local Qwen model" (grep -c "lmstudio/qwen3.5-0.8b-optiq" $log1) -ge 1

set log2 (mktemp)
function opencode; echo $argv >> $log2; end
Expand Down
4 changes: 2 additions & 2 deletions spec/fish/_pixel_function_test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function pi; echo $argv >> $log1; end

_pixel_function

@test "no args calls pi with local Qwen model" (grep -c "lmstudio/qwen/qwen3.5-9b" $log1) -ge 1
@test "no args calls pi with local Qwen model" (grep -c "lmstudio/qwen3.5-0.8b-optiq" $log1) -ge 1

@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.

P3: Use literal matching for the model-name assertion. With regex grep, dots in qwen3.5-0.8b-optiq are wildcards, so the test can pass without an exact model string match.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At spec/fish/_pixel_function_test.fish, line 10:

<comment>Use literal matching for the model-name assertion. With regex `grep`, dots in `qwen3.5-0.8b-optiq` are wildcards, so the test can pass without an exact model string match.</comment>

<file context>
@@ -7,7 +7,7 @@ function pi; echo $argv >> $log1; end
 _pixel_function
 
-@test "no args calls pi with local Qwen model" (grep -c "lmstudio/qwen/qwen3.5-9b" $log1) -ge 1
+@test "no args calls pi with local Qwen model" (grep -c "lmstudio/qwen3.5-0.8b-optiq" $log1) -ge 1
 
 # ── with args: builds prompt ──────────────────────────────
</file context>
Suggested change
@test "no args calls pi with local Qwen model" (grep -c "lmstudio/qwen3.5-0.8b-optiq" $log1) -ge 1
@test "no args calls pi with local Qwen model" (grep -F -c "lmstudio/qwen3.5-0.8b-optiq" $log1) -ge 1
Fix with Cubic

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.

grep patterns are regex by default, so the . characters in qwen3.5-0.8b-optiq match any character. Since these assertions are intended to match an exact model string, use fixed-string matching (e.g., grep -F) or escape the dots to avoid accidental matches and make the tests more robust.

Copilot uses AI. Check for mistakes.

# ── with args: builds prompt ──────────────────────────────
set log2 (mktemp)
Expand All @@ -16,6 +16,6 @@ function pi; echo $argv >> $log2; end
_pixel_function hello world

@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
@test "with args uses local Qwen model" (grep -c "lmstudio/qwen3.5-0.8b-optiq" $log2) -ge 1

rm -f $log1 $log2
2 changes: 1 addition & 1 deletion spec/fish/_pixelh_function_test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function pi; echo $argv >> $log1; end
echo "hello world" | _pixelh_function

@test "non-empty prompt builds prompt" (grep -c "hello world" $log1) -ge 1
@test "non-empty prompt uses local Qwen model" (grep -c "lmstudio/qwen/qwen3.5-9b" $log1) -ge 1
@test "non-empty prompt uses local Qwen model" (grep -c "lmstudio/qwen3.5-0.8b-optiq" $log1) -ge 1

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.

The expected model name literal is duplicated across multiple fish spec files in this PR. To reduce churn the next time the model name changes, consider centralizing it (e.g., a shared test helper / common variable sourced by these specs, or at least a local set expected_model ... at the top of each file) and referencing that in the assertions.

Copilot uses AI. Check for mistakes.
@test "non-empty prompt uses print mode" (grep -c -- "-p" $log1) -ge 1

set log2 (mktemp)
Expand Down
Loading