From cb2e4c67e10a7383ff07602fbe8fa4960722caae Mon Sep 17 00:00:00 2001 From: Jiaqiiii523 <293262669+Jiaqiiii523@users.noreply.github.com> Date: Sun, 25 Oct 2026 14:07:52 +0800 Subject: [PATCH] test(chat): keep the attached-conversation cases lint-clean `kernel-static-checks` runs ruff over `tests`, and five one-line statements in this module trip E701/E702. Because `checks` requires that lane and `pytest`/`stage2c-correctness-e2e`/`merge-gate` require `checks`, the whole required set is red on main. Split the statements; fixtures, requests and assertions are unchanged. Verified with ruff 0.15.22 over the CI lint scope, the stage2c dependency lock and top-level module budget invariants, and this file (64 passed). Signed-off-by: Jiaqiiii523 <293262669+Jiaqiiii523@users.noreply.github.com> --- .../test_codex_attached_conversation.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/presentation/test_codex_attached_conversation.py b/tests/presentation/test_codex_attached_conversation.py index 5256a9bc87..11ecac4734 100644 --- a/tests/presentation/test_codex_attached_conversation.py +++ b/tests/presentation/test_codex_attached_conversation.py @@ -68,7 +68,8 @@ def test_managed_directory_keeps_registered_identity_and_original_sessions(tmp_p assert request(path="/api/chat/sessions", query="?goal_id=sample-goal&managed_agent_id=codex")[0] == 409 store.update_session(second["session_id"], status="closed") assert [row["session_id"] for row in request(path="/api/chat/sessions", query=query)[1]["sessions"]] == [first["session_id"]] - value = json.loads(registry.read_text()); value["goals"][0]["goal_instance_id"] = "replacement-lifetime" + value = json.loads(registry.read_text()) + value["goals"][0]["goal_instance_id"] = "replacement-lifetime" registry.write_text(json.dumps(value)) assert request(path="/api/chat/sessions", query=query)[1]["sessions"] == [] assert store.load_session(legacy["session_id"]) == legacy @@ -82,10 +83,14 @@ def test_managed_directory_refuses_changed_identity_without_host_work(tmp_path, store = request.server.chat_store store.create_session(goal_id="sample-goal", agent_id="codex", adapter_kind="codex_app_server", managed_agent_id="worker", managed_workspace_path=str(tmp_path), channel_id="agent.worker", upstream_thread_id="original") - value = json.loads(registry.read_text()); goal = value["goals"][0] - if fault == "unregistered": goal["coordination"]["registered_agents"] = ["peer"] - if fault == "stopped": goal["status"] = "stopped" - if fault == "workspace": goal["repo"] = str(tmp_path / "different") + value = json.loads(registry.read_text()) + goal = value["goals"][0] + if fault == "unregistered": + goal["coordination"]["registered_agents"] = ["peer"] + if fault == "stopped": + goal["status"] = "stopped" + if fault == "workspace": + goal["repo"] = str(tmp_path / "different") registry.write_text(json.dumps(value)) status, result = request(path="/api/chat/sessions", query=f"?goal_id={'foreign' if fault == 'foreign-goal' else 'sample-goal'}&managed_agent_id=worker") if fault == "workspace":