feat: add connectTimeout, requestTimeout, and logger options to client builder and transport#79
Open
stenalpjolly wants to merge 1 commit into
Conversation
…t builder and transport
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
Adds
connectTimeout(),requestTimeout(), andlogger()options toMcpToolboxClient.Builder(McpToolboxClientBuilder) and cascades these options down toBaseMcpTransportand allHttpMcpTransportversion delegates (HttpMcpTransportV20241105,HttpMcpTransportV20250326,HttpMcpTransportV20250618,HttpMcpTransportV20251125).Expectation & Implementation
java.util.logging.Loggerinstance for telemetry and logging.connectTimeout(),requestTimeout(), andlogger()methods toMcpToolboxClient.Builderinterface andMcpToolboxClientBuilder.BaseMcpTransport,HttpMcpTransport, and allHttpMcpTransportV*delegate classes acceptingconnectTimeout,requestTimeout, andlogger.HttpClient.Builderwith the specifiedconnectTimeout(defaulting to 10 seconds).HttpRequest.BuilderwithrequestTimeoutduringlistToolsandinvokeToolrequests when specified.activeLoggerinitialized from the provided logger or default class logger.Test cases
testInvokeTool_WithRequestTimeoutinHttpMcpTransportTestto verify that instantiatingHttpMcpTransportwith custom request/connect timeouts successfully applies configurations across transport delegation and completesinvokeToolcalls cleanly.mvn clean test jacoco:report -Dtest="*Test,!*E2ETest" -Dnet.bytebuddy.experimental=trueverifying 129 tests pass cleanly across the SDK.Acceptance criteria
McpToolboxClient.BuilderprovidesconnectTimeout,requestTimeout, andloggerconfiguration methods.Breaking changes
None. Secondary constructors are provided to maintain full backward compatibility for existing transport and client instantiations.