Skip to content

test(gui): remote-link Add child focus-restore case is flaky on macOS #7611

Closed

Description

@lidge-jun

Client or integration

OpenCodex dashboard

Area

Dashboard

Summary

gui/tests/remote-link.test.tsx case "discovery loading, empty setup and rescan retain keyboard-accessible manual entry" is flaky on macOS. After the Add child sheet is cancelled, focus is expected to return to the "Add child" button, but document.activeElement text is sometimes empty. This predates the 2.92.0 train (it fails more often on v2.91.0) and was found during 2.92.0 release-candidate verification at dev 03bcf78. Not release-blocking; CI was green on that head.

Reproduction

cd gui
for i in $(seq 1 20); do bun test --isolate tests/remote-link.test.tsx 2>&1 | grep -q '^ *0 fail$' || echo fail; done | wc -l

Run with the pinned test runner (Bun 1.4.3). Measured failures: 13/20 at dev 03bcf78 and 18/20 at v2.91.0. Also failed once in a full bun run test from gui/ (3492 pass / 1 fail).

Expected: the cancel handler restores focus to the "Add child" trigger every run.
Actual: intermittently no focused element at the assertion at gui/tests/remote-link.test.tsx:931.

Version

dev @ 03bcf78 (2.92.0 candidate); also v2.91.0

Operating system

macOS (arm64)

Provider and model

N/A

Logs or error output

error: expect(received).toContain(expected)
Expected to contain: "Add child"
Received: ""
      at gui/tests/remote-link.test.tsx:931:51
(fail) discovery loading, empty setup and rescan retain keyboard-accessible manual entry

The run prints "An update to FallbackPanel inside a test was not wrapped in act(...)" just before the failure, which suggests focus restore depends on async state settling after the assertion.

Screenshots and supporting files

No response

Redacted configuration

No response

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    guiDashboard, tray, settings UI
    platformOS/service/tray/ACL (Windows-heavy, not Windows-only)
    on Oct 23, 2026
  2. lidge-jun commented on Oct 24, 2026

    @lidge-jun
    OwnerAuthor

    Fixed on dev by #7650 (merge commit a033a1a).

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 workingguiDashboard, tray, settings UIplatformOS/service/tray/ACL (Windows-heavy, not Windows-only)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions