Repository navigation
Conversation
Member
|
@Linux2010 can you please create an issue for this ? |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Linux2010
force-pushed
the
codex/fix-encoded-task-action-routing
branch
from
November 19, 2026 11:28
cc5111b to
651bcd2
Compare
Signed-off-by: andy <linux2011@qq.com>
Linux2010
force-pushed
the
codex/fix-encoded-task-action-routing
branch
from
November 19, 2026 11:39
651bcd2 to
5f60e60
Compare
muscariello
reviewed
Nov 19, 2026
muscariello
left a comment
Member
There was a problem hiding this comment.
The routing is correct: has_task_action looks at the raw last path segment and treats only a literal :cancel or :subscribe as an action, so foo%3Asubscribe stays an ID. The test table (%3A, mixed case, double encoding, a query string) covers the cases that matter.
- No linked issue yet. Please open one with what a client observes today, which request reaches which handler. Task IDs are server-minted UUIDs by default, so this needs an executor that issues IDs with a colon; saying how a deployment gets there shows why it is worth the extra code.
- The
has_task_action(...) && let Some(..) = ….strip_suffix(…)pair is written three times. One helper that returns the stripped ID would keep the two checks from drifting apart. percent-encodingbecomes a direct dependency ofa2a-server. It is already in the lock file, so no new package, but it is worth a line in the description.
The a2a-server suite passes locally on this head, including the new tests.
Signed-off-by: andy <linux2011@qq.com>
This branch has not been deployed
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.
Fixes #564
Summary
The HTTP+JSON router interprets task IDs after URL decoding, so a GET for
foo%3Asubscribesubscribes tofoo, and a POST tofoo%3Acancelcan cancelfooinstead of treating the encoded colon as part of the ID.Although
DefaultRequestHandlerinitially allocates a UUIDv7, anAgentExecutorcan emit aStreamResponse::Taskwith a customTask.id; the handler currently saves that task under the emitted ID and returns it to the caller. A new end-to-end regression exercises an executor returningfoo:subscribeand the subsequent encoded GET. Imported task stores and custom handlers are other ways a deployment can expose such IDs.A shared helper identifies a literal action separator in the raw final path segment, checks the decoded action name, and strips it from the decoded ID. This preserves valid percent-encoded action characters while distinguishing an encoded colon in an ID. Regression coverage also checks operation and ID routing for nested routes, tenant paths, query strings and double encoding.
percent-encodingis now a direct dependency ofa2a-server; it was already present inCargo.lock, so this adds no new locked package.Validation
main(404 instead of 200) and passes with this fix.cargo test -p a2a-server-lf --locked --offline(283 unit tests, 8 integration tests and 1 doc test passed, using the local cached registry mirror).cargo clippy -p a2a-server-lf --all-targets --locked --offline -- -D warnings(using the local cached registry mirror).cargo fmt --all -- --checkandgit diff --check.