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
DatabaseTaskStore backed by SQLite or Postgres from a2a-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.
Summary
get_fast_api_appunconditionally creates anInMemoryTaskStoreandInMemoryPushNotificationConfigStorewhena2a=True. There is no way for callers to provide their own store implementations.This becomes a problem in production setups where:
DatabaseTaskStorebacked by SQLite or Postgres froma2a-sdk)Current behaviour
Expected behaviour
Callers should be able to pass a custom store:
Notes
The lower-level
to_a2a()helper already supports this via thetask_storeparameter added in #3839. This issue tracks extending the same capability toget_fast_api_app.A fix is proposed in #4970.