Skip to content

Conversation

@Aias00
Copy link
Contributor

@Aias00 Aias00 commented Dec 11, 2025

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

Copilot AI review requested due to automatic review settings December 11, 2025 11:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request renames the "ai-proxy-enhanced" module to "ai-proxy", along with introducing comprehensive implementations of AI proxy functionality including configuration management, caching, retry logic, and fallback mechanisms. The PR adds approximately 1,900 lines of new production code and 1,000 lines of test code.

Key Changes

  • Renamed module from shenyu-plugin-ai-proxy-enhanced to shenyu-plugin-ai-proxy in the parent POM
  • Implemented core AI proxy plugin with support for streaming and non-streaming requests, dynamic and admin-configured fallbacks, and proxy API key validation
  • Added comprehensive caching mechanisms for chat clients and API key mappings with configurable size limits and eviction strategies
  • Introduced retry logic with exponential backoff for transient failures and fallback support for non-transient errors

Reviewed changes

Copilot reviewed 1 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pom.xml (parent) Updated module reference from shenyu-plugin-ai-proxy-enhanced to shenyu-plugin-ai-proxy
shenyu-plugin-ai-proxy/pom.xml New module POM with dependencies on Spring AI, reactor, and testing frameworks
AiProxyPlugin.java Main plugin implementation handling request routing, configuration resolution, proxy key validation, and streaming/non-streaming responses
AiProxyPluginHandler.java Plugin data handler managing selector-level configuration and cache invalidation
AiProxyConfigService.java Service for resolving primary and fallback configurations from global, selector, and request-level sources
AiProxyExecutorService.java Execution service implementing retry logic with backoff and fallback strategies for AI calls
ChatClientCache.java Thread-safe cache for ChatClient instances with size-based eviction
AiProxyApiKeyCache.java Singleton cache for proxy-to-real API key mappings with selector-based invalidation
CommonAiProxyApiKeyDataSubscriber.java Subscriber implementation for handling API key data updates and cache synchronization
Test files (5 classes) Comprehensive unit tests covering success scenarios, error handling, edge cases, and null safety

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

@847850277 847850277 self-assigned this Dec 12, 2025
@847850277 847850277 merged commit cdd56c6 into apache:master Dec 12, 2025
42 of 54 checks passed
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.

3 participants