Skip to content

fix issue #1184 problem 1#1189

Open
xuhuafeifei wants to merge 1 commit intoagentscope-ai:mainfrom
xuhuafeifei:fix_issue_1184_1
Open

fix issue #1184 problem 1#1189
xuhuafeifei wants to merge 1 commit intoagentscope-ai:mainfrom
xuhuafeifei:fix_issue_1184_1

Conversation

@xuhuafeifei
Copy link
Copy Markdown
Contributor

AgentScope-Java Version

io.agentscope:agentscope-parent:pom:1.0.12-SNAPSHOT

Description

Relating to problem 1 in #1184: Need to uniformly configure HTTP proxy across all model implementations

Allow users to configure proxies via ProxyConfig on ChatModel classes such as Anthropic, DashScope, Gemini, Ollama, OpenAI, etc., consistent with the existing Builder pattern usage.

For models like DashScope that already support custom HttpTransport, clearly define the priority between httpTransport() and proxy() (custom transport takes precedence; proxy() may be ignored with a warning logged) to avoid confusion where "a proxy is set but doesn't take effect."

Checklist

Add a proxy(ProxyConfig) method (or equivalent constructor parameter) to each model's Builder, and apply proxyConfig.toJavaProxy() to the internal OkHttp / SDK client (as implemented in each file).

For DashScope: Extract a resolveTransport() method. When only proxy() is set, apply the proxy using a default OkHttpTransport with HttpTransportConfig. If both httpTransport() and proxy() are set, httpTransport() takes precedence and a warning is logged. Paths such as fetching the public key for encryption should use the same resolved HttpTransport.

Add or extend unit tests for the above models to cover proxy configuration and (for DashScope) transport resolution behavior.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

@xuhuafeifei xuhuafeifei requested a review from a team April 11, 2026 03:46
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant