Skip to content

[Bug]: required test-shard is red on main - the accepted-work fence test asserts macOS-only behavior on Linux #7752

Open

Description

@JasonBuildAI

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 on 04c5799b8 across the two completed main runs; the remaining two shards are cancelled by fail-fast.
  • In the latest run, shards 1 and 6 had no other failure (1 failed, 5168 passed and 1 failed, 5179 passed), so this case alone fails those shards.
  • The same failure is present on the previous main commit 26f73056c (Oct 30), so it is not specific to the latest merge.
  • The introducing commit's own test-shard check is cancelled, 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 -q

On 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

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

  1. JasonBuildAI commented on Oct 31, 2026

    @JasonBuildAI
    ContributorAuthor

    Follow-up context from the same run: four of the six test-shard jobs 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.py UTF-8 already covered by #7745, Lark long-return projection). Fixing the fence case alone would not restore the merge gate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions