Skip to content

fix: allow go install without replace#559

Merged
ymkiux merged 1 commit into
mainfrom
fix/go-install-without-replace
May 15, 2026
Merged

fix: allow go install without replace#559
ymkiux merged 1 commit into
mainfrom
fix/go-install-without-replace

Conversation

@awsl233777
Copy link
Copy Markdown
Collaborator

@awsl233777 awsl233777 commented May 15, 2026

Summary

Fixes #556.

go install github.com/awsl-project/maxx/cmd/maxx@main fails today because the main module contains a replace directive for github.com/router-for-me/CLIProxyAPI/v6. Go rejects modules with replace directives when installing a package by version.

This PR removes the replace directive by switching the CLIProxyAPI SDK imports to the canonical awsl-project module path and depending on github.com/awsl-project/CLIProxyAPI/v7 directly.

Dependency note: this uses github.com/awsl-project/CLIProxyAPI/v7 v7.0.0-20260515045015-8112adc7fefb, from awsl-project/CLIProxyAPI#5 (fix/awsl-module-path-v7). That dependency PR changes the fork's module path/imports to github.com/awsl-project/CLIProxyAPI/v7 and keeps the exported sdk/exec package maxx uses.

Validation

  • go test ./sdk/exec ./sdk/cliproxy/auth ./sdk/translator in awsl-project/CLIProxyAPI at 8112adc7fefb7bac02af03f496a7d9417e9b276b
  • go test ./internal/adapter/provider/cliproxyapi_codex ./internal/adapter/provider/cliproxyapi_antigravity
  • GOBIN=$(mktemp -d) go install ./cmd/maxx
  • Fresh remote install test with isolated GOPATH/GOCACHE:
    • go install github.com/awsl-project/maxx/cmd/maxx@32332d4c886228b6286f7069773f0734059d275e
    • maxx --version output: maxx dev (commit: unknown, built: unknown)

Summary by CodeRabbit

发布说明

  • 例行维护
    • 更新核心依赖项版本,以获得最新的系统支持。

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9d84e969-8409-4432-a6f0-efff508a3397

📥 Commits

Reviewing files that changed from the base of the PR and between 7f8b6c3 and 32332d4.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • go.mod
  • internal/adapter/provider/cliproxyapi_antigravity/adapter.go
  • internal/adapter/provider/cliproxyapi_codex/adapter.go
📜 Recent review details
⏰ 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). (2)
  • GitHub Check: e2e
  • GitHub Check: playwright
🔇 Additional comments (3)
go.mod (1)

9-9: CLIProxyAPI/v7 依赖已验证可用。

伪版本 v7.0.0-20260515045015-8112adc7fefb 引用的提交已确认存在且可访问:

  • 提交 SHA: 8112adc7fefb7bac02af03f496a7d9417e9b276b
  • 提交时间: 2026-05-15T04:50:15Z
  • 提交信息: "fix: expose awsl module path for sdk imports"
  • 模块路径: github.com/awsl-project/CLIProxyAPI/v7 (来自官方 awsl-project 组织)

所有必需的 v7 SDK 包已验证存在且兼容:

  • sdk/exec
  • sdk/cliproxy/auth
  • sdk/cliproxy/executor
  • sdk/translator
internal/adapter/provider/cliproxyapi_codex/adapter.go (1)

16-19: CLIProxyAPI v7 中 Codex 适配器的 API 兼容性已确认。

已验证以下 API 在 v7 中存在且兼容:

  • exec.CodexExecutor - 类型别名定义正确
  • exec.NewCodexExecutor() - 构造函数存在
  • translator.FormatOpenAIResponse - 常量已定义为 "openai-response"(第 259 行使用)

导入路径已正确更新至 v7,无兼容性问题。

internal/adapter/provider/cliproxyapi_antigravity/adapter.go (1)

13-16: 导入路径已正确更新至 v7,所有相关 API 在 v7 SDK 中存在且兼容。

验证结果:

  • translator.FormatClaudetranslator.FormatGemini 常量已在 v7 中定义
  • auth.Auth 结构体存在,包含 ProviderMetadata 字段,与现有用法兼容
  • executor.Requestexecutor.Options 结构体签名兼容
  • exec.NewAntigravityExecutor() 函数存在且返回类型正确

