Skip to content

feat(models): add GLM-4.7 model support via OpenRouter - #580

Merged
shunkakinoki merged 6 commits into
mainfrom
openpreset-4-7
Jan 15, 2026
Merged

feat(models): add GLM-4.7 model support via OpenRouter#580
shunkakinoki merged 6 commits into
mainfrom
openpreset-4-7

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Jan 15, 2026

Copy link
Copy Markdown
Owner

Changes

  • Added GLM-4.7 model configuration via OpenRouter preset
  • Updated model ID from z-ai/glm-4.7 to z-ai/glm-4-7
  • Set API endpoint to openai-completions
  • Increased context window to 131,072 tokens
  • Added pixe and pixeh fish shortcuts for quick GLM-4.7 access

Technical Details

  • Uses OpenRouter's preset system for model routing
  • Free API usage for the preset model
  • Convenience functions for running Pi agent with GLM-4.7

Testing

  • Configuration builds successfully
  • Fish functions registered properly

Generated with Claude Code by Claude 3.5 Sonnet


Summary by cubic

Add GLM-4.7 support via an OpenRouter preset and new fish shortcuts to run Pi agent with this model. Uses the openai-completions endpoint and increases the context window for longer prompts.

  • New Features

    • OpenRouter preset for GLM-4.7: @preset/glm-4-7 with a 131,072-token context window.
    • pixe and pixeh fish functions to run Pi agent with the preset (pixeh prompts headlessly).
  • Refactors

    • Updated model ID to z-ai/glm-4-7.
    • Set API to openai-completions.

Written for commit be5391e. Summary will update on new commits.

Copilot AI review requested due to automatic review settings January 15, 2026 20:23
@shunkakinoki
shunkakinoki enabled auto-merge (squash) January 15, 2026 20:23
@coderabbitai

coderabbitai Bot commented Jan 15, 2026

Copy link
Copy Markdown

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added pixe and pixeh command shortcuts for direct and interactive AI prompts from the shell.
    • Added an openrouter-preset provider to expand available model routing options.
    • Normalized GLM-4.7 model identifiers and display names for consistent configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Renames an existing GLM-4.7 model ID, adds a new OpenRouter preset provider+model in config/pi/models.json, and adds two Fish shell abbreviations/functions (pixe, pixeh) that invoke pi-agent with the new preset model.

Changes

Cohort / File(s) Summary
Model configuration
config/pi/models.json
Renamed model id z-ai/glm-4.7z-ai/glm-4-7 and display name change. Added new provider openrouter-preset with model @preset/glm-4-7 (reasoning:false, input:["text"], cost:0, contextWindow:131072, maxTokens:16384).
Fish shell config
home-manager/programs/fish/default.nix
Added shell abbreviations pixe_pixe_function and pixeh_pixeh_function; exported the new functions in the functions list.
Pi agent shortcut functions
home-manager/programs/fish/functions/_pixe_function.fish, home-manager/programs/fish/functions/_pixeh_function.fish
Added _pixe_function (runs pi-agent -m 'openrouter-preset/@preset/glm-4-7', accepts optional prompt args) and _pixeh_function (prompts user for input, validates non-empty, then runs the same pi-agent command).

Sequence Diagram(s)

