REST transport ignores interceptor changes to URL-bound request fields

Open
#1,329 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Linux2010 is already working on this.

Since Nov 14, 2026.

  • #1330 by @Linux2010 — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
api

Research direction

Start in RestTransport.getTask, where the protobuf builder is intercepted but the URL is built from taskQueryParams instead of the intercepted payload. Run the JUnit HTTP-server regression, which expects GET /tasks/changed and currently gets /tasks/original. Then check the other operations that put IDs or filters into the URL. Done means the URL follows the post-interceptor payload for GetTask and the other affected operations, with the regression passing.

Written by the indexing model from the issue text.

Description

What happened?

The ClientCallInterceptor.intercept contract permits returning a modified payload, but the HTTP+JSON RestTransport builds resource paths and query strings from the original method arguments rather than the post-interceptor payload. An interceptor can therefore change the task ID in the payload and still send the request to the original task.

On main 897835ef664fb5c9fc4e1f5388e88a49c93e743c, a GetTask interceptor like the following receives the protobuf request builder:

@Override
public PayloadAndHeaders intercept(String method, Object payload,
        Map<String, String> headers, AgentCard card, ClientCallContext context) {
    ((org.a2aproject.sdk.grpc.GetTaskRequest.Builder) payload).setId("changed");
    return new PayloadAndHeaders(payload, headers);
}

Call getTask(new TaskQueryParams("original"), null) with this interceptor and capture the request using a local HTTP server. Expected: GET /tasks/changed. Actual: GET /tasks/original, despite the interceptor returning the modified builder. A JUnit HTTP-server regression reproduces this as expected: </tasks/changed> but was: </tasks/original>.

RestTransport.getTask creates and intercepts a protobuf builder, but constructs the URL using taskQueryParams. Other operations that encode IDs or filters into their URL also appear to construct those from the original arguments; each should be checked rather than assuming only GetTask is affected. This can matter for interceptors that rewrite a target or apply a filter, not just logging.

For context, #1327 adds fields to the GetTask payload visible to interceptors but does not make modified fields drive the URL. I have not checked every operation's replacement-payload semantics; this report's demonstrated case is a mutation of the supplied builder.

Code of Conduct
  • I agree to follow this project's Code of Conduct
Dominant language
Java
Stars
514
Forks
200
Avg merge
1d 2h
Merged PRs (30d)
53

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from a2aproject/a2a-java

All issues in a2aproject/a2a-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.