From 5226ec481942e221899d65ff20e3e23d1cd9fb74 Mon Sep 17 00:00:00 2001 From: Torres Date: Thu, 12 Nov 2026 09:38:00 -0400 Subject: [PATCH] fix(agent): /api/agent/run defaults to live when OPENROUTER_API_KEY is configured (was always mock) --- app/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api.py b/app/api.py index 63cba69..38ca71b 100644 --- a/app/api.py +++ b/app/api.py @@ -633,7 +633,9 @@ def create_app(db_path, img_dir, state_dir=None): @app.post('/api/agent/run') def agent_run(body: dict): - source = body.get('source', 'mock') if isinstance(body, dict) else 'mock' + source = body.get('source') if isinstance(body, dict) else None + if source is None: + source = 'live' if live_configured() else 'mock' if source not in ('mock', 'live'): raise HTTPException(status_code=400, detail='source must be mock|live')