Skip to content

Commit 41d8752

Browse files
qchappCopilot
andauthored
Update src/ai_agent/ui/components.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 6e17783 commit 41d8752

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/ai_agent/ui/components.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ def handle_chat(message: str, history: List[dict], files: List, state_dict: dict
341341

342342
except Exception as e:
343343
log.exception("Error in chat handler")
344-
history.pop() # Remove thinking indicator
344+
if history:
345+
history.pop() # Remove thinking indicator
345346
error_msg = {
346347
"role": "assistant",
347348
"content": (

0 commit comments

Comments
 (0)