fix(spawner): §24 v4 仲达review M1(双staticmethod) + S1(TC11)
This commit is contained in:
@@ -171,3 +171,14 @@ class TestCheckCompactInProgressTrajectory:
|
||||
def test_tc10_none_session_file_returns_false(self):
|
||||
"""TC10: session_file 为 None → False"""
|
||||
assert AgentSpawner._check_compact_in_progress_trajectory(None) is False
|
||||
|
||||
def test_tc11_events_without_ts_returns_true(self, tmp_path):
|
||||
"""TC11: 事件有 type 但无 ts 字段 → 无法判断超时 → True(skip)"""
|
||||
turns = [[
|
||||
_make_trajectory_event("session.started"), # 无 ts
|
||||
_make_trajectory_event("context.compiled"), # 无 ts
|
||||
_make_trajectory_event("model.completed"), # 无 ts
|
||||
]]
|
||||
_write_trajectory(tmp_path, _SESSION_ID, turns)
|
||||
session_file = str(tmp_path / _SESSION_ID)
|
||||
assert AgentSpawner._check_compact_in_progress_trajectory(session_file) is True
|
||||
|
||||
Reference in New Issue
Block a user