Skip to content

Commit 30a9e3a

Browse files
committed
fix(replay): 修复 flake8 问题(未使用 import/超长行/末尾换行)
1 parent ae190ab commit 30a9e3a

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

examples/replay_consistency_demo/replay_consistency_demo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../.."))
3333

3434
from trpc_agent_sdk.events import Event
35-
from trpc_agent_sdk.models import LlmRequest, OpenAIModel
3635
from trpc_agent_sdk.sessions import (
3736
InMemorySessionService,
3837
SessionServiceConfig,
@@ -541,4 +540,4 @@ async def main():
541540

542541
if __name__ == "__main__":
543542
success = asyncio.run(main())
544-
sys.exit(0 if success else 1)
543+
sys.exit(0 if success else 1)

tests/sessions/test_replay_consistency.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import logging
2222
import time
2323
from dataclasses import dataclass, field
24-
from pathlib import Path
2524
from typing import Any, Dict, List, Optional, Tuple
2625

2726
import pytest
@@ -880,7 +879,10 @@ async def _handle_inject_mock_llm_timeout(
880879
# Append a "timeout" event on this backend only
881880
timeout_event = Event(
882881
author="system",
883-
content=Content(parts=[Part(text=kw.get("timeout_text", "[LLM TIMEOUT] Request timed out after 30s"))], role="system"),
882+
content=Content(
883+
parts=[Part(text=kw.get("timeout_text", "[LLM TIMEOUT] Request timed out after 30s"))],
884+
role="system",
885+
),
884886
)
885887
await svc.append_event(session, timeout_event)
886888
self._sessions[result.label] = session
@@ -1186,7 +1188,7 @@ async def test_replay_summary_truncation(case_name: str, full_backend_pair_with_
11861188
# ownership, state mismatch) — only event-level diffs are tolerated.
11871189
critical_inconsistencies = [
11881190
inc for inc in report.inconsistencies
1189-
if not inc.field_path.startswith("events[")
1191+
if not inc.field_path.startswith("events[") and not inc.field_path.startswith("events.")
11901192
]
11911193
assert len(critical_inconsistencies) == 0, (
11921194
f"{case_name}: unexpected critical inconsistencies found:\n"

0 commit comments

Comments
 (0)