Private
Public Access
0
0

fix(app_controller): restore context_to_send definition in _api_generate (CRITICAL regression from ai_loop_regressions_20260614)

This commit is contained in:
2026-06-15 12:54:11 -04:00
parent 6f4bd75ef9
commit 7b323e3e5f
+4
View File
@@ -275,6 +275,10 @@ def _api_generate(controller: 'AppController', req: GenerateRequest) -> dict[str
"ts": project_manager.now_ts()
})
with controller._disc_entries_lock:
has_ai_response = any(e.get("role") == "AI" for e in controller.disc_entries)
context_to_send = stable_md if not has_ai_response else ""
result = ai_client.send_result(context_to_send, user_msg, base_dir, controller.last_file_items, disc_text, rag_engine=None)
if not result.ok:
err = result.errors[0]