fix(api_server): log warning when compressed response_store persist fails

This commit is contained in:
尘漾 2026-07-17 10:20:52 +08:00 committed by Teknium
parent a26ed50e07
commit 4166fdda6a

View file

@ -3747,8 +3747,12 @@ class APIServerAdapter(BasePlatformAdapter):
len(conversation_history) + 1,
)
full_history = list(_agent_messages)
except Exception:
pass
except Exception as e:
logger.warning(
"Failed to persist compressed response_store snapshot "
"(streaming): %s",
e,
)
_persist_response_snapshot(
completed_env,
conversation_history_snapshot=full_history,
@ -4095,8 +4099,11 @@ class APIServerAdapter(BasePlatformAdapter):
full_history = list(_agent_messages)
if _rotated and _result_sid:
_effective_session_id = _result_sid
except Exception:
pass # Fall back to default behavior
except Exception as e:
logger.warning(
"Failed to persist compressed response_store snapshot: %s",
e,
)
# Build output items from the current turn only. AIAgent returns a
# full transcript in result["messages"], while older/mocked paths may