Skip to content

chore: expand llm-update template coverage - #1077

Merged
shunkakinoki merged 1 commit into
mainfrom
chore/track-llm-upgrade-templates
Mar 13, 2026
Merged

chore: expand llm-update template coverage#1077
shunkakinoki merged 1 commit into
mainfrom
chore/track-llm-upgrade-templates

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Mar 13, 2026

Copy link
Copy Markdown
Owner
  • add templated sources for aichat, pi settings, llm defaults, and fish wrappers
  • extend llm-update mappings and coverage checks for the new templates
  • add fish template tests and keep Claude settings out of llm-update tracking

Entire-Checkpoint: 3782180a0e72


Summary by cubic

Expands llm-update coverage to include aichat config, Pi settings, LLM default model, and fish wrapper templates so model upgrades stay in sync across tools. Adds tests to guard mappings and wrapper behavior.

  • New Features
    • Added templates: aichat config, Pi settings, LLM default model, fish wrappers (_ocxe, _ocxeh, _pixe, _pixeh).
    • Mapped new templates in scripts/llm-update.sh.
    • Added fish tests for interactive/headless flows and templated model/preset usage.
    • Added mapping coverage checks in spec/llm_update_spec.sh.
    • Excluded Claude settings from llm-update tracking.

Written for commit 5a1508e. Summary will update on new commits.

- add templated sources for aichat, pi settings, llm defaults, and fish wrappers
- extend llm-update mappings and coverage checks for the new templates
- add fish template tests and keep Claude settings out of llm-update tracking

Entire-Checkpoint: 3782180a0e72
Copilot AI review requested due to automatic review settings March 13, 2026 16:38
@mesa-dot-dev

mesa-dot-dev Bot commented Mar 13, 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 Mar 13, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: be9d22eb-f3eb-4851-8a36-0d0f32edfeec

📥 Commits

Reviewing files that changed from the base of the PR and between f2cfbdc and 5a1508e.

📒 Files selected for processing (17)
  • config/aichat/config.tpl.yaml
  • config/llm/default_model.tpl.txt
  • config/pi/settings.tpl.json
  • home-manager/programs/fish/functions/_ocxe_function.fish
  • home-manager/programs/fish/functions/_ocxe_function.tpl.fish
  • home-manager/programs/fish/functions/_ocxeh_function.fish
  • home-manager/programs/fish/functions/_ocxeh_function.tpl.fish
  • home-manager/programs/fish/functions/_pixe_function.fish
  • home-manager/programs/fish/functions/_pixe_function.tpl.fish
  • home-manager/programs/fish/functions/_pixeh_function.fish
  • home-manager/programs/fish/functions/_pixeh_function.tpl.fish
  • scripts/llm-update.sh
  • spec/fish/_ocxe_function.tpl_test.fish
  • spec/fish/_ocxeh_function.tpl_test.fish
  • spec/fish/_pixe_function.tpl_test.fish
  • spec/fish/_pixeh_function.tpl_test.fish
  • spec/llm_update_spec.sh

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added shell command functions for AI code generation tool supporting free-form prompts in interactive and headless modes
    • Added shell command functions for AI agent with free-form prompts in interactive and headless modes
    • New configuration templates for AI chat and agent services
  • Tests

    • Added test coverage for new shell commands
  • Chores

    • Updated build script to handle new template file processing

Walkthrough

This PR introduces configuration and shell function templates for AI model integration (including AIChat and Pi), updates existing shell function descriptions to remove model-specific references, extends the llm-update build script with new template mappings, and adds corresponding test coverage.

Changes

Cohort / File(s) Summary
Configuration Templates
config/aichat/config.tpl.yaml, config/llm/default_model.tpl.txt, config/pi/settings.tpl.json
New YAML, text, and JSON template files defining default configuration for AI chat client, LLM model placeholder, and Pi assistant runtime settings with feature toggles, provider configuration, and retry policies.
Fish Function Templates
home-manager/programs/fish/functions/_ocxe_function.tpl.fish, home-manager/programs/fish/functions/_ocxeh_function.tpl.fish, home-manager/programs/fish/functions/_pixe_function.tpl.fish, home-manager/programs/fish/functions/_pixeh_function.tpl.fish
New Fish shell function templates for OpenCode and Pi agent with free-form and headless prompt modes, supporting template placeholder substitution for model references.
Fish Function Description Updates
home-manager/programs/fish/functions/_ocxe_function.fish, home-manager/programs/fish/functions/_ocxeh_function.fish, home-manager/programs/fish/functions/_pixe_function.fish, home-manager/programs/fish/functions/_pixeh_function.fish
Updated function descriptions to remove model-specific references (GLM-4.7, OpenRouter) and replace with generic prompt input descriptions.
Build Script & Mappings
scripts/llm-update.sh
Added seven new template-to-output mappings for configuration files and Fish functions to enable template processing and placeholder substitution.
Test Coverage
spec/fish/_ocxe_function.tpl_test.fish, spec/fish/_ocxeh_function.tpl_test.fish, spec/fish/_pixe_function.tpl_test.fish, spec/fish/_pixeh_function.tpl_test.fish, spec/llm_update_spec.sh
New test files verifying Fish function template behavior, prompt validation, and llm-update script template mapping coverage.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

