Skip to content

[V1.4.1] Silent context overflow bug in the BytePlus LLM provider #384

Description

@makiroll1125

What happened:
Byteplus LLM provider is repeatedly returning completely empty responses with 200 OK HTTP status, no error code, no content field present in the API response. This occurs randomly on ~18% of inference requests, no pattern observed on prompt length, model parameters or request timing. Failure is silent and not detected by existing retry logic.

What I expected:
Either valid LLM response content is returned, or a proper error status / exception is raised so retry logic can trigger correctly.

Steps to reproduce:

  1. Run any inference request using Byteplus LLM provider
  2. Repeat requests continuously
  3. Observe empty responses returned occasionally

Environment:

  • Branch: V1.4.1

Logs / screenshots:
Image
10:39:33 [action_end]: Action stream_edit completed with output: {
"status": "success",
"message": "Successfully replaced 1 occurrence(s)",
"occurrences_replaced": 1
}.
10:39:41 [error]: [REACT] RuntimeError: Unable to generate action decision on attempt 3: LLM returned empty response. Provider: byteplus, Model: seed-2-0-pro-260328. This may indicate an API error or service unavailability.. Check LLM configuration, API credentials, and service availability.
2026-07-13 10:39:43.638 | INFO | main | agent_core.core.impl.llm.cache.byteplus:_call_responses_api:141 - [BYTEPLUS REQUEST] URL: https://ark.ap-southeast.bytepluses.com/api/v3/responses
2026-07-13 10:39:43.638 | INFO | main | agent_core.core.impl.llm.cache.byteplus:_call_responses_api:142 - [BYTEPLUS REQUEST] Payload: {'model': 'seed-2-0-pro-260328', 'input': [{'role': 'user', 'content': '10:39:33 [agent reasoning]: Now fixing the async modifier on loadEvents method.\n10:39:33 [action_start]: Running action stream_edit with input: {\n "file_path": "D:\\tempCraftBot\\CraftBot\\agent_file...'}], 'temperature': 0.0, 'max_output_tokens': 8000, 'previous_response_id': 'resp_02178390677010240df8d8926005c369421892d4819382e425032', 'caching': {'type': 'enabled'}, 'text': {'format': {'type': 'json_object'}}}
2026-07-13 10:39:45.000 | INFO | main | agent_core.core.impl.llm.cache.byteplus:_call_responses_api:149 - [BYTEPLUS RESPONSE] Status: 429
2026-07-13 10:39:45.001 | INFO | main | agent_core.core.impl.llm.cache.byteplus:_call_responses_api:154 - [BYTEPLUS RESPONSE] Body: {'error': {'code': 'ModelAccountTpmRateLimitExceeded', 'message': 'TPM (Tokens Per Minute) limit of the model seed-2-0-pro is exceeded. Please try again later Request id: 02178390678493122877b9ff06629ca98d99f0267ba452b902808', 'param': '', 'type': 'TooManyRequests'}}
2026-07-13 10:39:45.002 | ERROR | main | agent_core.core.impl.llm.interface:_generate_byteplus_with_session:1683 - Error calling BytePlus Session API for ea05aa:LLMCallType.ACTION_SELECTION: 429 Client Error: Too Many Requests for url: https://ark.ap-southeast.bytepluses.com/api/v3/responses
2026-07-13 10:39:45.032 | INFO | main | app.usage.task_attribution:attribute_usage_to_current_task:41 - [TOKEN_ATTR] task=ea05aa +in=0 +out=0 +cached=0 -> totals: in=11968799 out=51641 cache=11612158
2026-07-13 10:39:45.036 | ERROR | main | agent_core.core.impl.llm.interface:_finalize_session_response:917 - [LLM ERROR] LLM returned empty response. Provider: byteplus, Model: seed-2-0-pro-260328. This may indicate an API error or service unavailability.
2026-07-13 10:39:45.038 | WARNING | main | agent_core.core.impl.llm.interface:_finalize_session_response:919 - [LLM CONSECUTIVE FAILURE] Count: 5/5
2026-07-13 10:39:45.066 | ERROR | main | app.agent_base:_handle_react_error:1513 - [REACT ERROR] Aborted after consecutive failures.
Traceback (most recent call last):
File "D:\tempCraftBot\CraftBot\app\agent_base.py", line 577, in react
await self._handle_complex_task_workflow(trigger_data, session_id)
File "D:\tempCraftBot\CraftBot\app\agent_base.py", line 1107, in _handle_complex_task_workflow
action_decisions, reasoning = await self._select_action(trigger_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\tempCraftBot\CraftBot\agent_core\decorators\profiler.py", line 743, in async_wrapper
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\tempCraftBot\CraftBot\app\agent_base.py", line 1201, in _select_action
return await self._select_action_in_task(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
trigger_data.query, trigger_data.session_id
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "D:\tempCraftBot\CraftBot\agent_core\decorators\profiler.py", line 743, in async_wrapper
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\tempCraftBot\CraftBot\app\agent_base.py", line 1238, in _select_action_in_task
action_decisions = await self.action_router.select_action_in_task(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
)
^
File "D:\tempCraftBot\CraftBot\agent_core\decorators\profiler.py", line 743, in async_wrapper
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\tempCraftBot\CraftBot\agent_core\core\impl\action\router.py", line 306, in select_action_in_task
decision = await self._prompt_for_decision(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<6 lines>...
)
^
File "D:\tempCraftBot\CraftBot\agent_core\core\impl\action\router.py", line 701, in _prompt_for_decision
raw_response = await self.llm_interface.generate_response_with_session_async(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
)
^
File "D:\tempCraftBot\CraftBot\agent_core\decorators\profiler.py", line 743, in async_wrapper
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\tempCraftBot\CraftBot\agent_core\core\impl\llm\interface.py", line 1543, in generate_response_with_session_async
return await asyncio.to_thread(
^^^^^^^^^^^^^^^^^^^^^^^^
...<6 lines>...
)
^
File "C:\Python313\Lib\asyncio\threads.py", line 25, in to_thread
return await loop.run_in_executor(None, func_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python313\Lib\asyncio\futures.py", line 286, in await
yield self # This tells Task to wait for completion.
^^^^^^^^^^
File "C:\Python313\Lib\asyncio\tasks.py", line 375, in __wakeup
future.result()
~~~~~~~~~~~~~^^
File "C:\Python313\Lib\asyncio\futures.py", line 199, in result
raise self._exception.with_traceback(self._exception_tb)
File "C:\Python313\Lib\concurrent\futures\thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "D:\tempCraftBot\CraftBot\agent_core\core\impl\llm\interface.py", line 1358, in _generate_response_with_session_sync
return self._finalize_session_response(response, log_response)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\tempCraftBot\CraftBot\agent_core\core\impl\llm\interface.py", line 924, in _finalize_session_response
raise LLMConsecutiveFailureError(
self._consecutive_failures, last_error_info=error_info
)
agent_core.core.impl.llm.errors.LLMConsecutiveFailureError: Aborted after consecutive failures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions