app.py
Handle Route Conflicts
Seton_route_conflict when the base application already defines a path and method used by AgentOS.
"preserve_agentos" is the default.
Keep Existing Application Behavior
AgentOS prepares the supplied FastAPI app in place:
Use AgentOS authorization for runtime access control. Keep product-specific FastAPI dependencies on the custom routes that need them.
Add Middleware
Add FastAPI or Starlette middleware to the base app before callingget_app():