Repro: define an async APIRouter handler that awaits/calls a client whose futures belong to the uvicorn loop, include the router, and invoke it. The wrapper is treated as sync and runs in Starlette's threadpool, producing no event loop / Future attached to a different loop failures. Registering the same handler through native @rt on the app preserves async execution. Full integration notes: https://github.com/lgs/iii-fasthtml-frontend/blob/main/docs/ARCHITECTURE.md#11-platform-quirks-discovered-all-worked-around-in-code. Expected: APIRouter preserves coroutine handlers.
Repro: define an async APIRouter handler that awaits/calls a client whose futures belong to the uvicorn loop, include the router, and invoke it. The wrapper is treated as sync and runs in Starlette's threadpool, producing no event loop / Future attached to a different loop failures. Registering the same handler through native @rt on the app preserves async execution. Full integration notes: https://github.com/lgs/iii-fasthtml-frontend/blob/main/docs/ARCHITECTURE.md#11-platform-quirks-discovered-all-worked-around-in-code. Expected: APIRouter preserves coroutine handlers.