Skip to content

Phase 2: coordinate concurrent Codex credential refresh across ACP conversations #4171

Closed as not planned

Description

@simonrosenberg

Parent tracker: #4169

Builds on the authoritative credential lifecycle from #4170.

Problem

Each ACP conversation can launch a separate codex-acp process with its own in-memory Codex authentication manager. Two live processes can therefore hold the same refresh-token generation R0 and both attempt to exchange it upstream.

A shared CODEX_HOME, file writeback, or store-level compare-and-swap cannot prevent the second process from presenting R0 to the provider. No production incident has been attributed to this race yet, but current deployment topologies do not provide a single refresh owner.

Scope

  • Establish one refresh authority per underlying Codex subscription credential.
  • Serialize and fence upstream refreshes across every process that can use that credential.
  • Return the current authoritative generation to a caller that presents a stale generation instead of refreshing upstream again.
  • Reconcile all participating working copies with the winning generation.
  • Make lock acquisition, retries, crashes, restarts, and teardown safe.
  • Cover SaaS sandboxes, OSS App Server Docker sandboxes, and direct Agent Server deployments.
  • Cover both brokered CODEX_AUTH_JSON credentials and ambient/shared CODEX_HOME authentication, or explicitly reject an unsupported concurrent path.

Acceptance criteria

  • Two callers holding R0 cause at most one upstream refresh.
  • Both callers converge on the same authoritative successor generation.
  • A stale caller cannot overwrite a newer generation or resurrect a deleted credential.
  • Lock expiry or process failure cannot permit an unfenced stale refresh or leave the credential permanently unavailable.
  • Multi-process tests cover shared-file, local broker, and distributed broker topologies.
  • Credential and broker authorization values never appear in logs or persisted conversation output.

Activity

  1. added
    bug
    acp
    on Jul 21, 2026
  2. all-hands-bot commented on Jul 23, 2026

    @all-hands-bot
    Collaborator

    [Automatic Post]: This issue has been waiting for triage. @xingyaoww @neubig @enyst, could you
    please take a look and add the appropriate priority label when you have a chance?

    This comment was generated by an AI agent (OpenHands) on behalf of the user.

  3. all-hands-bot commented on Jul 24, 2026

    @all-hands-bot
    Collaborator

    [Automatic Post]: This issue has been waiting for triage. @xingyaoww @neubig @enyst, could you
    please take a look and add the appropriate priority label when you have a chance?

    This comment was created by an AI agent (OpenHands) on behalf of the user.

  4. simonrosenberg commented on Aug 7, 2026

    @simonrosenberg
    MemberAuthor

    Closing, evidence-based. This issue's own text already says it: "No production incident has been attributed to this race yet." Production telemetry in OpenHands/enterprise#120 independently confirmed that — zero credential rotations were detected in a 15-day production window, and the concurrent-refresh race this describes requires rotation to be happening at all.

    Not building the concurrent-refresh-owner behavior. Re-open if a real incident ever traces to this specifically.

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

    acpbugsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions