chore(upstream-sync): merge upstream v7.1.68#109
Merged
Conversation
feat(safemode): implement example API key warning server and related functionality
… plugin execution - Implemented command-line flag registration and execution for plugins with priority-based conflict resolution. - Enabled plugin-owned command-line flag execution and persistence of plugin-auth data. - Added new `Host` methods to support command-line capabilities, including flag normalization, validation, and execution state management. - Introduced unit tests to ensure coverage for command-line plugin functionality, including auth data persistence. - Updated configs to normalize plugins during initialization.
# Conflicts: # internal/cmd/run.go
…on and thinking capabilities - Removed `examples/plugin/main.go` and `internal/pluginhost/loader_plugin.go` after migrating to a more modular system. - Introduced `streamBridge` in `internal/pluginhost/stream_bridge.go` for efficient stream handling and communication. - Added examples of `thinking` plugins written in both Rust and Go under `examples/plugin/thinking`. - Enhanced test coverage for plugin host system changes, including stream chunk translation and thinking logic. - Improved API compatibility and ensured backward-compatible upgrades for plugin execution.
…actor workflows - Updated `golang.org/x/sys` to v0.38.0 in `go.mod` and replaced `syscall` with `windows` package for memory allocation in `loader_windows.go`. - Improved cross-compilation in `.goreleaser.yml` using Zig-based toolchains for better platform support. - Changed GitHub Actions workflow to use macOS runners and added Zig toolchain setup.
…rkflow - Deleted `.goreleaser.yml` configuration and migrated functionality to GitHub Actions workflows. - Replaced `goreleaser` with matrix-based build and archiving process for improved flexibility. - Enhanced platform and architecture-specific builds, including FreeBSD support and custom runners. - Streamlined artifact upload, checksum generation, and release publishing.
… in release workflow
…tifacts in release workflow
…eeBSD release workflow
…eeBSD release workflow
…and checksum generation - Added `prepare-release` job for creating/updating GitHub releases. - Automated asset checksum generation for hosted and FreeBSD builds. - Introduced release asset uploads, including archives and checksums. - Refactored release process to include final checksum publishing.
… and fix exit code handling - Added `GH_REPO` environment variable for repository reference in the workflow. - Changed exit condition when no release archives are found to avoid workflow failure.
- Removed redundant `vm_arch` matrix configuration. - Replaced manual FreeBSD VM setup with `go-cross/cgo-actions` for cross-compilation. - Improved caching for Go modules and build artifacts. - Simplified metadata generation and environment variable handling. - Streamlined binary packaging and archive creation steps.
- Introduced a Go-based plugin `codex-service-tier` for normalizing requests to Codex. - Added functionality to set `service_tier` to `priority` for `gpt-5.5` requests when `fast` mode is enabled. - Enhanced plugin capabilities with lifecycle configuration and request transformation support. - Updated documentation with configuration examples and usage instructions in multiple languages.
…request parsing - Added fallback to handle cases where `system_instruction.parts` is absent by checking for `systemInstruction.parts`.
…cies - Updated `Dockerfile` base images from `golang:1.26-alpine` and `alpine:3.23` to `golang:1.26-bookworm` and `debian:bookworm`. - Replaced `apk` with `apt-get` for dependency installation. - Added `buildvcs=false` flag to Go build command for enhanced reproducibility.
…k processing in Gemini and Antigravity translators - Added support for processing `signature-only` chunks without opening empty text blocks. - Refactored chunk handling logic to include `signature_delta` events for improved fidelity. - Unified logic for emitting final message states, including `message_delta` and `message_stop`, to ensure consistent behavior across different scenarios. - Enhanced caching mechanism for thought signatures.
… notes handling - Introduced `build-linux-glibc` and `build-linux-no-plugin` workflows for creating Linux release assets with and without plugin support. - Enhanced release workflow with dynamic update of release notes for Linux assets. - Improved checksum generation and validation for Linux binaries. - Updated workflow matrix for better platform coverage and asset handling.
- Updated `README.md`, `README_JA.md`, and `README_CN.md` with information about RunAPI as a sponsor. - Included descriptions of RunAPI's features, benefits, and discounts. - Added `runapi.png` asset to the project.
…ningHandler` - Added handling for `/management.html` in `ExampleAPIKeyWarningHandler`. - Updated tests to validate correct behavior for the new route.
- Eliminated redundant checksum generation steps in release workflows. - Updated asset validation checks to exclude checksum files and focus solely on archive assets. - Simplified workflow logic for packaging and uploading release artifacts.
…d images The OpenAI images path (/v1/images/*) previously called patchCodexCompletedOutput to concatenate collected output_item.done items back into the completed event and then re-parsed that rebuilt JSON to pull out the image results. For multi-megabyte base64 image payloads this produced two extra full-size copies per request (the concatenated output array plus the rebuilt completed event), inflating peak memory under concurrent image generation. Add codexExtractImageResults, which extracts image_generation_call results directly from either the completed event's response.output or the collected items, without the concatenate-and-reparse step. Semantics are preserved: completed output is preferred and collected items are used only when it is empty, matching the original patchCodexCompletedOutput behaviour. patchCodexCompletedOutput remains in use by the text/responses path, which still forwards the patched event downstream. Adds unit tests covering the completed-output path, the ordered fallback to collected items, output preference, fallback list, and the wrong-event-type guard.
Apply review feedback on codexExtractImageResults: preallocate the results slice to its known maximum capacity to avoid growth reallocations, and guard the itemsByIndex index-build/sort with a length check so no empty slice is allocated or sorted when only the fallback items are present.
- Implemented `RequestInterceptor`, `ResponseInterceptor`, and `StreamChunkInterceptor` capabilities. - Added `sanitizePluginMetadata` to clean metadata for RPC compatibility. - Enhanced interceptor chaining, error handling, and test coverage. - Updated plugin configuration to register and dispatch interceptor methods.
perf(codex): avoid rebuilding completed JSON when extracting generated images
…rs and capabilities - Implemented `RequestInterceptor`, `ResponseInterceptor`, and `StreamChunkInterceptor` using embedded JavaScript. - Added support for configuring script paths, built-in script resolution, and safe execution. - Introduced ABI lifecycle management, plugin registration, and execution monitoring. - Enhanced with extensive test coverage for both plugin behavior and configuration logic.
…upstream-dev fix: translate codex stream errors for claude
…am-dev fix: update antigravity version lookup
… capabilities - Added a Go scheduler plugin demonstrating CLIProxyAPI capabilities, such as `plugin.register`, `plugin.reconfigure`, and `scheduler.pick`. - Implemented methods for plugin configuration, built-in scheduler delegation (`fill-first`, `round-robin`), dynamic candidate selection, and error handling. - Extended `pluginhost` with scheduler handling, candidate normalization, and fallback mechanisms. - Included examples, tests, and detailed documentation for scheduler usage and implementation.
…fast-path tests - Added `pluginSchedulerState` interface with `HasScheduler` method for improved plugin scheduler state checks. - Updated `Manager.hasPluginScheduler` to handle `HasScheduler` logic. - Implemented and tested fast-path handling for inactive plugin schedulers, including mixed provider scenarios. - Expanded unit test coverage to ensure correct behavior in various scheduler states.
…original request support - Added `opts.OriginalRequest` handling to `applyResponseInterceptors` for improved context passing. - Introduced new test `TestApplyJSBeforeRequestUsesReturnedCtxBody` to validate JavaScript interceptor behavior. - Updated JavaScript-based handler to safely rewrite sensitive content and headers in requests. - Refined interceptor logic to ensure consistent state retention across request processing.
… and removing `RoundRobinSelector` - Removed `pluginDelegateRoundRobin` and related logic to streamline plugin scheduler management. - Consolidated scheduler strategies under `builtinSchedulerStrategy` with `pickViaBuiltinScheduler`. - Introduced new methods `pickSingleWithStrategy` and `pickMixedWithStrategy` for strategy-specific behavior. - Updated tests to reflect changes, including added coverage for round-robin and mixed-provider scenarios. - Improved maintainability by unifying scheduling logic and reducing redundant structures.
…rs and JS engine logging - Added `HostCallbackID` to request, response, and stream chunk interceptors for enhanced context tracking. - Updated JavaScript engine to support custom console logging with `HostCallbackID` forwarding. - Introduced tests verifying proper integration of `HostCallbackID` in all interceptor flows and engine logging. - Enhanced logging and error handling for consistent callback-related logic implementation.
…agement API - Added `resources` field in `management.register` for defining browser-accessible resources. - Updated examples and documentation to reflect resource-based paths under `/v0/resource/plugins/<pluginID>/...`. - Replaced legacy `GET` menu routes with resource-based implementations for consistent plugin behavior. - Enhanced request handling for resource paths, including proper response headers and streamlined test coverage.
- Added new model `Claude Fable 5` to `models.json` with enhanced reasoning and long-horizon capabilities. - Included detailed parameters such as context length, max completion tokens, and thinking level configurations.
…st-id fix(logging): track Codex backend request IDs
…eflight` - Introduced `singleflight.Group` to prevent redundant token refresh calls across multiple auth implementations (`antigravity`, `kimi`, `xai`, `codex`). - Added tests to verify shared upstream calls during concurrent refresh requests. - Refactored token refresh logic to centralize and standardize deduplication mechanisms.
- Updated `README.md`, `README_JA.md`, and `README_CN.md` to include Unity2.ai sponsorship information. - Highlighted features, benefits, and registration perks offered by Unity2.ai. - Added Unity2.ai logo (`unity2.jpg`) to the project assets.
…s and enhance format handling - Introduced `applyRequestAfterAuthInterceptor` to modify requests after credential selection and before executor translation. - Added `InterceptRequestAfterAuth` method across plugin adapters with corresponding tests for context validation. - Enhanced format resolution logic (`requestToFormat`) to support additional providers and formats. - Updated JavaScript handler to include a new `on_after_auth_request` hook for post-auth request handling. - Refactored interceptor methods for clarity and better encapsulation of request/response lifecycles.
…nse chunks - Added tests (`TestCliFinishReasonOnlyOnFinalChunk`, `TestGeminiFinishReasonOnlyOnFinalChunk`) to validate correct `finish_reason` and `native_finish_reason` assignment. - Refactored Gemini and CLI translators to track `SawToolCall` and `UpstreamFinishReason` for accurate final-chunk determination. - Improved response parsing logic to align with upstream metadata and provide consistent reasoning on chunk outputs.
- Implemented logic to aggregate text blocks until `message_stop` for improved consistency. - Introduced support for message annotations like `citations_delta` in content responses. - Added methods (`finalizeAssistantMessage`, `appendMessageAnnotation`) to handle message grouping and annotation appending cleanly. - Updated unit tests to verify message aggregation, annotation handling, and suppression of unwanted native events. Closes: #3801
…tion support - Introduced `HasStreamResponseTransformer` and `HasNonStreamResponseTransformer` to handle streaming and non-streaming transformations. - Updated `executorResponseTranslatorExists` logic to correctly validate stream-specific transformers. - Enhanced `TranslateStream` to suppress raw fallback when registered native transformers return empty output. - Added comprehensive tests (`TestHasResponseTransformerChecksConcreteResponseKinds`, `TestHasResponseTransformerIgnoresEmptyRegistration`) for stream and non-stream transformer validation.
feat(auto-updater): refactor skip logic and add unit tests for autoUpdateSkipReason
…ple and API handlers - Added an example plugin `host-model-callback` in Go to summarize host model callbacks. - Implemented `cliproxy_plugin_init`, `cliproxyPluginCall`, and other plugin functions for callback handling. - Introduced API handlers for `ModelExecution` and `ModelExecutionStream` with support for both streaming and non-streaming requests. - Included unit tests (`model_execution_test.go`) to validate execution logic and streaming responses.
…enable targeted interceptor skipping - Updated host model callback logic to skip originating plugin's interceptors during nested model executions. - Added `SkipInterceptorPluginID` field to plugin API structs for controlling interceptor bypass behavior. - Introduced supporting logic in host API handlers, plugin host registry, and callback contexts to identify and skip specific plugins. - Enhanced unit tests across plugin host, API handlers, and execution paths to verify interceptor skipping behavior and plugin isolation. - Revised documentation to clarify non-recursive behavior of host model callbacks and the use of `SkipInterceptorPluginID`.
…ndling of pending tool calls - Introduced test scenarios to validate `previous_response_id` injection during incremental and non-incremental requests. - Verified behavior for pending tool calls, including proper inclusion or exclusion in websocket requests. - Updated websocket handling logic to track `lastResponseID` and `pendingToolCallIDs`. - Added utility functions for pending tool call validation and cleanup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
router-for-me/CLIProxyAPIatv7.1.68(ed52c614) into the Plus fork_no-pluginbuilds and keeping Docker CGO-enabledCloses #108
Closes #91
Validation
go build ./...go test ./cmd/server -count=1go test ./internal/api/handlers/management ./internal/runtime/executor ./internal/registry ./internal/watcher ./sdk/cliproxy/...go test ./... -count=1 -timeout 10mgoreleaser checkgit diff --cached --checkrg -n "^(<<<<<<<|=======|>>>>>>>)" .git merge-base --is-ancestor ed52c6147cdffdf18a9fe0cea106616a83113412 HEAD