yangjj-iso opened a new pull request, #7676: URL: https://github.com/apache/shenyu/pull/7676
Fixes #6470. AI Proxy's runtime resolver reads plugin defaults from `Singleton`, but its plugin handler never populates that value. A selector that omits provider/base URL/key/model therefore fails with HTTP 502 even when the corresponding defaults are configured on the plugin. - Parse plugin configuration updates into a volatile snapshot owned by `AiProxyPluginHandler`, and wire the runtime resolver to that same handler through the starter. - Resolve a separate copy for each request, retain selector-over-global precedence, and replace snapshots on updates so omitted fields cannot retain old credentials. Clear defaults on blank/null configuration, disable and deletion; keep separate handler instances isolated. - Remove the unused process-wide `Singleton` lookup. Document global JSON configuration, existing selector defaults and the shared-handler requirement for programmatic construction. Validation: - Added real loopback HTTP regressions for plugin-only defaults and partial selector overrides. Both fail with **502 before the fix** and succeed with **200 after the fix**, asserting the actual upstream authorization header, routed model, token limit and response body. No external AI API is called. - Added coverage for configuration replacement/clearing, disable/re-enable/delete, request-copy isolation, separate handler instances and auto-configuration wiring. - **212 tests passed** in a clean wrapper reactor run: the full AI Proxy test suite, starter tests and common plugin subscriber tests; zero failures/errors/skips. - Checkstyle, Apache RAT and `git diff --check` passed. Existing non-null selector values and selector-initialized defaults retain their precedence. This change does not alter provider transport, retry/fallback policy or protocol conversion. -- 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]
