Skip to content

get_fast_api_app does not allow injecting a custom A2A task store #4971

@STHITAPRAJNAS

Description

@STHITAPRAJNAS

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.

Metadata

Metadata

Assignees

Labels

needs review[Status] The PR/issue is awaiting review from the maintainerweb[Component] This issue will be transferred to adk-web

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions