Skip to content

[Bug]: messaging-remote-send test intermittently reports an unhandled remote_auth_failed #7809

Closed

Description

@lidge-jun

Client or integration

Other

Area

Other

Summary

tests/codex-integration/messaging-remote-send.test.ts ("revoked peers and missing owners cannot submit, enable/start is never inferred") failed once on Linux CI (run 40419760194, job 121911066526) with an unhandled LocalMessagingError code remote_auth_failed raised from src/messaging/remote-auth.ts (fail()), although sendRemoteMessage maps that failure into its receipt. A source review found no second escaping promise, and the test passed 100/100 repeats on WSL and in its full 12-file CI batch with Bun 1.4.4, so the mechanism is still unknown. This issue tracks the root cause; the code has not changed since #6891.

Reproduction

Not consistently reproducible. Seen once in CI on Linux; repeated local runs pass.

Version

2.93.0

Operating system

Ubuntu (GitHub-hosted runner)

Provider and model

No response

Logs or error output

LocalMessagingError: remote_auth_failed (src/messaging/remote-auth.ts, authenticatedRemoteSocket fail())

Screenshots and supporting files

No response

Redacted configuration

n/a

Checks

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

Activity

  1. lidge-jun commented on Oct 27, 2026

    @lidge-jun
    OwnerAuthor

    Fixed on dev by #7820 (a5ecb91); details below.

  2. lidge-jun commented on Oct 27, 2026

    @lidge-jun
    OwnerAuthor

    Fixed on dev by #7820 (a5ecb912928df697ec0bb0645ff74e6e121b8a5a).

    The mechanism was a fixture port collision. remoteMessagingPair() chose both co-located owner ports with remotePortCandidate(), which binds port 0, reads the number and releases it, so two back-to-back calls could return the same port. Bun binds both owners to it without EADDRINUSE, so connections reached the wrong owner. Authentication then failed during the awaited owner setup, before the sendRemoteMessage receipt mapping, which is why the failure surfaced as an unhandled remote_auth_failed. Forcing equal owner ports reproduces the CI stack. The fixture now holds the first port exclusively while choosing the second. No product promise escapes: 180 forced event orderings in authenticatedRemoteSocket produced no unhandled rejection.

    The same release-before-bind pattern in the product's SSH tunnel setup is tracked separately in #7845.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions