Skip to content

Commit 321ca06

Browse files
gabrycinaclaude
andcommitted
fix(claude-agent): warn on empty result, debug-log hook skips
- activities.py: log WARNING when Claude returns 0 messages (catches silent failures from model connectivity issues e.g. VPN/proxy down) - hooks.py: log DEBUG when pre/post_tool_use hooks bail early due to missing task_id, making it visible why tool call logs aren't appearing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 89097c0 commit 321ca06

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ async def run_claude_agent_activity(
145145
await handler.cleanup()
146146

147147
results = handler.get_results()
148+
if not results.get("messages"):
149+
logger.warning(
150+
f"[run_claude_agent_activity] Claude returned 0 messages — "
151+
f"possible model connectivity issue (task_id={task_id}, workspace={workspace_path})"
152+
)
148153
logger.debug(f"Returning results with keys: {results.keys()}")
149154
return results
150155

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ async def pre_tool_use(
6666
Empty dict (allow execution to proceed)
6767
"""
6868
if not self.task_id or not tool_use_id:
69+
logger.debug(f"Hooks skipping pre_tool_use — task_id={self.task_id}, tool_use_id={tool_use_id}")
6970
return {}
7071

7172
tool_name = input_data.get("tool_name", "unknown")
@@ -133,6 +134,7 @@ async def post_tool_use(
133134
Empty dict
134135
"""
135136
if not self.task_id or not tool_use_id:
137+
logger.debug(f"Hooks skipping post_tool_use — task_id={self.task_id}, tool_use_id={tool_use_id}")
136138
return {}
137139

138140
tool_name = input_data.get("tool_name", "unknown")

0 commit comments

Comments
 (0)