Skip to content

Commit bbe691e

Browse files
committed
fix(claude-agent): raise error instead of silently returning empty messages
Returning 0 messages means the model was unreachable (VPN down, proxy error, etc). Logging a warning and succeeding caused Temporal to mark the activity as completed, the workflow to continue pointlessly, and the root cause to be invisible. Raising RuntimeError lets Temporal retry the activity or surface the failure clearly in the workflow timeline.
1 parent 321ca06 commit bbe691e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/agentex/lib/core/temporal/plugins/claude_agents/activities.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,10 @@ async def run_claude_agent_activity(
146146

147147
results = handler.get_results()
148148
if not results.get("messages"):
149-
logger.warning(
149+
raise RuntimeError(
150150
f"[run_claude_agent_activity] Claude returned 0 messages — "
151-
f"possible model connectivity issue (task_id={task_id}, workspace={workspace_path})"
151+
f"possible model connectivity issue (task_id={task_id}, workspace={workspace_path}). "
152+
f"Check that the model API is reachable."
152153
)
153154
logger.debug(f"Returning results with keys: {results.keys()}")
154155
return results

0 commit comments

Comments
 (0)