build_system_prompt was refactored to AIAgent._build_system_prompt but the test still patched the non-existent module-level function.