Skip to content

feat: integrate amp and ampcode configurations - #390

Merged
shunkakinoki merged 4 commits into
mainfrom
ai-proxy
Dec 5, 2025
Merged

feat: integrate amp and ampcode configurations#390
shunkakinoki merged 4 commits into
mainfrom
ai-proxy

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Dec 5, 2025

Copy link
Copy Markdown
Owner

Add @sourcegraph/amp to package dependencies for AI proxy integration, configure ampcode in cliproxyapi service, and update custom models and providers configuration


Summary by cubic

Integrates Sourcegraph AMP into the AI proxy and enables ampcode routing. Updates model/provider mappings and removes the legacy amp-cli.

  • Dependencies

    • Add @sourcegraph/amp to package.json and lockfile.
    • Remove amp-cli from home-manager packages.
  • Configuration

    • Enable ampcode with upstream-url in cliproxyapi (https://ampcode.com).
    • Update custom_models in config/factory/config.json:
      • claude-opus-4-5-20251101, claude-haiku-4-5-20251001 → anthropic
      • gpt-5.1, gpt-5.1-codex, gpt-5.1-codex-max → openai
      • gemini-3-pro-preview → antigravity

Written for commit 54e45f9. Summary will update automatically on new commits.

Copilot AI review requested due to automatic review settings December 5, 2025 08:04
@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 @sourcegraph/amp package to facilitate AI proxy functionality, specifically configuring ampcode within the cliproxyapi service. It also refines the custom AI model definitions by reordering existing entries and updating a model's provider, alongside removing an obsolete amp-cli entry from the Nix package configuration.

Highlights

  • Dependency Integration: The @sourcegraph/amp package has been added to the project dependencies to support AI proxy integration.
  • AI Proxy Configuration: The ampcode configuration has been introduced in the cliproxyapi service, pointing to an upstream URL.
  • Custom Model Updates: The custom_models configuration has been updated, including a reordering of entries and a change in the provider for the gemini-3-pro-preview model from openai to antigravity.
  • Nix Package Removal: The amp-cli package has been removed from the home-manager Nix packages.
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.

@coderabbitai

coderabbitai Bot commented Dec 5, 2025

Copy link
Copy Markdown
📝 Walkthrough

Summary by CodeRabbit

  • Configuration

    • Updated multiple AI model and provider configurations across settings files
  • Dependencies

    • Added @sourcegraph/amp package dependency to project
  • Package Management

    • Removed amp-cli from standard package list
    • Introduced conditional package loading for Linux-specific tools based on environment conditions

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

Walkthrough

This pull request updates model provider configurations, modifies package dependencies, and restructures Linux package management. It removes amp-cli from Nix packages, adds conditional Linux-specific packages, introduces @sourcegraph/amp as a Node dependency, and remaps six custom model entries across different providers in configuration files.

Changes

Cohort / File(s) Summary
Configuration value updates
config/cliproxyapi/config.yaml, config/factory/config.json
Formatting adjustment in YAML quota-exceeded section; remapping of six custom model entries with model name and provider field changes in JSON (e.g., gemini-3-pro-preview→claude-opus-4-5-20251101, openai→anthropic across entries)
Package and dependency management
home-manager/packages/default.nix, package.json
Removed amp-cli from base package list; added conditional lib.optionals blocks for Linux-specific and Linux non-CI packages; added @sourcegraph/amp to Node dependencies and trustedDependencies

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Attention areas:
    • config/factory/config.json: Verify that the six model↔provider remappings are intentional and semantically correct for downstream API calls
    • home-manager/packages/default.nix: Ensure the conditional logic (stdenv.isLinux, !isCI) correctly gates package availability without breaking non-Linux or CI environments
    • package.json: Confirm the @sourcegraph/amp version and its relationship to the removed amp-cli package

Possibly related PRs

  • Revamp #280: Modifies the same package.json trustedDependencies section and home-manager package lists (claude-code and related Linux-only packages), suggesting coordinated dependency/package restructuring.

Poem

🐰 A hopping hop of configs new,
Claude and Gemini swap their hue,
amp takes flight from nix to npm's care,
Linux packages flourish, conditional and fair!
Config waltz, deps align—
Our systems hum in perfect line!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: integrating amp and ampcode configurations across multiple files (package.json, config.yaml, config.json, home-manager).
Description check ✅ Passed The description is well-related to the changeset, providing clear context about adding @sourcegraph/amp dependency, configuring ampcode, updating model/provider mappings, and removing amp-cli.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ai-proxy

📜 Recent review details

Configuration used: CodeRabbit 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 52e0242 and b064884.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • config/cliproxyapi/config.yaml (1 hunks)
  • config/factory/config.json (1 hunks)
  • home-manager/packages/default.nix (0 hunks)
  • package.json (2 hunks)
💤 Files with no reviewable changes (1)
  • home-manager/packages/default.nix
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{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:

  • package.json
  • config/factory/config.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:

  • package.json
  • config/cliproxyapi/config.yaml
  • config/factory/config.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:

  • package.json
  • config/factory/config.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:

  • package.json
  • config/factory/config.json
**/*.{yaml,yml,toml}

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

Add comments for complex configurations

Files:

  • config/cliproxyapi/config.yaml
⏰ 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). (13)
  • GitHub Check: Mesa Review
  • GitHub Check: Agent
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
  • GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
  • GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
  • GitHub Check: e2e-run (MacOS, macos-latest)
  • GitHub Check: e2e-run (NixOS, ubuntu-latest)
  • GitHub Check: nix-nixos
  • GitHub Check: lua-neovim
  • GitHub Check: nix-linux
  • GitHub Check: lua-hammerspoon
  • GitHub Check: nix-darwin
🔇 Additional comments (4)
config/cliproxyapi/config.yaml (1)

37-42: AMP configuration addition looks good.

The ampcode section is properly formatted with consistent 2-space indentation, helpful comments about environment variable overrides, and clear documentation of the optional API key handling.

config/factory/config.json (2)

16-19: Verify the "antigravity" provider name.

Line 19 specifies "provider": "antigravity", which is not a standard LLM provider name (unlike openai, anthropic, gemini). This appears unusual and may be a typo. Confirm whether this is intentional as a custom/internal provider or if it should be corrected to a recognized provider name.


3-38: Verify the semantic correctness of custom_models remapping.

The PR remaps six custom_models entries, cycling model and provider pairs across entries. Confirm that this remapping aligns with your intended AMP proxy routing and model provider configuration goals.

package.json (1)

19-19: > Likely an incorrect or invalid review comment.


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 Dec 5, 2025

Copy link
Copy Markdown

Mesa Description

TL;DR

Integrates Sourcegraph AMP for AI proxy functionality, enables ampcode routing, and updates AI model and provider configurations.

What changed?

  • bun.lock: Updated to reflect dependency changes, including the addition of @sourcegraph/amp.
  • config/cliproxyapi/config.yaml: A blank line was added at the end of the file.
  • config/factory/config.json: Modified the custom_models array, renaming models and changing their associated providers (e.g., swapping OpenAI models for Anthropic and Antigravity).
  • home-manager/packages/default.nix: Removed the amp-cli package.
  • package.json: Added @sourcegraph/amp as a new dependency.

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 integrates @sourcegraph/amp for AI proxy functionality. The changes correctly add the new dependency, configure it in cliproxyapi, and update the model provider configurations. My review focuses on two main points: the use of a direct git dependency for @sourcegraph/amp, which poses a stability and security risk, and a potentially incorrect provider name in the custom models configuration. Addressing these points will improve the robustness and maintainability of the project.

Comment thread package.json
"@github/copilot": "^0.0.366",
"@google/jules": "^0.1.40",
"@nanocollective/nanocoder": "^1.16.3",
"@sourcegraph/amp": "^0.0.1764893126-gb1ffc3",

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 @sourcegraph/amp package is being added with a version that points to a specific git commit (^0.0.1764893126-gb1ffc3). Using direct git dependencies can introduce instability and security risks, as they may not have gone through the same vetting process as packages published to a registry. This also affects the bun.lock file. It is recommended to use a stable, published version from a package registry (like npm) if one is available to ensure better dependency management and security.

Comment on lines +16 to +19
"model": "gemini-3-pro-preview",
"base_url": "http://127.0.0.1:8317/v1",
"api_key": "sk-dummy",
"provider": "openai"
"provider": "antigravity"

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 provider for the gemini-3-pro-preview model is set to antigravity. This is an unconventional provider name and might be a placeholder. Using a placeholder or incorrect provider name can lead to runtime errors when this model is invoked. This should be updated to the correct provider identifier if antigravity is not the intended final value.

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 integrates the Sourcegraph AMP (Autonomous Model Proxy) package into the project by adding the @sourcegraph/amp npm dependency and configuring the ampcode service. The changes transition from a standalone CLI tool (amp-cli in Nix) to an npm package-based integration, while also reorganizing the custom model configurations in the factory config.

  • Added @sourcegraph/amp npm package dependency with version ^0.0.1764893126-gb1ffc3
  • Removed amp-cli from Nix packages (replaced by npm package)
  • Reordered custom model configurations and updated provider associations

Reviewed changes

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

Show a summary per file
File Description
package.json Added @sourcegraph/amp dependency to both dependencies and trustedDependencies arrays
home-manager/packages/default.nix Removed amp-cli package (superseded by npm package)
config/factory/config.json Reordered custom models and updated provider mappings (Claude models moved to top, gemini model provider changed to "antigravity")
config/cliproxyapi/config.yaml Added blank line for formatting in ampcode configuration section
bun.lock Updated lock file with @sourcegraph/amp and its dependencies (@napi-rs/keyring with platform-specific binaries)

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

"base_url": "http://127.0.0.1:8317/v1",
"api_key": "sk-dummy",
"provider": "openai"
"provider": "antigravity"

Copilot AI Dec 5, 2025

Copy link

Choose a reason for hiding this comment

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

The provider "antigravity" is not a valid provider. Based on the config.yaml file which lists valid protocols as "openai", "gemini", "claude", and "codex", this should likely be "gemini" for a model named "gemini-3-pro-preview".

Suggested change
"provider": "antigravity"
"provider": "gemini"

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.

No issues found across 5 files

@shunkakinoki
shunkakinoki merged commit 058379e into main Dec 5, 2025
3 checks passed
@shunkakinoki
shunkakinoki deleted the ai-proxy branch December 5, 2025 08:08

@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 52e0242...b064884

Analysis

  1. Incomplete AMP Integration: The AMP configuration appears partially implemented without clear documentation on authentication flow, whether it uses OpenAI-compatible endpoints or dedicated routes, and missing AMP configuration in the custom models list.

  2. Unclear Model Priority/Routing Logic: The reordering of models (prioritizing Anthropic over OpenAI) and changing providers (introducing "antigravity") lacks documentation about intent, impact on selection behavior, and whether "antigravity" is a valid provider.

  3. Configuration/Secret Management Complexity: Multiple secret injection points exist across the system (runtime shell scripts, environment variables, local files) rather than using Nix's age/sops integration, creating unnecessary complexity.

  4. Tight System Coupling: Hardcoded localhost:8317 endpoints across all tools, tight coupling between model names and provider types, and binary location assumptions violate Nix principles and limit deployment flexibility.

  5. Documentation Gaps: Lack of explanation about AMP's role in the system, factory's purpose (development/testing/production), and the model selection/fallback behavior makes the architecture difficult to understand and maintain.

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

5 files reviewed | 0 comments | Edit Agent SettingsRead Docs

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