refactor(agent/session_persistence): collapse nested if (SIM102)

This commit is contained in:
Teknium
2026-09-02 19:24:12 -07:00
parent af18f5416b
commit 4e2a701790
+5 -3
View File
@@ -170,9 +170,11 @@ def _db_flush_row(agent, msg: Dict, is_current_turn_user: bool) -> Dict[str, Any
api_content = None
# get_messages_as_conversation replays rows through sanitize_context().strip(); capture the
# sent bytes when they would differ (compared in wire form).
if api_content is None and role in ("user", "assistant") and isinstance(content, str) and content:
if sanitize_context(content).strip() != content.strip():
api_content = content
if (
api_content is None and role in ("user", "assistant") and isinstance(content, str) and content
and sanitize_context(content).strip() != content.strip()
):
api_content = content
# Key order is the divert-JSONL wire order (divert_session_transcript_jsonl).
row = {
"role": role,