Repository navigation
[Bug]: required test-shard is red on main - the accepted-work fence test asserts macOS-only behavior on Linux #7752
Description
Preflight
- I searched existing issues and discussions for this behavior.
- This report is not an unpatched security vulnerability.
- The report and attachments contain no credentials or private/internal material.
Issue origin
Observed and reproduced in the hosted Ubuntu test-shard lane, and reproduced locally with the module's non-POSIX skip disabled.
LoopX version or commit
04c5799b8 (current main, LoopX 2.2.0). The defect is present since b95e42f1e (2026-10-29).
Host or runtime surface
Not host-specific. The failing lane runs on ubuntu-latest; the code under test is the macOS native Codex account handoff.
LoopX area
Build, packaging, installer, or CI
Problem
The required Python Tests → test-shard lane fails deterministically on main, so the merge-gate job cannot pass.
tests/presentation/test_codex_accounts.py::test_native_restart_uses_real_accepted_work_fence_before_app_quit (added in b95e42f1e) is collected on every POSIX host because the module only skips non-POSIX (pytestmark = pytest.mark.skipif(os.name != "posix", ...)). It then calls NativeHost.switch, which returns HostError("platform_unavailable") on anything but macOS (packages/loopx-codex-provider-routing/src/loopx_codex_provider_routing/native_host.py, switch). All six parametrizations fail at the first pytest.raises(..., match="waiting_for_idle"), before the accepted-work fence is reached.
Scale and impact:
- The fence case fails in every shard that ran it:
test-shard (1),(3),(4)and(6)failed on04c5799b8across the two completedmainruns; the remaining two shards are cancelled by fail-fast. - In the latest run, shards 1 and 6 had no other failure (
1 failed, 5168 passedand1 failed, 5179 passed), so this case alone fails those shards. - The same failure is present on the previous
maincommit26f73056c(Oct 30), so it is not specific to the latest merge. - The introducing commit's own
test-shardcheck iscancelled, so this test has never run green in CI. - 55 PRs are currently open against
main; every one inherits this red required lane and a failing merge gate. - The assertion that never executes is the automated proof that an account handoff refuses to quit the client while a Chat Turn is accepted (
restart_guard→managed_chat_activation_guard), i.e. the guard that keeps accepted user work from being discarded.
This issue is only about the fence test. The same lane also carries unrelated failures (tests/test_dashboard_command.py selects the host's newest python3.* interpreter; tests/test_loopx_text_io_utf8.py flags loopx/capabilities/benchmark_toolkit/native_codex_process.py:71, already covered by open PR #7745; and a Lark long-return projection timeout).
Minimal reproduction
git checkout 04c5799b8
python3 -m pytest tests/presentation/test_codex_accounts.py -k native_restart -qOn Linux this reports 6 failed, 83 deselected; every case fails with:
AssertionError: Regex pattern did not match.
Expected regex: 'waiting_for_idle'
Actual message: 'platform_unavailable'
On macOS the same command passes.
Expected behavior
The test should exercise the accepted-work fence on every POSIX host where it is collected, in the same way the module's existing client_host fixture already pins sys.platform for the mocked host, or it should not be collected where the feature is unavailable. The required lane should stop failing on this case.
Actual behavior
switch rejects the call with platform_unavailable before restart_guard runs, so all six accepted-work statuses fail without testing the fence.
Sanitized diagnostics
main04c5799b8: https://github.com/loopx-project/loopx/actions/runs/41146897061 (test-shard (1),test-shard (6)), and https://github.com/loopx-project/loopx/actions/runs/41094215932 (test-shard (1),(3),(4)).- Earlier
main26f73056c: https://github.com/loopx-project/loopx/actions/runs/41034255475 (test-shard (1),(2),(4),(6)). - JUnit records name
test_native_restart_uses_real_accepted_work_fence_before_app_quit[<status>]withAssertionError: Regex pattern did not match. - Local run at
04c5799b8: the six parametrizations fail with the same message; with the mocked host platform pinned todarwin, all six get past the platform guard and reachrestart_guardinstead (the local Windows host then stops at the POSIX-only file-trust check).
Additional context
The platform-neutral half of this path (restart_guard, managed_chat_activation_guard, chat_runtime_activation_state) is already exercised on Linux by the client_host tests in the same module. The fence case is the only one that constructs the host without pinning the platform, so the fix is expected to be a one-line pin in the test rather than a product change.
Drafted with AI assistance under human direction and review.
Activity
JasonBuildAI commentedon Oct 31, 2026
Follow-up context from the same run: four of the six
test-shardjobs on https://github.com/loopx-project/loopx/actions/runs/41146897061 were cancelled at the 60-minute job timeout (60.3 min) while still progressing, so the lane is also time-bound. This fence case is one deterministic failure among several (dashboard launcher fixture,native_codex_process.pyUTF-8 already covered by #7745, Lark long-return projection). Fixing the fence case alone would not restore the merge gate.