sequenceDiagram
  participant User as User (shell)
  participant Fish as Fish abbrev (pixe/pixeh)
  participant Pi as pi-agent
  participant Config as models.json (provider)
  participant Provider as OpenRouter API

  rect rgba(200,230,255,0.5)
    User->>Fish: invoke `pixe [args]` or `pixeh`
    Fish->>Fish: assemble prompt (args or read input)
    Fish->>Pi: run pi-agent "<prompt>" -m 'openrouter-preset/@preset/glm-4-7'
  end

  rect rgba(220,255,200,0.5)
    Pi->>Config: resolve model id `openrouter-preset/@preset/glm-4-7`
    Pi->>Provider: send request to OpenRouter (apiKey/baseUrl)
    Provider-->>Pi: model response
    Pi-->>User: output result
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A preset path, so swift and neat,
pixe and pixeh make prompts complete,
GLM-4-7 hops into the light,
OpenRouter hums through day and night,
Shell shortcuts sparkle — quick and sweet.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding GLM-4.7 model support via OpenRouter. It is concise, clear, and directly related to the primary objective of the changeset.
Description check ✅ Passed The description is directly related to the changeset, providing relevant details about the changes including the new OpenRouter preset, updated model ID, API endpoint, context window, and fish shortcuts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch openpreset-4-7


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 527e8b3 and be5391e.

📒 Files selected for processing (1)
  • home-manager/programs/fish/default.nix
🧰 Additional context used
📓 Path-based instructions (6)
**/*.nix

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.nix: Use nixfmt for formatting all Nix files
Document complex configurations with comments in Nix files

**/*.nix: Use 2 spaces for indentation in Nix files
Keep line length under 100 characters in Nix files
Sort attribute sets alphabetically in Nix files
Use consistent spacing around operators in Nix files
Format lists and sets consistently in Nix files

Use treefmt.toml for formatting Nix files

**/*.nix: Use mkOption for configurable options in Nix modules
Implement proper typing for all options in Nix modules
Follow the Nix expression language style guide

Files:

  • home-manager/programs/fish/default.nix
**/default.nix

📄 CodeRabbit inference engine (CLAUDE.md)

Use default.nix files for module exports

Files:

  • home-manager/programs/fish/default.nix
home-manager/programs/*/default.nix

📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)

Program configurations should be located in home-manager/programs/<name>/ and use home-manager's built-in modules when available

Files:

  • home-manager/programs/fish/default.nix
home-manager/programs/**/default.nix

📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)

Program configurations must include all necessary dependencies in their configuration

Files:

  • home-manager/programs/fish/default.nix
home-manager/**/*.nix

📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)

home-manager/**/*.nix: Use typed options whenever possible in Nix configurations
Document all configuration options in Nix modules and programs
Follow home-manager's module structure and keep configurations modular
Use proper indentation and formatting in Nix configuration files

Files:

  • home-manager/programs/fish/default.nix
home-manager/programs/**/*.nix

📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)

Follow program-specific best practices in program configuration files

Program configurations in home-manager/programs/ should be organized by program name, include all necessary dependencies, use home.packages for package installations, and use programs.<name> when available in home-manager

Files:

  • home-manager/programs/fish/default.nix
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: lua-hammerspoon
  • GitHub Check: lua-neovim-test
  • GitHub Check: lua-neovim
  • GitHub Check: shell-lint
  • GitHub Check: shell-test
  • GitHub Check: e2e-run (MacOS, macos-latest)
  • GitHub Check: e2e-run (NixOS, ubuntu-latest)
  • GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
  • GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
  • GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
  • GitHub Check: nix-nixos
  • GitHub Check: nix-darwin
  • GitHub Check: nix-linux
  • GitHub Check: cubic · AI code reviewer
🔇 Additional comments (2)
home-manager/programs/fish/default.nix (2)

91-92: LGTM!

The abbreviations follow the established naming pattern (base + h suffix for headless variant) and are correctly positioned alphabetically within shellAbbrs.


154-155: Verify the function files exist.

The function file mappings are correctly added and the naming has been fixed from the previous typo. Both _pixe_function.fish and _pixeh_function.fish exist in home-manager/programs/fish/functions/ and contain proper implementations that invoke pi-agent with the GLM-4.7 preset.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • GLM-4: Entity not found: Issue - Could not find referenced Issue.

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 @shunkakinoki, 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 integrates the GLM-4.7 model into the system via an OpenRouter preset, significantly enhancing the range of available AI capabilities. It includes the necessary configuration for the new model, featuring a substantial context window, and provides convenient shell shortcuts for users to easily interact with it. The changes aim to broaden model options and improve user experience by simplifying access to advanced AI functionalities.

