From a0ce57132db459b8a0153dd562ab06774c541e38 Mon Sep 17 00:00:00 2001 From: opencode Date: Mon, 23 Mar 2026 18:29:01 +0100 Subject: [PATCH] debug: trace before and after invoke --- main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index fd2c18c..8f8b750 100644 --- a/main.py +++ b/main.py @@ -1136,11 +1136,13 @@ def main(): # Otherwise, treat it as a chat message try: + print("MAIN: before invoke") result = agent.invoke({"messages": [HumanMessage(content=user_input)]}) + print(f"MAIN: after invoke, result type={type(result)}") # Extract the AI's response (works for both simple and tool agent) - print(f"MAIN: result keys={result.keys()}") - if "response" in result: + print(f"MAIN: result keys={result.keys() if hasattr(result, 'keys') else 'NO KEYS'}") + if result and "response" in result: # OllamaToolAgent returns a separate response field response_text = result["response"] else: