run_hooks_in_background at the AgentOS level.
What Happens
- The agent processes the request
- The response is sent immediately to the user
- All pre-hooks and post-hooks run in the background
- The user doesn’t have to wait for these tasks to complete
With
run_hooks_in_background=True on AgentOS, all hooks for all agents run in the background. Use the @hook decorator for more granular control over which hooks run in the background.