code-to10 reconcile: fix pre-existing worker F821 in playwright skipped-modified log branch

Target-line bug, not introduced by the replay: Worker._tenant_dirs
only receives project_id, yet the script_skipped_modified log line
used task.get("project_id"), raising NameError whenever seeding
reported a tenant-modified script (the refreshed sibling branch was
already fixed to project_id with its own regression test; this test
only covered the refreshed branch, so the full suite stayed green).
Fix mirrors the sibling (project_id) plus a regression test for the
skipped branch. Ruff F821 in worker.py is thereby cleared.
This commit is contained in:
host committed 2026-11-03 02:49:27 +00:00
1 parent 34b9a34896
commit 055da3c2dd
2 files changed
+21 -1

No files matched your search

@@ -71,6 +71,22 @@ class WorkerPlaywrightSeedF821TestCase(unittest.TestCase):
self.assertTrue(any("projA" in line and "playwright_mcp.py" in line
for line in logs.output))
def test_skipped_modified_script_logs_project_id_without_name_error(self):
# Sibling of the refreshed branch: the skipped-modified log
# line still used task.get("project_id") with no task in scope
# (ruff F821), raising NameError whenever seeding reported a
# tenant-modified script. Fixed to project_id, same pattern
# as the refreshed branch above.
worker = self._worker()
with mock.patch("cloud.worker._ensure_playwright_mcp",
return_value={"script_skipped_modified":
["playwright_mcp.py"]}):
with self.assertLogs(worker.logger, level="WARNING") as logs:
dirs = worker._tenant_dirs("projA")
self.assertIn("codex_home", dirs)
self.assertTrue(any("projA" in line and "playwright_mcp.py" in line
for line in logs.output))
def test_no_refresh_still_seeds(self):
worker = self._worker()
with mock.patch("cloud.worker._ensure_playwright_mcp",