🐰 Hops through config lands so bright,
Templates shimmer, models take flight,
Fish functions swim with prompts so free,
Placeholders dance in harmony!
Update scripts weave the magic thread,

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/track-llm-upgrade-templates
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 significantly expands the templating capabilities of the llm-update script. It introduces new template files for aichat and pi configurations, as well as a default LLM model, ensuring consistent model definitions across various tools. Additionally, it provides templated Fish shell functions for opencode and pi-agent, streamlining their integration with the LLM system. The changes also include necessary updates to the llm-update.sh script and new tests to validate the expanded coverage and functionality.

Highlights

  • New Template Files: Added new template files for aichat configuration, pi settings, and a global default LLM model to standardize configurations.
  • Templated Fish Functions: Introduced templated Fish shell functions for opencode and pi-agent to ensure consistent LLM model usage across these tools.
  • LLM Update Script Expansion: Updated the llm-update.sh script to recognize and process these newly added template files, expanding its coverage.
  • New Test Coverage: Included new shell tests to verify the functionality of the templated Fish functions and to confirm the llm-update script's expanded coverage.
Changelog
  • config/aichat/config.tpl.yaml
    • Added a new template for aichat configuration, setting cliproxy as the client and __GLM__ as the default model.
  • config/llm/default_model.tpl.txt
    • Added a template file to define the default LLM model as __GLM__.
  • config/pi/settings.tpl.json
    • Added a new template for pi agent settings, configuring cli-proxy-api as the default provider and __GLM__ as the default model, along with enabled models.
  • home-manager/programs/fish/functions/_ocxe_function.fish
    • Modified the function description to be more general, removing specific model mentions.
  • home-manager/programs/fish/functions/_ocxe_function.tpl.fish
    • Added a new templated Fish function for opencode to use cliproxyapi/__GLM__ for interactive and prompted runs.
  • home-manager/programs/fish/functions/_ocxeh_function.fish
    • Modified the function description to be more general, removing specific model mentions.
  • home-manager/programs/fish/functions/_ocxeh_function.tpl.fish
    • Added a new templated Fish function for headless opencode to use cliproxyapi/__GLM__ with prompted input.
  • home-manager/programs/fish/functions/_pixe_function.fish
    • Modified the function description to be more general, removing specific model mentions.
  • home-manager/programs/fish/functions/_pixe_function.tpl.fish
    • Added a new templated Fish function for pi-agent to use openrouter-preset/@preset/__GLM_NONDOT__ for interactive and prompted runs.
  • home-manager/programs/fish/functions/_pixeh_function.fish
    • Modified the function description to be more general, removing specific model mentions.
  • home-manager/programs/fish/functions/_pixeh_function.tpl.fish
    • Added a new templated Fish function for headless pi-agent to use openrouter-preset/@preset/__GLM_NONDOT__ with prompted input.
  • scripts/llm-update.sh
    • Updated the TEMPLATES array to include the newly added aichat, llm/default_model, pi/settings, and Fish wrapper templates.
  • spec/fish/_ocxe_function.tpl_test.fish
    • Added shell tests to verify the behavior of _ocxe_function.tpl.fish for both interactive and prompted modes.
  • spec/fish/_ocxeh_function.tpl_test.fish
    • Added shell tests to verify the error handling of _ocxeh_function.tpl.fish for empty prompts.
  • spec/fish/_pixe_function.tpl_test.fish
    • Added shell tests to verify the behavior of _pixe_function.tpl.fish for both interactive and prompted modes.
  • spec/fish/_pixeh_function.tpl_test.fish
    • Added shell tests to verify the error handling of _pixeh_function.tpl.fish for empty prompts.
  • spec/llm_update_spec.sh
    • Added new test cases to confirm that llm-update.sh correctly includes the new aichat, pi settings, llm default model, and Fish wrapper templates in its mappings.
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mesa-dot-dev

