-
Notifications
You must be signed in to change notification settings - Fork 124
Description
Is your feature request related to a problem? Please describe.
In io.a2a.server.agentexecution.RequestContext (a2a-java-sdk-server-common), the current getUserInput(String delimiter) method uses null as a signal to apply a default delimiter ("\n"). This is an unintuitive API contract that forces callers to pass null explicitly to get default behavior, which is not idiomatic Java.
// Current: caller must pass null to use default delimiter
context.getUserInput(null);Describe the solution you'd like
Add a no-argument overload that delegates to the existing method with the default delimiter, without changing the existing signature:
public String getUserInput() {
return getUserInput("\n");
}This allows callers to write:
context.getUserInput(); // default "\n" delimiter
context.getUserInput(" "); // custom delimiterDescribe alternatives you've considered
Replacing the existing method entirely with a cleaner signature that removes the null handling — this would be a breaking change and is not preferred.
Additional context
The existing Javadoc already acknowledges the awkwardness with the null example (context.getUserInput(null); // uses "\n"), which suggests this was recognized as non-ideal at the time of writing. Adding the no-arg overload is fully backward-compatible and requires minimal change.
I'd be happy to submit a PR for this if the proposal is accepted.
Code of Conduct
- I agree to follow this project's Code of Conduct