Skip to content

[V1.3.2] Remove model fail errors from event stream #256

@ahmad-ajmal

Description

@ahmad-ajmal

I do not think we need these model fail issues bloating the agent event stream


11:00:06 [user message from platform: Whatsapp]: [USER SELF-MESSAGE via Whatsapp Web]
Hello agent

INSTRUCTIONS: Reply to the message to the user on Whatsapp Web
11:00:07 [warning]: [REACT] RuntimeError: Unable to generate action decision on attempt 3: Anthropic client was not initialised.. Check LLM configuration, API credentials, and service availability.
Traceback (most recent call last):
  File "D:\Work\CraftOS\CraftBot\agent_core\core\impl\action\router.py", line 592, in _prompt_for_decision
    raw_response = await self.llm_interface.generate_response_async(system_prompt, current_prompt)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Work\CraftOS\CraftBot\agent_core\decorators\profiler.py", line 709, in async_wrapper
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Work\CraftOS\CraftBot\agent_core\core\impl\llm\interface.py", line 489, in generate_response_async
    return await asyncio.to_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
    )
    ^
  File "C:\Users\ahmad\miniconda3\envs\craftbot\Lib\asyncio\threads.py", line 25, in to_thread
    return await loop.run_in_executor(None, func_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ahmad\miniconda3\envs\craftbot\Lib\asyncio\futures.py", line 295, in __await__
    yield self  # This tells Task to wait for completion.
    ^^^^^^^^^^
  File "C:\Users\ahmad\miniconda3\envs\craftbot\Lib\asyncio\tasks.py", line 362, in __wakeup
    future.result()
    ~~~~~~~~~~~~~^^
  File "C:\Users\ahmad\miniconda3\envs\craftbot\Lib\asyncio\futures.py", line 208, in result
    raise self._exception.with_traceback(self._exception_tb)
  File "C:\Users\ahmad\miniconda3\envs\craftbot\Lib\concurrent\futures\thread.py", line 86, in run
    result = ctx.run(self.task)
  File "C:\Users\ahmad\miniconda3\envs\craftbot\Lib\concurrent\futures\thread.py", line 73, in run
    return fn(*args, **kwargs)
  File "D:\Work\CraftOS\CraftBot\agent_core\core\impl\llm\interface.py", line 450, in _generate_response_sync
    raise RuntimeError(str(e)) from None
RuntimeError: Anthropic client was not initialised.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Work\CraftOS\CraftBot\app\agent_base.py", line 470, in react
    await self._handle_conversation_workflow(trigger_data, session_id)
  File "D:\Work\CraftOS\CraftBot\app\agent_base.py", line 895, in _handle_conversation_workflow
    action_decisions, reasoning = await self._select_action(trigger_data)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Work\CraftOS\CraftBot\agent_core\decorators\profiler.py", line 709, in async_wrapper
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Work\CraftOS\CraftBot\app\agent_base.py", line 1030, in _select_action
    action_decisions = await self.action_router.select_action(query=trigger_data.query)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Work\CraftOS\CraftBot\agent_core\decorators\profiler.py", line 709, in async_wrapper
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Work\CraftOS\CraftBot\agent_core\core\impl\action\router.py", line 136, in select_action
    decision = await self._prompt_for_decision(current_prompt, is_task=False)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Work\CraftOS\CraftBot\agent_core\core\impl\action\router.py", line 627, in _prompt_for_decision
    raise last_error
RuntimeError: Unable to generate action decision on attempt 3: Anthropic client was not initialised.. Check LLM configuration, API credentials, and service availability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions