You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTTP+JSON task routing treats encoded colons in task IDs as action separators #564
The HTTP+JSON router selects task operations after decoding the final path segment. A percent-encoded colon that belongs to a task ID can therefore be mistaken for the literal separator before an action suffix, causing the request to reach a handler for a different task.
How a task ID containing a colon can arise
DefaultRequestHandler normally creates a UUIDv7 before invoking the executor. However, an AgentExecutor can emit a StreamResponse::Task containing its own Task.id; the current handler persists that task under the emitted ID and returns it to the caller. For example, an executor returning a completed task with ID foo:subscribe produces a task addressable by that ID. Tasks imported into a custom TaskStore or served by a custom RequestHandler can also have such IDs.
Reproduction
Have an executor emit a task snapshot with ID foo:subscribe in response to POST /message:send; the response contains that ID.
Send GET /tasks/foo%3Asubscribe to retrieve it.
Separately, if a task foo exists, send POST /tasks/foo%3Acancel.
Expected behavior
An encoded colon is part of the task ID. The GET should invoke get_task for foo:subscribe; the POST without a literal action separator should be rejected as an unsupported task action and must not cancel foo.
Actual behavior on the unfixed main branch
The GET is dispatched to subscribe_to_task for foo rather than get_task for foo:subscribe. In a reproduction using the default handler and the executor above, the GET returns 404 even though the returned task exists. The POST is dispatched to cancel_task for foo, potentially cancelling a different task.
Proposed fix and regression coverage
Identify action separators in the raw final path segment before operating on the decoded ID. Existing PR: #559. Its tests cover nested routes, tenant paths, query strings, double encoding, and a task snapshot emitted by a custom executor.
Activity