📝 Walkthrough

总体概览

此 PR 将项目的 CLIProxyAPI 依赖从 v6 升级至 v7。主要变更包括在 go.mod 中添加 v7 的直接依赖、移除旧的 replace 指令、更新两个适配器的导入路径,并添加 v7 的间接依赖。

变更

CLIProxyAPI v7 升级和 go.mod 清理

层级 / 文件 概述
go.mod 直接依赖升级和 replace 指令移除
go.mod
添加 github.com/awsl-project/CLIProxyAPI/v7 为直接依赖,删除 github.com/router-for-me/CLIProxyAPI/v6 的替换指令,并引入三个间接依赖:xxhash/v2 v2.3.0、redis/go-redis/v9 v9.19.0 和 go.uber.org/atomic v1.11.0。
适配器导入路径更新为 CLIProxyAPI v7
internal/adapter/provider/cliproxyapi_antigravity/adapter.go, internal/adapter/provider/cliproxyapi_codex/adapter.go
在 antigravity 和 codex 适配器中,将 github.com/router-for-me/CLIProxyAPI/v6 的包导入(auth、executor、exec、translator)更新为 github.com/awsl-project/CLIProxyAPI/v7 的对应路径。

相关 PR

  • awsl-project/maxx#516:主要 PR 升级 CLIProxyAPI 导入从 v6 到 v7,与该 PR 在 CLIProxyAPI 版本和依赖替换区域的变更相同。
  • awsl-project/maxx#479:两个 PR 都更新 go.mod 中的 CLIProxyAPI 依赖配置——主 PR 从 router-for-me v6 的 replace 切换到 awsl-project v7 并更新相关导入,而该 PR 调整了 router-for-me v6 对 awsl-project v6 的 replace 版本。
  • awsl-project/maxx#290:两个 PR 都修改 go.mod 中的 CLIProxyAPI 依赖配置(变更 router-for-me/CLIProxyAPI 的版本/replace 目标),主 PR 的 v7 适配器导入更新由该类 CLIProxyAPI 模块切换引起。

建议审核者

  • ymkiux

代码审查工作量评估

🎯 1 (简单) | ⏱️ ~8 分钟

庆祝诗

🐰 依赖升级,replace 去无踪,
v7 新版踏浪起,
适配器导入齐整洒,
go.mod 清爽心欢悦,
安装问题终解困。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确总结了主要变更:移除 replace 指令以允许 go install,与代码改动内容相符。
Linked Issues check ✅ Passed 代码改动完全满足 issue #556 的需求:移除了 replace 指令,切换到规范的 awsl-project CLIProxyAPI/v7 依赖路径。
Out of Scope Changes check ✅ Passed 所有代码改动都与修复 go install 问题直接相关,包括依赖升级和导入路径更新,无超出范围的改动。
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/go-install-without-replace

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@awsl233777
Copy link
Copy Markdown
Collaborator Author

Validation update:

  • PR checks are green: Backend Checks, Frontend Checks, e2e, playwright, CodeRabbit.
  • Fixes #556 is present in the PR body.
  • Changed files are limited to:
    • go.mod
    • go.sum
    • internal/adapter/provider/cliproxyapi_antigravity/adapter.go
    • internal/adapter/provider/cliproxyapi_codex/adapter.go
  • Local validation completed:
    • go test ./internal/adapter/provider/cliproxyapi_codex ./internal/adapter/provider/cliproxyapi_antigravity
    • GOBIN=$(mktemp -d) go install ./cmd/maxx
  • Remote install validation completed with isolated GOPATH/GOCACHE:
    • go install github.com/awsl-project/maxx/cmd/maxx@32332d4c886228b6286f7069773f0734059d275e
    • maxx --version output: maxx dev (commit: unknown, built: unknown)

Current merge blocker is repository review policy: reviewDecision=REVIEW_REQUIRED.

@ymkiux ymkiux merged commit dcb07aa into main May 15, 2026
5 checks passed
@ymkiux ymkiux deleted the fix/go-install-without-replace branch May 15, 2026 05:40
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.

Cannot install via go install

2 participants