-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No error handling around empty messages #36
Comments
I'm having this same issue repeatedly, trying to tweak the code but my skills are limited. It happens if there is no continuation prompt and/or when the orchestrator goes back to the sub-agent (I think). I can't seem to get past it. |
Try adding this error handling to maestro.py:
You wanna add this code around line 117, where the code is sending the a message to the sub-agent. The code there looks like this:
...and doesn't have any error handling. The code I pasted just adds error handling. I just started looking at this project so I don't have the full context of what happens when you return None from this function, but for now it stopped the unhandled exception error. Be on the look out for other side effects. |
I have this same issue. Causing me to chew through token credits :( File "/Users/leon/Projects/External/maestro/maestro.py", line 245, in |
I have also run across this error a number of times.
Traceback (most recent call last):
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestro.py", line 246, in
sub_task_result = haiku_sub_agent(sub_task_prompt, search_query, haiku_tasks, use_search)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestro.py", line 117, in haiku_sub_agent
haiku_response = client.messages.create(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestor01\Lib\site-packages\anthropic_utils_utils.py", line 277, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestor01\Lib\site-packages\anthropic\resources\messages.py", line 681, in create
return self._post(
^^^^^^^^^^^
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestor01\Lib\site-packages\anthropic_base_client.py", line 1239, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestor01\Lib\site-packages\anthropic_base_client.py", line 921, in request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestor01\Lib\site-packages\anthropic_base_client.py", line 1019, in _request
raise self._make_status_error_from_response(err.response) from None
anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages: text content blocks must be non-empty'}}
PS C:\Users\Spocksbrain\Documents\Code_Projects\maestro>
The text was updated successfully, but these errors were encountered: