fix: strip empty messages on OpenAI->Claude translation#293
fix: strip empty messages on OpenAI->Claude translation#293KooshaPari wants to merge 671 commits intorouter-for-me:mainfrom
Conversation
fix: resolve executor compile regressions
…-20260223 chore: merge remaining branch deltas (dependabot + CP2K queue docs)
Build Fixes: - Fix duplicate type definitions in kiro_websearch_handler.go (McpRequest, McpResponse, WebSearchResults) - Fix undefined authID and wsURL variables in codex_websockets_executor.go by naming parameters - Remove unused imports (crypto/sha256, encoding/hex) from codex_websockets_executor.go - Add missing syscall import to cmd/cliproxyctl/main.go for error handling - Remove incomplete showConfigPaths block from cmd/server/main.go (undefined functions) - Remove unused strings import from copilot/token_test.go Track 1.2 - ACP Adapter: - Implement ACP adapter to translate Claude/OpenAI protocol messages to ACP protocol - Add acp_request.go: Request translation and validation - Add acp_response.go: Response translation and formatting - Add acp_adapter.go: Main adapter logic with registry integration - Add unit tests in acp_adapter_registry_test.go Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
chore: merge ci-compile-fix-clean-single lane closeout and fixes
…chestration feat: Integrate benchmarks into ParetoRouter
# Conflicts: # .gitignore # .worktrees/config/m/config-build/active/pkg/llmproxy/config/config.go # .worktrees/config/m/config-build/active/pkg/llmproxy/config/oauth_model_alias_migration.go # README.md
chore: merge full-sdk type unification (layer 3)
chore: merge full-sdk/test-cleanup stack into main
…type - Fixed missing closing brace in for loop - Changed return type from string to bool for proper if statement usage - Updated caller to use boolean check
- Fix unused sync/atomic import in kiro_websearch_handler.go - Fix handlers_metadata_test.go to use correct gin context key - Remove broken test files with undefined symbols Testing: Build PASS, Vet PASS, Tests PASS
This reverts commit 2464a28.
Cherry-picked from merge/1698-strip-empty-messages-openai-to-claude into aligned base
Summary of ChangesHello @KooshaPari, 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 represents a significant foundational update to the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a large number of new configuration files, CI/CD scripts, and documentation. However, the PR title and description ('fix: strip empty messages on OpenAI->Claude translation') do not seem to match the changes. Please update them to accurately reflect the content of this PR.
My review has identified several critical issues:
- A large number of duplicated project files have been added under the
.worktreesdirectory. This is a major problem and this directory should be removed. - Several files within the duplicated
.worktreesdirectory contain unresolved git conflict markers. - The
dependabot.ymlconfiguration is invalid because thepackage-ecosystemis not specified.
| <<<<<<< HEAD | ||
| ======= | ||
| - Support multiple aliases for a single upstream model in OAuth model alias configuration, preserving compatibility while allowing same upstream model name with distinct aliases. | ||
| >>>>>>> archive/pr-234-head-20260223 |
There was a problem hiding this comment.
This file contains unresolved git conflict markers (<<<<<<< HEAD, =======, >>>>>>>). These must be resolved before merging. This appears to be one of several files with this issue.
| <<<<<<< HEAD | |
| ======= | |
| - Support multiple aliases for a single upstream model in OAuth model alias configuration, preserving compatibility while allowing same upstream model name with distinct aliases. | |
| >>>>>>> archive/pr-234-head-20260223 | |
| - Support multiple aliases for a single upstream model in OAuth model alias configuration, preserving compatibility while allowing same upstream model name with distinct aliases. |
| # CLIProxyAPI Plus | ||
|
|
||
| English | [Chinese](README_CN.md) | ||
|
|
||
| This is the Plus version of [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI), adding support for third-party providers on top of the mainline project. | ||
|
|
||
| All third-party provider support is maintained by community contributors; CLIProxyAPI does not provide technical support. Please contact the corresponding community maintainer if you need assistance. | ||
|
|
||
| The Plus release stays in lockstep with the mainline features. | ||
|
|
||
| ## Differences from the Mainline | ||
|
|
||
| - Added GitHub Copilot support (OAuth login), provided by [em4go](https://github.com/em4go/CLIProxyAPI/tree/feature/github-copilot-auth) | ||
| - Added Kiro (AWS CodeWhisperer) support (OAuth login), provided by [fuko2935](https://github.com/fuko2935/CLIProxyAPI/tree/feature/kiro-integration), [Ravens2121](https://github.com/Ravens2121/CLIProxyAPIPlus/) | ||
|
|
||
| ## New Features (Plus Enhanced) | ||
|
|
||
| - **OAuth Web Authentication**: Browser-based OAuth login for Kiro with beautiful web UI | ||
| - **Rate Limiter**: Built-in request rate limiting to prevent API abuse | ||
| - **Background Token Refresh**: Automatic token refresh 10 minutes before expiration | ||
| - **Metrics & Monitoring**: Request metrics collection for monitoring and debugging | ||
| - **Device Fingerprint**: Device fingerprint generation for enhanced security | ||
| - **Cooldown Management**: Smart cooldown mechanism for API rate limits | ||
| - **Usage Checker**: Real-time usage monitoring and quota management | ||
| - **Model Converter**: Unified model name conversion across providers | ||
| - **UTF-8 Stream Processing**: Improved streaming response handling | ||
|
|
||
| ## Kiro Authentication | ||
|
|
||
| ### Web-based OAuth Login | ||
|
|
||
| Access the Kiro OAuth web interface at: | ||
|
|
||
| ``` | ||
| http://your-server:8080/v0/oauth/kiro | ||
| ``` | ||
|
|
||
| This provides a browser-based OAuth flow for Kiro (AWS CodeWhisperer) authentication with: | ||
| - AWS Builder ID login | ||
| - AWS Identity Center (IDC) login | ||
| - Token import from Kiro IDE | ||
|
|
||
| ## Quick Deployment with Docker | ||
|
|
||
| ### One-Command Deployment | ||
|
|
||
| ```bash | ||
| # Create deployment directory | ||
| mkdir -p ~/cli-proxy && cd ~/cli-proxy | ||
|
|
||
| # Create docker-compose.yml | ||
| cat > docker-compose.yml << 'EOF' | ||
| services: | ||
| cli-proxy-api: | ||
| image: eceasy/cli-proxy-api-plus:latest | ||
| container_name: cli-proxy-api-plus | ||
| ports: | ||
| - "8317:8317" | ||
| volumes: | ||
| - ./config.yaml:/CLIProxyAPI/config.yaml | ||
| - ./auths:/root/.cli-proxy-api | ||
| - ./logs:/CLIProxyAPI/logs | ||
| restart: unless-stopped | ||
| EOF | ||
|
|
||
| # Download example config | ||
| curl -o config.yaml https://raw.githubusercontent.com/router-for-me/CLIProxyAPIPlus/main/config.example.yaml | ||
|
|
||
| # Pull and start | ||
| docker compose pull && docker compose up -d | ||
| ``` | ||
|
|
||
| ### Configuration | ||
|
|
||
| Edit `config.yaml` before starting: | ||
|
|
||
| ```yaml | ||
| # Basic configuration example | ||
| server: | ||
| port: 8317 | ||
|
|
||
| # Add your provider configurations here | ||
| ``` | ||
|
|
||
| ### Update to Latest Version | ||
|
|
||
| ```bash | ||
| cd ~/cli-proxy | ||
| docker compose pull && docker compose up -d | ||
| ``` | ||
|
|
||
| ## Contributing | ||
|
|
||
| This project only accepts pull requests that relate to third-party provider support. Any pull requests unrelated to third-party provider support will be rejected. | ||
|
|
||
| If you need to submit any non-third-party provider changes, please open them against the [mainline](https://github.com/router-for-me/CLIProxyAPI) repository. | ||
|
|
||
| ## License | ||
|
|
||
| This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
There was a problem hiding this comment.
This file and the entire .worktrees/config/m/config-build/active/ directory seem to be a duplicate of the project's root directory and its contents. Committing worktree-specific directories, especially with duplicated project files, is highly problematic. It will bloat the repository size and create significant maintenance overhead and confusion. It seems like these files were added by mistake. Please remove the entire .worktrees directory from this pull request.
| <<<<<<< HEAD | ||
| - task: quality:docs-phase-placeholders | ||
| ======= | ||
| >>>>>>> archive/pr-234-head-20260223 |
| <<<<<<< HEAD | ||
| quality:docs-phase-placeholders: | ||
| desc: "Reject unresolved placeholder-like tokens in planning reports" | ||
| cmds: | ||
| - ./.github/scripts/check-phase-doc-placeholder-tokens.sh | ||
|
|
||
| ======= | ||
| >>>>>>> archive/pr-234-head-20260223 |
| <<<<<<< HEAD | ||
| ======= | ||
| # Normalize CONFIG_FILE when mount points incorrectly create a directory. | ||
| if [ -d "${CONFIG_FILE}" ]; then | ||
| CONFIG_FILE="${CONFIG_FILE%/}/config.yaml" | ||
| fi | ||
|
|
||
| >>>>>>> archive/pr-234-head-20260223 |
There was a problem hiding this comment.
This file contains unresolved git conflict markers. These must be resolved before merging.
| <<<<<<< HEAD | |
| ======= | |
| # Normalize CONFIG_FILE when mount points incorrectly create a directory. | |
| if [ -d "${CONFIG_FILE}" ]; then | |
| CONFIG_FILE="${CONFIG_FILE%/}/config.yaml" | |
| fi | |
| >>>>>>> archive/pr-234-head-20260223 | |
| # Normalize CONFIG_FILE when mount points incorrectly create a directory. | |
| if [ -d "${CONFIG_FILE}" ]; then | |
| CONFIG_FILE="${CONFIG_FILE%/}/config.yaml" | |
| fi | |
| <<<<<<< HEAD | ||
| ======= | ||
| chmod 700 "${AUTH_DIR}" | ||
| >>>>>>> archive/pr-234-head-20260223 |
| <<<<<<< HEAD | ||
| ======= | ||
| mkdir -p "$(dirname "${CONFIG_FILE}")" | ||
| >>>>>>> archive/pr-234-head-20260223 |
| <<<<<<< HEAD | ||
| health-probe: | ||
| command: "sh -lc 'while true; do curl -fsS http://localhost:8317/health >/dev/null 2>&1 || true; sleep 20; done'" | ||
| working_dir: "." | ||
| availability: | ||
| restart: "always" | ||
| ======= | ||
|
|
||
| >>>>>>> archive/pr-234-head-20260223 |
There was a problem hiding this comment.
| - package-ecosystem: "" # See documentation for possible values haha | ||
| directory: "/" # Location of package manifests | ||
| schedule: | ||
| interval: "weekly" |
There was a problem hiding this comment.
The package-ecosystem is empty, which is a required field for Dependabot configuration. This will cause Dependabot updates to fail. You should specify the package ecosystem(s) to update. For a Go project using GitHub Actions, you should configure both gomod and github-actions. Also, the comment # See documentation for possible values haha is unprofessional and should be updated.
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
Cherry-picks commit e9b1201 from merge/1698 branch onto a plus-main-compatible base in cliproxyapi++. Prevents empty text parts from being forwarded as blank content during OpenAI-to-Claude message conversion.