镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(server): serve REST tenant routes after the path prefix - #1377

Open
Revinand wants to merge 1 commit into
a2aproject:mainfrom
Revinand:fix/rest-tenant-path-prefix
Open

Revinand wants to merge 1 commit into
a2aproject:mainfrom
Revinand:fix/rest-tenant-path-prefix

Conversation

@Revinand

Copy link
Copy Markdown

Description

create_rest_routes mounted the tenant routes at /{tenant} over routes that already include path_prefix, so with a prefix they were served at /{tenant}{path_prefix}/.... The SDK's REST client sends {path_prefix}/{tenant}/..., so every tenant-scoped request got a 404. This mounts the tenant routes at {path_prefix}/{tenant} over unprefixed routes instead. Without a prefix the routes are the same as before.

A server that sets path_prefix no longer answers tenant requests at /{tenant}{path_prefix}/.... The SDK's REST client doesn't send requests there.

test_rest_endpoints_routing_tenant_with_path_prefix fails on main with a 404. The full test suite passes with 93% coverage. ruff is clean and ty reports no errors.

Fixes #1376 🦕

@Revinand
Revinand requested a review from a team as a code owner October 25, 2026 15:03
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/cluster/database_event_stream.py 92.86% 96.94% 🟢 +4.08%
src/a2a/server/routes/rest_routes.py 83.33% 84.38% 🟢 +1.04%
Total 92.99% 93.03% 🟢 +0.04%

Generated by coverage-comment.yml

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: REST tenant routes are mounted before path_prefix, so tenant requests from the SDK client get 404

2 participants