mesa-dot-dev Bot commented Mar 13, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Expanded llm-update template coverage to include templated sources for aichat, pi settings, llm defaults, and fish wrappers.

What changed?

  • Added templated sources for aichat, pi settings, llm defaults, and fish wrappers
  • Extended llm-update mappings and coverage checks for the new templates
  • Added fish template tests and excluded Claude settings from llm-update tracking

Description generated by Mesa. Update settings

@shunkakinoki
shunkakinoki merged commit c049428 into main Mar 13, 2026
27 of 28 checks passed
@shunkakinoki
shunkakinoki deleted the chore/track-llm-upgrade-templates branch March 13, 2026 16:39

@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 expands the llm-update templating system to cover more configuration files, including for aichat, pi, and several fish wrapper functions. The changes are logical and the introduction of new templates is a good step towards centralizing model configuration. The new templates and updates to the llm-update.sh script are correct. I've noticed a few areas for improvement in the newly added tests to enhance their robustness and correctness, which are detailed in my comments.

Comment thread spec/llm_update_spec.sh
Comment on lines +64 to +68
It 'includes fish wrapper templates in template mappings'
When run bash -c "grep '_ocxe_function.tpl.fish' '$SCRIPT' && grep '_pixe_function.tpl.fish' '$SCRIPT'"
The output should include '_ocxe_function.tpl.fish'
The output should include '_pixe_function.tpl.fish'
End

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

This test for fish wrapper templates is incomplete as it misses _ocxeh_function.tpl.fish and _pixeh_function.tpl.fish. Also, the test pattern of chaining grep with && is flawed because only the output of the last command is checked. A simpler and more correct approach is to cat the script and check for the presence of all required strings in its output.

Here is a suggested refactoring:

It 'includes fish wrapper templates in template mappings'
  When run cat "$SCRIPT"
  The output should include '_ocxe_function.tpl.fish'
  The output should include '_ocxeh_function.tpl.fish'
  The output should include '_pixe_function.tpl.fish'
  The output should include '_pixeh_function.tpl.fish'
End

Comment on lines +4 to +22
# ── no args: interactive mode ─────────────────────────────
set log1 (mktemp)
function opencode; echo $argv >> $log1; end

_ocxe_function

