Skip to content

[Bug]: When the session interrupted, continue will say tool error #240

@tian-jie

Description

@tian-jie

What happened?

If the agent loop be broken, the session cannot continue. any request will show the error
ℹ error: Network error: Connection error.. Check your internet connection and try again.
ℹ Network error: Connection error.. Check your internet connection and try again.

continue
ℹ error: API error: Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by
tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages:
call_vYgnUxusbvFrP1KVtuS8saiV, call_mAMZXPOIjqrJXcpQst7O5R4Q, call_8jzsDD2kAS17pfpJfWDMYAhV,
call_b0dPn5ZR459Qt02uUfeSJ5wX", 'type': 'invalid_request_error', 'param': 'messages.[55].role', 'code': None}}
ℹ API error: Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by tool
messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages:
call_vYgnUxusbvFrP1KVtuS8saiV, call_mAMZXPOIjqrJXcpQst7O5R4Q, call_8jzsDD2kAS17pfpJfWDMYAhV,
call_b0dPn5ZR459Qt02uUfeSJ5wX", 'type': 'invalid_request_error', 'param': 'messages.[55].role', 'code': None}}

Steps to reproduce

  1. Run ohmo
  2. submit a request
  3. It entering the agent loop...
  4. break the internet connection or something else that make the LLM api error
  5. I ask for continue

In this case, it will only show the error but cannot continue.

ℹ error: Network error: Connection error.. Check your internet connection and try again.
ℹ Network error: Connection error.. Check your internet connection and try again.

continue
ℹ error: API error: Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by
tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages:
call_vYgnUxusbvFrP1KVtuS8saiV, call_mAMZXPOIjqrJXcpQst7O5R4Q, call_8jzsDD2kAS17pfpJfWDMYAhV,
call_b0dPn5ZR459Qt02uUfeSJ5wX", 'type': 'invalid_request_error', 'param': 'messages.[55].role', 'code': None}}
ℹ API error: Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by tool
messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages:
call_vYgnUxusbvFrP1KVtuS8saiV, call_mAMZXPOIjqrJXcpQst7O5R4Q, call_8jzsDD2kAS17pfpJfWDMYAhV,
call_b0dPn5ZR459Qt02uUfeSJ5wX", 'type': 'invalid_request_error', 'param': 'messages.[55].role', 'code': None}}

Environment

windows 11
OpenHarness: v 0.1.7

Relevant logs or screenshots

ℹ error: Network error: Connection error.. Check your internet connection and try again.
 ℹ Network error: Connection error.. Check your internet connection and try again.

 > continue
 ℹ error: API error: Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by
 tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages:
 call_vYgnUxusbvFrP1KVtuS8saiV, call_mAMZXPOIjqrJXcpQst7O5R4Q, call_8jzsDD2kAS17pfpJfWDMYAhV,
 call_b0dPn5ZR459Qt02uUfeSJ5wX", 'type': 'invalid_request_error', 'param': 'messages.[55].role', 'code': None}}
 ℹ API error: Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by tool
 messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages:
 call_vYgnUxusbvFrP1KVtuS8saiV, call_mAMZXPOIjqrJXcpQst7O5R4Q, call_8jzsDD2kAS17pfpJfWDMYAhV,
 call_b0dPn5ZR459Qt02uUfeSJ5wX", 'type': 'invalid_request_error', 'param': 'messages.[55].role', 'code': None}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions