debug: trace before and after invoke

This commit is contained in:
opencode committed 2026-03-23 18:29:01 +01:00
1 parent fbc19aef23
commit a0ce57132d
1 file changed
+4 -2
+4 -2
View File
@@ -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: