Aias00 opened a new issue, #6470:
URL: https://github.com/apache/shenyu/issues/6470
### Current Behavior
The enhanced AI proxy runtime still tries to resolve a global
`AiCommonConfig` from `Singleton.INST`, but the plugin data handler never
stores plugin-level configuration there.
`AiProxyConfigService.resolvePrimaryConfig()` reads and merges global config:
```java
final AiCommonConfig globalConfig = Singleton.INST.get(AiCommonConfig.class);
...
if (Objects.nonNull(globalConfig)) {
primaryConfig.mergeWith(globalConfig);
}
```
However, `AiProxyPluginHandler.handlerPlugin()` intentionally performs no
plugin config handling:
```java
// No global plugin configuration handling is performed.
```
As a result, plugin-level/global AI proxy defaults configured in admin are
not applied at runtime. If a selector relies on global defaults for required
fields such as provider/model/baseUrl/apiKey, `AiProxyPlugin.createChatModel()`
later fails because the resolved config is incomplete.
### Expected Behavior
Either plugin-level AI proxy configuration should be loaded into the runtime
config path used by `resolvePrimaryConfig()`, or the runtime should stop
advertising/depending on a global config merge path.
### Impact
Deployments that configure shared AI proxy defaults at plugin/global level
can fail requests unless every selector repeats a fully populated AI provider
configuration.
### Code Location
-
`shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-proxy/src/main/java/org/apache/shenyu/plugin/ai/proxy/enhanced/service/AiProxyConfigService.java`
- `resolvePrimaryConfig()` reads
`Singleton.INST.get(AiCommonConfig.class)`.
-
`shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-proxy/src/main/java/org/apache/shenyu/plugin/ai/proxy/enhanced/handler/AiProxyPluginHandler.java`
- `handlerPlugin()` does not populate global plugin configuration.
-
`shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-proxy/src/main/java/org/apache/shenyu/plugin/ai/proxy/enhanced/AiProxyPlugin.java`
- `createChatModel()` hard-fails when required provider/factory config is
missing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]