Highlights

  • New Model Support: Added support for the GLM-4.7 model through an OpenRouter preset, expanding the available AI models.
  • Model ID Correction: Corrected the model ID for GLM-4.7 from 'z-ai/glm-4.7' to 'z-ai/glm-4-7' in the existing configuration.
  • OpenRouter Configuration: Configured the OpenRouter preset to use the 'openai-completions' API endpoint, enabling access to GLM-4.7 via OpenRouter.
  • Increased Context Window: Set the context window for the OpenRouter GLM-4.7 model to 131,072 tokens, allowing for much longer interactions and processing of extensive inputs.
  • Free API Usage: The OpenRouter preset for GLM-4.7 is configured for free API usage, with all cost metrics (input, output, cacheRead, cacheWrite) set to zero.
  • Fish Shell Shortcuts: Introduced pixe and pixeh fish shell shortcuts to quickly run the Pi agent with the GLM-4.7 model, streamlining user interaction.
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 Jan 15, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Added GLM-4.7 model support via an OpenRouter preset, including an increased context window, and introduced pixe and pixeh fish shortcuts to integrate with the Pi agent for quick access to this model.

What changed?

  • config/pi/models.json: Renamed the z-ai/glm-4.7 model ID and name to z-ai/glm-4-7 and added a new openrouter-preset configuration for glm-4-7, including API settings, cost, and a 131,072-token context window.
  • home-manager/programs/fish/default.nix: Updated to include new fish function definitions (_pixe_function, _pixeh_function, _pilxe_function, _pilxeh_function) and their corresponding pixe and pixeh aliases.
  • home-manager/programs/fish/functions/_pixe_function.fish: Introduced a new fish shell function that wraps the pi-agent command to use the GLM-4.7 model via OpenRouter with an optional free-form prompt.
  • home-manager/programs/fish/functions/_pixeh_function.fish: Added a new fish function to prompt the user for input and execute pi-agent using the openrouter-preset/@preset/glm-4-7 model, reporting an error if no input is provided.

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 adds support for the GLM-4.7 model via OpenRouter by updating the model configuration and adding new fish shell functions for quick access. The changes are generally good, but I have a few suggestions to improve consistency, maintainability, and correctness. Specifically, I've pointed out an inconsistent model name, the inclusion of what appear to be extraneous function definitions in the Nix configuration, and opportunities to refactor hardcoded model IDs in the new fish functions.

Comment thread home-manager/programs/fish/default.nix Outdated
Comment on lines +154 to +155
"_pilxe_function"
"_pilxeh_function"

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

These functions, _pilxe_function and _pilxeh_function, seem to have been added by mistake. They are not defined as shell abbreviations, and their corresponding function files are not included in this pull request. Including them here will likely cause sourcing errors. Please remove them.

Comment thread config/pi/models.json
"id": "z-ai/glm-4.7",
"name": "GLM-4.7 (Z-AI)",
"id": "z-ai/glm-4-7",
"name": "glm-4-7 (Z-AI)",

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 consistency with other model names in this file (e.g., GLM-4.6 (Z-AI) on line 162 and the new GLM-4.7 (Z-AI) on line 185), the model name should be capitalized. This improves readability and maintains a consistent naming convention across the configuration.

Suggested change
"name": "glm-4-7 (Z-AI)",
"name": "GLM-4.7 (Z-AI)",

Comment on lines +5 to +10
if test (count $argv) -eq 0
pi-agent -m 'openrouter-preset/@preset/glm-4-7'
else
set -l prompt (string join " " -- $argv)
pi-agent "$prompt" -m 'openrouter-preset/@preset/glm-4-7'
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.

medium

