You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(tests): #1804 terminal-activity parity guard doesn't scan client_portal/, which now holds a terminal writer #2131
tests/unit/test_1804_terminal_activity_parity.py enforces the #1804 contract — every writer that wins a terminal CAS on schedule_executions closes the paired agent_activities dispatch row. It walks the tree with:
_SCAN_DIRS= ("services", "routers")
client_portal/ is neither. That was harmless when the module was entitled and lived in the submodule, but ent#356 moved it into OSS core — and #2120 then added a terminal writer to it:
update_execution_status is in the guard's own TERMINAL_WRITERS set. The guard simply never looks at the file.
This is not currently a bug
_fail_unstarted_execution only fires when the turn never reached execute_task, so no dispatch activity exists to close — the same justification the guard already allowlists for routers/chat.py::_raise_ephemeral_exhausted_410. Behaviour today is correct.
The defect is that the guard's coverage assumption has drifted: client_portal/ now holds execution-terminal logic, and the next writer added there gets no protection. That is precisely the recurrence the guard's own docstring argues against —
Companion to #429: [...] A per-site patch would be deleted with its host, leaving no owner. This guard survives, because it is anchored on terminal writes.
A guard that survives its hosts but not its directories has the same hole one level up.
Fix
Add client_portal to _SCAN_DIRS and give _fail_unstarted_execution an explicit ALLOWLIST entry with the lifecycle justification (the guard already asserts every entry carries one ≥60 chars and that the named function still exists).
Consider whether the scan should instead be "every package under src/backend that isn't test/migration scaffolding", so adopting a future module can't silently repeat this.
Acceptance criteria
client_portal/ is scanned
_fail_unstarted_execution allowlisted with a justification proving no dispatch activity exists at that point
The guard's four existing self-tests still pass, including test_allowlist_entries_all_still_exist
Removing the allowlist entry makes the guard fail (i.e. it genuinely covers the new directory)
Activity
fix(tests): guard the directory the #1804 guard wasn't walking (#2131, …
fix(tests): guard the directory the #1804 guard wasn't walking (#2131, …