@test "no args calls opencode with templated model" (grep -c "cliproxyapi/__GLM__" $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

_ocxe_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

rm -f $log1 $log2

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

To improve test robustness and maintainability, it's better to avoid redefining the mock function (opencode). You can define it once and then reset the state (the log file) between test groups. This makes the test easier to read and less prone to errors if tests are reordered or added.

Here is a suggested refactoring:

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

_ocxe_function

@test "no args calls opencode with templated model" (grep -c "cliproxyapi/__GLM__" $log) -ge 1
@test "no args skips run subcommand" (grep -c "^run " $log) -eq 0

# ── with args: run mode ──────────────────────────────────
> $log # Reset log
_ocxe_function hello world

@test "with args uses run subcommand" (grep -c "^run " $log) -ge 1
@test "with args builds prompt" (grep -c "hello world" $log) -ge 1

rm -f $log

Comment on lines +4 to +20
# ── no args: interactive mode ─────────────────────────────
set log1 (mktemp)
function pi-agent; echo $argv >> $log1; end

_pixe_function

@test "no args calls pi-agent with templated preset" (grep -c "openrouter-preset/@preset/__GLM_NONDOT__" $log1) -ge 1

# ── with args: builds prompt ──────────────────────────────
set log2 (mktemp)
function pi-agent; echo $argv >> $log2; end

_pixe_function hello world

@test "with args builds prompt" (grep -c "hello world" $log2) -ge 1

rm -f $log1 $log2

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

Similar to the other new test file, you can improve robustness by defining the mock function (pi-agent) once and resetting the log file between test groups. This avoids function redefinition and makes the test cleaner.

Here is a suggested refactoring:

# ── no args: interactive mode ─────────────────────────────
set log (mktemp)
function pi-agent; echo $argv >> $log; end

_pixe_function

@test "no args calls pi-agent with templated preset" (grep -c "openrouter-preset/@preset/__GLM_NONDOT__" $log) -ge 1

# ── with args: builds prompt ──────────────────────────────
> $log # Reset log
_pixe_function hello world

@test "with args builds prompt" (grep -c "hello world" $log) -ge 1

rm -f $log

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

Expands scripts/llm-update.sh template coverage so more tool and shell configs can be generated from models.json, with accompanying spec coverage and new fishtape tests for the fish template wrappers.

Changes:

  • Added new template→output mappings for aichat config, Pi settings, and llm default model text.
  • Introduced templated fish wrapper sources for ocxe/ocxeh and pixe/pixeh, aligning generated .fish wrappers with the templates.
  • Added fishtape tests for the new fish template wrappers and extended the ShellSpec mapping-coverage checks.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
spec/llm_update_spec.sh Adds mapping-coverage assertions for new templates in llm-update.sh.
scripts/llm-update.sh Extends the TEMPLATES map to include aichat, Pi settings, llm default model, and additional fish wrapper templates.
config/aichat/config.tpl.yaml New aichat config template parameterized by __GLM__.
config/pi/settings.tpl.json New Pi settings template parameterized by __GLM__.
config/llm/default_model.tpl.txt New single-value default model template (__GLM__).
home-manager/programs/fish/functions/_ocxe_function.tpl.fish New templated ocxe fish wrapper using __GLM__.
home-manager/programs/fish/functions/_ocxeh_function.tpl.fish New templated ocxeh fish wrapper using __GLM__.
home-manager/programs/fish/functions/_pixe_function.tpl.fish New templated pixe fish wrapper using __GLM_NONDOT__.
home-manager/programs/fish/functions/_pixeh_function.tpl.fish New templated pixeh fish wrapper using __GLM_NONDOT__.
home-manager/programs/fish/functions/_ocxe_function.fish Updates description/comment text to match the templated wrapper intent.
home-manager/programs/fish/functions/_ocxeh_function.fish Updates description text to match the templated wrapper intent.
home-manager/programs/fish/functions/_pixe_function.fish Updates description/comment text to match the templated wrapper intent.
home-manager/programs/fish/functions/_pixeh_function.fish Updates description text to match the templated wrapper intent.
spec/fish/_ocxe_function.tpl_test.fish New fishtape tests validating templated ocxe wrapper behavior.
spec/fish/_ocxeh_function.tpl_test.fish New fishtape tests validating templated ocxeh wrapper behavior.
spec/fish/_pixe_function.tpl_test.fish New fishtape tests validating templated pixe wrapper behavior.
spec/fish/_pixeh_function.tpl_test.fish New fishtape tests validating templated pixeh wrapper behavior.

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

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

2 issues found across 17 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="spec/llm_update_spec.sh">

<violation number="1" location="spec/llm_update_spec.sh:50">
P2: This only checks that the template path appears somewhere in the script, not that the `TEMPLATES` entry maps it to the correct output file.</violation>
</file>

<file name="home-manager/programs/fish/functions/_pixeh_function.tpl.fish">

<violation number="1" location="home-manager/programs/fish/functions/_pixeh_function.tpl.fish:11">
P2: This wrapper never enables Pi's non-interactive mode, so `pixeh` will launch the interactive UI instead of returning a headless response.</violation>
</file>

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

Comment thread spec/llm_update_spec.sh

Describe 'mapping coverage'
It 'includes aichat config in template mappings'
When run bash -c "grep 'config/aichat/config.tpl.yaml' '$SCRIPT'"

@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 only checks that the template path appears somewhere in the script, not that the TEMPLATES entry maps it to the correct output file.

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

<comment>This only checks that the template path appears somewhere in the script, not that the `TEMPLATES` entry maps it to the correct output file.</comment>

<file context>
@@ -45,6 +45,29 @@ The output should include '.tpl.'
 
+Describe 'mapping coverage'
+It 'includes aichat config in template mappings'
+When run bash -c "grep 'config/aichat/config.tpl.yaml' '$SCRIPT'"
+The output should include 'config/aichat/config.tpl.yaml'
+End
</file context>
Fix with Cubic

return 1
end

pi-agent "$prompt" -m 'openrouter-preset/@preset/__GLM_NONDOT__'

@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 never enables Pi's non-interactive mode, so pixeh will launch the interactive UI instead of returning a headless response.

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/_pixeh_function.tpl.fish, line 11:

<comment>This wrapper never enables Pi's non-interactive mode, so `pixeh` will launch the interactive UI instead of returning a headless response.</comment>

<file context>
@@ -0,0 +1,12 @@
+    return 1
+  end
+
+  pi-agent "$prompt" -m 'openrouter-preset/@preset/__GLM_NONDOT__'
+end
</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