To improve maintainability and avoid duplicating the model identifier string, it's a good practice to define it as a local variable. This makes it easier to update in the future if needed.

  set -l model 'openrouter-preset/@preset/glm-4-7'
  if test (count $argv) -eq 0
    pi-agent -m "$model"
  else
    set -l prompt (string join " " -- $argv)
    pi-agent "$prompt" -m "$model"
  end

Comment on lines +10 to +11

pi-agent "$prompt" -m 'openrouter-preset/@preset/glm-4-7'

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 consistency with the _pixe_function and for better maintainability, consider extracting the hardcoded model identifier into a local variable.

  set -l model 'openrouter-preset/@preset/glm-4-7'
  pi-agent "$prompt" -m "$model"

@mesa-dot-dev mesa-dot-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Performed full review of 3657500...527e8b3

Analysis

  1. Build Failure Risk: The fish configuration references _pilxe_function and _pilxh_function that don't exist in the PR, which will cause the Nix build to fail.

  2. Breaking Change: The model ID changed from z-ai/glm-4.7 to z-ai/glm-4-7, which may break existing configurations or scripts without proper migration guidance.

  3. Potential User Confusion: Having two ways to access GLM-4.7 (directly via z-ai/glm-4-7 and through @preset/glm-4-7) may confuse users about which approach to use when.

  4. Missing API Key Validation: The preset configuration uses OPENROUTER_API_KEY but the fish functions don't verify this environment variable is set before making API calls.

Tip

Help

Slash Commands:

  • /review - Request a full code review
  • /review latest - Review only changes since the last review
  • /describe - Generate PR description. This will update the PR body or issue comment depending on your configuration
  • /help - Get help with Mesa commands and configuration options

0 files reviewed | 3 comments | Edit Agent SettingsRead Docs

Comment thread home-manager/programs/fish/default.nix Outdated
"_dev_function"
"_ocxe_function"
"_ocxeh_function"
"_pilxe_function"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

High

These function references (_pilxe_function and _pilxeh_function) appear to be added but the corresponding function files are not present in this PR. This will cause the fish shell configuration to fail at build time when it tries to source non-existent files. Either these entries should be removed or the function files need to be added.

Agent: 🏛 Architecture • Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#580
File: home-manager/programs/fish/default.nix#L154
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
These function references (`_pilxe_function` and `_pilxeh_function`) appear to be added but the corresponding function files are not present in this PR. This will cause the fish shell configuration to fail at build time when it tries to source non-existent files. Either these entries should be removed or the function files need to be added.

