29899c2aa9
The per-turn `_cleanup_task_resources` unconditionally calls `cleanup_browser`, closing the browser window immediately after each bot reply. This makes headed mode (`AGENT_BROWSER_HEADED=1`) unusable — the window flashes up and disappears on every response. This mirrors the existing VM persistence pattern: skip per-turn cleanup when headed mode is active and let the inactivity reaper handle idle sessions instead. Full-session teardown on gateway shutdown remains unconditional. Also adds `browser.headed` config.yaml support and passes `--headed` to agent-browser in local mode when configured, so users don't need to rely solely on the `AGENT_BROWSER_HEADED` env var. Closes #11020 (lead bug)