-
Notifications
You must be signed in to change notification settings - Fork 3.2k
get_fast_api_app does not allow injecting a custom A2A task store #4971
Copy link
Copy link
Labels
needs review[Status] The PR/issue is awaiting review from the maintainer[Status] The PR/issue is awaiting review from the maintainerweb[Component] This issue will be transferred to adk-web[Component] This issue will be transferred to adk-web
Description
Summary
get_fast_api_app unconditionally creates an InMemoryTaskStore and InMemoryPushNotificationConfigStore when a2a=True. There is no way for callers to provide their own store implementations.
This becomes a problem in production setups where:
- Multiple replicas need a shared task store so A2A push callbacks can be routed back to the right server
- Operators want task state to survive restarts (e.g. using
DatabaseTaskStorebacked by SQLite or Postgres froma2a-sdk)
Current behaviour
# Inside get_fast_api_app — no way to override
a2a_task_store = InMemoryTaskStore()Expected behaviour
Callers should be able to pass a custom store:
from a2a.server.tasks import DatabaseTaskStore
from sqlalchemy.ext.asyncio import create_async_engine
engine = create_async_engine("sqlite+aiosqlite:///tasks.db")
app = get_fast_api_app(
agents_dir="agents/",
web=True,
a2a=True,
a2a_task_store=DatabaseTaskStore(engine),
)Notes
The lower-level to_a2a() helper already supports this via the task_store parameter added in #3839. This issue tracks extending the same capability to get_fast_api_app.
A fix is proposed in #4970.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs review[Status] The PR/issue is awaiting review from the maintainer[Status] The PR/issue is awaiting review from the maintainerweb[Component] This issue will be transferred to adk-web[Component] This issue will be transferred to adk-web