Comment thread config/pi/models.json
{
"id": "z-ai/glm-4.7",
"name": "GLM-4.7 (Z-AI)",
"id": "z-ai/glm-4-7",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium

This model ID change from z-ai/glm-4.7 to z-ai/glm-4-7 (dot to hyphen) should be carefully verified. If this is correcting a typo to match OpenRouter's actual model identifier, that's fine. However, if existing configurations or scripts reference the old ID z-ai/glm-4.7, they will break. Consider checking for any hardcoded references to the old model ID.

Agent: 🏛 Architecture • Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#580
File: config/pi/models.json#L145
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
This model ID change from `z-ai/glm-4.7` to `z-ai/glm-4-7` (dot to hyphen) should be carefully verified. If this is correcting a typo to match OpenRouter's actual model identifier, that's fine. However, if existing configurations or scripts reference the old ID `z-ai/glm-4.7`, they will break. Consider checking for any hardcoded references to the old model ID.

Comment thread config/pi/models.json
"api": "openai-completions",
"models": [
{
"id": "@preset/glm-4-7",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium

The model ID uses the @preset/ prefix which appears to be OpenRouter-specific syntax. Verify that the Pi agent correctly handles this prefix when constructing API requests. Also, there's a discrepancy: this entry uses @preset/glm-4-7 while the direct model on line 145 uses z-ai/glm-4-7. Consider documenting when to use each variant.

Agent: 🏛 Architecture • Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#580
File: config/pi/models.json#L184
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
The model ID uses the `@preset/` prefix which appears to be OpenRouter-specific syntax. Verify that the Pi agent correctly handles this prefix when constructing API requests. Also, there's a discrepancy: this entry uses `@preset/glm-4-7` while the direct model on line 145 uses `z-ai/glm-4-7`. Consider documenting when to use each variant.

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

This PR adds support for the GLM-4.7 model via OpenRouter's preset system, providing a free alternative for running Pi agent. It updates the model ID format, adds a new OpenRouter provider configuration, and creates fish shell shortcuts for easy access.

Changes:

  • Added openrouter-preset provider configuration with GLM-4.7 model
  • Updated existing GLM-4.7 model ID from z-ai/glm-4.7 to z-ai/glm-4-7 in the cli-proxy-api provider
  • Created pixe and pixeh fish functions for running Pi agent with GLM-4.7

Reviewed changes

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

File Description
config/pi/models.json Added openrouter-preset provider with GLM-4.7 model, corrected model ID format for existing entry
home-manager/programs/fish/functions/_pixe_function.fish New fish function for running Pi agent with GLM-4.7 via OpenRouter
home-manager/programs/fish/functions/_pixeh_function.fish New fish function for running Pi agent headlessly with GLM-4.7
home-manager/programs/fish/default.nix Added abbreviations for pixe/pixeh and registered function files

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

Comment thread home-manager/programs/fish/default.nix Outdated
Comment on lines +154 to +155
"_pilxe_function"
"_pilxeh_function"

Copilot AI Jan 15, 2026

Copy link

Choose a reason for hiding this comment

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

The functions _pilxe_function and _pilxeh_function are referenced but don't exist in the functions directory. These should be removed from the list, or the corresponding function files need to be created.

Suggested change
"_pilxe_function"
"_pilxeh_function"

Copilot uses AI. Check for mistakes.
# Usage: pixe [<prompt words...>]

if test (count $argv) -eq 0
pi-agent -m 'openrouter-preset/@preset/glm-4-7'

Copilot AI Jan 15, 2026

Copy link

Choose a reason for hiding this comment

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

Inconsistent model ID format. The existing _ocxe_function.fish uses openrouter-preset/glm-4-7 while this uses openrouter-preset/@preset/glm-4-7. The JSON configuration defines the model ID as @preset/glm-4-7, so the format openrouter-preset/@preset/glm-4-7 appears correct, but _ocxe_function.fish should likely be updated for consistency.

Copilot uses AI. Check for mistakes.
pi-agent -m 'openrouter-preset/@preset/glm-4-7'
else
set -l prompt (string join " " -- $argv)
pi-agent "$prompt" -m 'openrouter-preset/@preset/glm-4-7'

Copilot AI Jan 15, 2026

Copy link

Choose a reason for hiding this comment

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

Inconsistent model ID format. The existing _ocxe_function.fish uses openrouter-preset/glm-4-7 while this uses openrouter-preset/@preset/glm-4-7. The JSON configuration defines the model ID as @preset/glm-4-7, so the format openrouter-preset/@preset/glm-4-7 appears correct, but _ocxe_function.fish should likely be updated for consistency.

Copilot uses AI. Check for mistakes.
return 1
end

pi-agent "$prompt" -m 'openrouter-preset/@preset/glm-4-7'

Copilot AI Jan 15, 2026

Copy link

Choose a reason for hiding this comment

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

Inconsistent model ID format. The existing _ocxe_function.fish uses openrouter-preset/glm-4-7 while this uses openrouter-preset/@preset/glm-4-7. The JSON configuration defines the model ID as @preset/glm-4-7, so the format openrouter-preset/@preset/glm-4-7 appears correct, but _ocxe_function.fish should likely be updated for consistency.

Copilot uses AI. Check for mistakes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@home-manager/programs/fish/default.nix`:
- Around line 154-157: The function list contains _pilxe_function and
_pilxeh_function but their files
(home-manager/programs/fish/functions/_pilxe_function.fish and
_pilxeh_function.fish) and shell abbreviations (pilxe, pilxeh in shellAbbrs) are
missing; either remove "_pilxe_function" and "_pilxeh_function" from the array
in default.nix or add the corresponding .fish files under
programs/fish/functions/ and define matching shellAbbrs entries ("pilxe" and
"pilxeh") so the functions can be sourced without error.
🧹 Nitpick comments (1)
config/pi/models.json (1)

145-146: Minor naming inconsistency between providers.

The model name here is "glm-4-7 (Z-AI)" (lowercase, no dot), while the new openrouter-preset provider at line 185 uses "GLM-4.7 (Z-AI)" (uppercase, with dot). Consider aligning the naming convention for consistency across providers.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3657500 and 527e8b3.

📒 Files selected for processing (4)
  • config/pi/models.json
  • home-manager/programs/fish/default.nix
  • home-manager/programs/fish/functions/_pixe_function.fish
  • home-manager/programs/fish/functions/_pixeh_function.fish
🧰 Additional context used
📓 Path-based instructions (10)
**/*.{js,ts,jsx,tsx,json}

📄 CodeRabbit inference engine (CLAUDE.md)

Use Biome with 2-space indentation, 80-character line width, double quotes, and trailing commas (ES5) for JSON/JavaScript/TypeScript files

Files:

  • config/pi/models.json
**/*.{json,yaml,yml,toml}

📄 CodeRabbit inference engine (.cursor/rules/formatting.mdc)

**/*.{json,yaml,yml,toml}: Use consistent indentation (2 spaces) in configuration files
Sort keys alphabetically when possible in configuration files
Use clear, descriptive names in configuration files

Files:

  • config/pi/models.json
**/*.{js,jsx,ts,tsx,json}

📄 CodeRabbit inference engine (.cursor/rules/formatting.mdc)

**/*.{js,jsx,ts,tsx,json}: Format JavaScript/TypeScript/JSON files using Biome with 2-space indentation and 80 character line width
Enable Biome linter with recommended rules for JavaScript/TypeScript/JSON files

Files:

  • config/pi/models.json
**/*.{js,jsx,ts,tsx,json,jsonc,md}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Use Biome for code formatting as configured in biome.json

Files:

  • config/pi/models.json
**/*.nix

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.nix: Use nixfmt for formatting all Nix files
Document complex configurations with comments in Nix files

**/*.nix: Use 2 spaces for indentation in Nix files
Keep line length under 100 characters in Nix files
Sort attribute sets alphabetically in Nix files
Use consistent spacing around operators in Nix files
Format lists and sets consistently in Nix files

Use treefmt.toml for formatting Nix files

**/*.nix: Use mkOption for configurable options in Nix modules
Implement proper typing for all options in Nix modules
Follow the Nix expression language style guide

Files:

  • home-manager/programs/fish/default.nix
**/default.nix

📄 CodeRabbit inference engine (CLAUDE.md)

Use default.nix files for module exports

Files:

  • home-manager/programs/fish/default.nix
home-manager/programs/*/default.nix

📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)

Program configurations should be located in home-manager/programs/<name>/ and use home-manager's built-in modules when available

Files:

  • home-manager/programs/fish/default.nix
home-manager/programs/**/default.nix

📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)

Program configurations must include all necessary dependencies in their configuration

Files:

  • home-manager/programs/fish/default.nix
home-manager/**/*.nix

📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)

home-manager/**/*.nix: Use typed options whenever possible in Nix configurations
Document all configuration options in Nix modules and programs
Follow home-manager's module structure and keep configurations modular
Use proper indentation and formatting in Nix configuration files

Files:

  • home-manager/programs/fish/default.nix
home-manager/programs/**/*.nix

📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)

Follow program-specific best practices in program configuration files

Program configurations in home-manager/programs/ should be organized by program name, include all necessary dependencies, use home.packages for package installations, and use programs.<name> when available in home-manager

Files:

  • home-manager/programs/fish/default.nix
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
  • GitHub Check: Agent
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Mesa Review
  • GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
  • GitHub Check: e2e-run (NixOS, ubuntu-latest)
  • GitHub Check: e2e-run (MacOS, macos-latest)
  • GitHub Check: shell-test
  • GitHub Check: shell-lint
  • GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
  • GitHub Check: lua-hammerspoon
  • GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
  • GitHub Check: lua-neovim
  • GitHub Check: lua-neovim-test
  • GitHub Check: nix-linux
  • GitHub Check: nix-nixos
  • GitHub Check: nix-darwin
🔇 Additional comments (4)
home-manager/programs/fish/functions/_pixeh_function.fish (1)

1-12: LGTM!

The function correctly validates user input, provides appropriate error handling with stderr output, and uses the correct model reference (openrouter-preset/@preset/glm-4-7) that matches the new provider configuration in models.json.

home-manager/programs/fish/functions/_pixe_function.fish (1)

1-11: LGTM!

The function provides flexible usage with both interactive mode (no arguments) and direct prompt mode. The use of string join " " -- $argv is idiomatic Fish and safely handles arguments that might start with dashes. The model reference is consistent with _pixeh_function and models.json.

home-manager/programs/fish/default.nix (1)

91-92: LGTM!

The abbreviations correctly map pixe and pixeh to their corresponding functions, following the existing pattern in the configuration.

config/pi/models.json (1)

178-199: New OpenRouter preset provider configuration is correct.

The structure follows the existing provider pattern with appropriate fields.

  1. API Key handling: The apiKey value "OPENROUTER_API_KEY" is a runtime reference that pi-agent resolves at startup via its AuthStorage mechanism, which reads from environment variables, ~/.pi/agent/auth.json, or CLI flags. This format is correct for pi-agent. As a security best practice, ensure the actual key is supplied via the OPENROUTER_API_KEY environment variable or stored in auth.json, not embedded in this config file.

  2. API endpoint: The "openai-completions" API type is compatible with OpenRouter, which provides OpenAI-compliant /v1/chat/completions and /v1/completions endpoints. Test provider-specific features (streaming, function calling, model-specific behaviors) during integration to confirm full compatibility.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread home-manager/programs/fish/default.nix Outdated

@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 4 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="home-manager/programs/fish/default.nix">

<violation number="1" location="home-manager/programs/fish/default.nix:154">
P1: xdg.configFile installs Fish functions `_pilxe_function`/`_pilxeh_function` that don't exist, causing build/activation failure or unused config (likely typo vs `_pixe*`)</violation>
</file>

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

Comment thread home-manager/programs/fish/default.nix Outdated
"_dev_function"
"_ocxe_function"
"_ocxeh_function"
"_pilxe_function"

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.

P1: xdg.configFile installs Fish functions _pilxe_function/_pilxeh_function that don't exist, causing build/activation failure or unused config (likely typo vs _pixe*)

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At home-manager/programs/fish/default.nix, line 154:

<comment>xdg.configFile installs Fish functions `_pilxe_function`/`_pilxeh_function` that don't exist, causing build/activation failure or unused config (likely typo vs `_pixe*`)</comment>

<file context>
@@ -149,6 +151,10 @@
         "_dev_function"
         "_ocxe_function"
         "_ocxeh_function"
+        "_pilxe_function"
+        "_pilxeh_function"
+        "_pixe_function"
</file context>

@shunkakinoki
shunkakinoki merged commit b8154c9 into main Jan 15, 2026
30 checks passed
@shunkakinoki
shunkakinoki deleted the openpreset-4-7 branch January 15, 2026 21:03
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