fix: resolve executor compile regressions#271
fix: resolve executor compile regressions#271KooshaPari wants to merge 426 commits intorouter-for-me:mainfrom
Conversation
These fields are not supported by Codex Responses API and cause upstream errors. Fixes: router-for-me#1667
- Replace manual prefix/suffix checks with strings.TrimPrefix/TrimSuffix - Remove unused functions and variables in kiro_executor.go and request_logger.go - Move default case to the end of switch statement in kiro_executor.go - Fix function signatures and call sites in kiro_executor.go where arguments were immediately overwritten Co-authored-by: Cursor <cursoragent@cursor.com>
- Added unit tests for internal/auth packages (codex, copilot, gemini, kiro). - Added unit tests for internal/runtime/executor, specifically for Kiro executor. - Added unit tests for various internal translators. - Improved internal/api and sdk test coverage. - Fixed a race condition in Kiro social authentication callback server. - Updated .gitignore to exclude build artifacts and coverage files. - Cleaned up go.mod and go.sum with go mod tidy. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…rs and fix kiro_websearch functions This commit: - Updates cmd/codegen/main.go to support multiple templates and directories. - Embeds GeneratedConfig in internal/config/Config. - Restores SSE and message ID functions in internal/translator/kiro/claude/kiro_websearch.go. - Adds pkg/llmproxy/ directory structure for shared components. - Fixes missing strings import in generated config files. Co-authored-by: Cursor <cursoragent@cursor.com>
Renamed references to CLIProxyAPIPlus to cliproxyapi++ (display) and cliproxyapi-plusplus (technical). Updated GitHub remote and internal URLs. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…-20260223 merge: absorb heliosharness parity branch functional delta
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 introduces a substantial refactoring and enhancement of the project, shifting towards a library-first architecture by exposing core proxy logic in a new 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
The pull request introduces a significant refactoring and rebranding of the project to 'cliproxyapi++', along with a transition to a library-first architecture. While the intent is clear and the architectural improvements are valuable, the current changes introduce several critical compilation regressions in the server command and some non-portable or brittle logic in scripts and tools. Specifically, several variables and functions used in cmd/server/main.go are not declared or defined, which will prevent the application from building. Additionally, there are regex bugs in CI scripts and hardcoded values in experimental tools that should be addressed to ensure maintainability and portability.
cmd/server/main.go
Outdated
| if showConfigPaths { | ||
| selected, candidates := resolveDefaultConfigPathWithCandidates(wd, isCloudDeploy) | ||
| fmt.Println("Config path candidates:") | ||
| if strings.TrimSpace(configPath) != "" { | ||
| fmt.Printf("* %s [from --config]\n", configPath) | ||
| } | ||
| printConfigCandidates(selected, candidates) | ||
| fmt.Printf("Selected: %s\n", selected) | ||
| if _, err := fmt.Fprintf(os.Stdout, "Template: %s\n", filepath.Join(wd, "config.example.yaml")); err != nil { | ||
| log.Errorf("failed to print config template path: %v", err) | ||
| } | ||
| return | ||
| } |
There was a problem hiding this comment.
This block introduces a critical compilation error. The variable showConfigPaths is used but not declared anywhere in the main function or as a global variable. Furthermore, the functions resolveDefaultConfigPathWithCandidates and printConfigCandidates are called but not defined in this file or any other file in the main package. This regression contradicts the PR title 'fix: resolve executor compile regressions'.
| Items: board, | ||
| } | ||
|
|
||
| const base = "CLIPROXYAPI_2000_ITEM_EXECUTION_BOARD_2026-02-22" |
| desc: "Auto format Go source files with gofmt" | ||
| cmds: | ||
| - | | ||
| mapfile -t go_files < <(find . -name "*.go" -type f -not -path "./vendor/*") |
There was a problem hiding this comment.
The use of mapfile is a Bash-specific feature (version 4+) and is not portable. It will fail on systems where /bin/sh is not Bash (like Debian/Ubuntu's dash) or on older versions of Bash (like the default on macOS). Since the Docker image uses Alpine Linux, which uses busybox ash by default, this command will fail if executed within the container environment. Consider using a more portable way to iterate over files or use xargs.
|
|
||
| if [ -n "${CLIPROXY_SECRET_KEY}" ]; then | ||
| echo "[docker-init] Setting management secret-key from env" | ||
| sed -i "s/secret-key:.*/secret-key: \"${CLIPROXY_SECRET_KEY}\"/" "${CONFIG_FILE}" 2>/dev/null || \ |
There was a problem hiding this comment.
Using sed with / as a delimiter is brittle when the replacement value (like ${CLIPROXY_SECRET_KEY}) might contain the delimiter character itself. If the secret key contains a /, the sed command will fail. It is safer to use a different delimiter like | or #, or better yet, handle these overrides natively within the Go application using environment variables.
| "[REDACTED", | ||
| ] | ||
|
|
||
| fence_pattern = re.compile(r"```([\\w-]+)\s*\n(.*?)\n```", re.S) |
There was a problem hiding this comment.
The regex r"```([\\w-]+)..." in the Python block contains an extra backslash. In a Python raw string, \\w matches a literal backslash followed by 'w'. It should be r"```([\w-]+)..." to correctly match word characters (like 'json' or 'yaml') in markdown code fences.
References
- Regex patterns should be correctly escaped to match intended characters. (link)
| # CLIProxyAPI Plus | ||
|
|
||
| [English](README.md) | 中文 | ||
|
|
||
| 这是 [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) 的 Plus 版本,在原有基础上增加了第三方供应商的支持。 |
sdk/cliproxy/auth/conductor.go
Outdated
Check failure
Code scanning / CodeQL
Use of a broken or weak cryptographic hashing algorithm on sensitive data High
| return | ||
| } | ||
| log.Infof("codex websockets: upstream disconnected session=%s auth=%s url=%s reason=%s", strings.TrimSpace(sessionID), strings.TrimSpace(authID), strings.TrimSpace(wsURL), strings.TrimSpace(reason)) | ||
| log.Infof("codex websockets: upstream disconnected session=%s auth=%s url=%s reason=%s", strings.TrimSpace(sessionID), sanitizeCodexWebsocketLogField(authID), sanitizeCodexWebsocketLogURL(wsURL), strings.TrimSpace(reason)) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
| } | ||
|
|
||
| func logCodexWebsocketDisconnected(sessionID string, authID string, wsURL string, reason string, err error) { | ||
| if err != nil { | ||
| log.Infof("codex websockets: upstream disconnected session=%s auth=%s url=%s reason=%s err=%v", strings.TrimSpace(sessionID), strings.TrimSpace(authID), strings.TrimSpace(wsURL), strings.TrimSpace(reason), err) | ||
| log.Infof("codex websockets: upstream disconnected session=%s auth=%s url=%s reason=%s err=%v", strings.TrimSpace(sessionID), sanitizeCodexWebsocketLogField(authID), sanitizeCodexWebsocketLogURL(wsURL), strings.TrimSpace(reason), err) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
| } | ||
|
|
||
| func logCodexWebsocketDisconnected(sessionID string, authID string, wsURL string, reason string, err error) { | ||
| if err != nil { | ||
| log.Infof("codex websockets: upstream disconnected session=%s auth=%s url=%s reason=%s err=%v", strings.TrimSpace(sessionID), strings.TrimSpace(authID), strings.TrimSpace(wsURL), strings.TrimSpace(reason), err) | ||
| log.Infof("codex websockets: upstream disconnected session=%s auth=%s url=%s reason=%s err=%v", strings.TrimSpace(sessionID), sanitizeCodexWebsocketLogField(authID), sanitizeCodexWebsocketLogURL(wsURL), strings.TrimSpace(reason), err) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
| @@ -1290,15 +1295,34 @@ | |||
| } | |||
|
|
|||
| func logCodexWebsocketConnected(sessionID string, authID string, wsURL string) { | |||
| log.Infof("codex websockets: upstream connected session=%s auth=%s url=%s", strings.TrimSpace(sessionID), strings.TrimSpace(authID), strings.TrimSpace(wsURL)) | |||
| log.Infof("codex websockets: upstream connected session=%s auth=%s url=%s", strings.TrimSpace(sessionID), sanitizeCodexWebsocketLogField(authID), sanitizeCodexWebsocketLogURL(wsURL)) | |||
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
| @@ -49,13 +54,29 @@ | |||
| return fmt.Errorf("failed to marshal token storage: %w", err) | |||
| } | |||
|
|
|||
| if err := os.WriteFile(authFilePath, data, 0600); err != nil { | |||
| if err := os.WriteFile(cleanPath, data, 0600); err != nil { | |||
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
| @@ -39,7 +40,11 @@ | |||
|
|
|||
| // SaveTokenToFile persists the token storage to the specified file path. | |||
| func (s *KiroTokenStorage) SaveTokenToFile(authFilePath string) error { | |||
| dir := filepath.Dir(authFilePath) | |||
| cleanPath, err := cleanTokenPath(authFilePath, "kiro token") | |||
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
| if normalized == "." { | ||
| return "/" | ||
| } | ||
| if !strings.HasPrefix(normalized, "/") { |
Check warning
Code scanning / CodeQL
Bad redirect check Medium
| if normalized == "" { | ||
| return "/" | ||
| } | ||
| if !strings.HasPrefix(normalized, "/") { |
Check warning
Code scanning / CodeQL
Bad redirect check Medium
Amended compile regression fix branch with two targeted fixes: use awsRegionPattern for OIDC region validation and remove unused strings import in copilot token test.