Skip to content

Luna Reserve capability is bound to codexDesktopAuthless, a flag documented as controlling Codex app sign-in #4961

Closed
2 of 2 issues completed

Description

@lidge-jun

Area

Catalog / models

What are you trying to accomplish?

I want to know, from the outside, whether Luna Reserve support is available on an install — and
I want that answer to depend on something that is about Luna Reserve.

Today it depends on codexDesktopAuthless, a switch whose entire documented purpose is
unrelated: "inject the dedicated opencodex provider with requires_openai_auth = false so
Desktop opens without a ChatGPT login"
(docs-site/src/content/docs/reference/configuration/server.md:32). Nothing in that sentence,
or in its ocx system settings --desktop-authless on spelling, tells an operator that it is
also the master switch for Reserve.

This is filed as a coupling defect, not a feature request. I am deliberately not proposing a
design; I think the problem should be recorded before anyone reaches for a fix.

What prevents this today?

Two capabilities ride one flag.

isCodexReserveRequestEligible (src/codex/loopback-target.ts:19-24) gates every Reserve
affordance on three conditions, of which the flag is one:

export function isCodexReserveRequestEligible(
  config: Pick<OcxConfig, "codexDesktopAuthless" | "runtimeRole">,
  admission: Pick<DataPlaneAdmission, "source"> | undefined,
): boolean {
  return config.codexDesktopAuthless === true && config.runtimeRole !== "client"
    && admission?.source === "loopback";
}

The catalog half is gated the same way through isEffectiveCodexDesktopAuthless
(src/codex/loopback-target.ts:93-98), which createReserveCatalogProjection consults first
(src/codex/catalog/reserve.ts:25).

Everything downstream inherits it: the Reserve catalog row; the main-credential substitution
customReserveForward (src/server/responses/compact.ts:672-674); the Reserve authorization
handshake via requiresReserveAuthorization (src/codex/auth-context.ts:552); the
vision-helper refusal (src/codex/loopback-target.ts:15); the reserveCompatibility settings
passed to web search and vision (src/web-search/index.ts:270, src/vision/plan.ts:246); and
the search path at src/server/search.ts:105.

What makes the coupling sharp rather than merely untidy is that on a default loopback install
the flag is the only remaining condition. isEffectiveCodexDesktopAuthless reduces to
codexDesktopAuthless === true && runtimeRole !== "client" && !shouldInjectApiAuthHeader(config),
and shouldInjectApiAuthHeader returns false for a loopback hostname with no dedicated
listener. A stock ocx ensure install therefore already satisfies every condition for Reserve
except an opt-in that is about something else.

What should OpenCodex do?

Observably: whether Luna Reserve is available should be decided by, and reported in terms of,
Reserve's own preconditions — not by a switch documented as controlling whether the Codex app
asks for a sign-in. An operator reading the configuration reference should be able to tell which
setting governs Reserve, and an operator who changes one of the two capabilities should be able
to predict what happens to the other.

I am explicitly not proposing how to get there, and I would rather this issue not acquire a
design before the problem is agreed. Splitting a shipped flag has migration consequences for
existing configurations that deserve their own discussion.

Example usage or interface

The coupling is what produced two separate bug reports, from two directions, within a day.

#4811 — flag on, Reserve still absent. Authless is effective, but the Reserve projection
is account-qualified and codexAccountNamespaces is empty on a fresh install, so
mainSelectors is empty and createReserveCatalogProjection returns undefined. The operator
turned on the switch they were told governs this and got nothing.

#4940 — flag off, Reserve inert and the failure is attributed upstream:

429  openai-<acct>/gpt-reserve  3915ms  routeKind=native
errorCode=rate_limit_exceeded  upstreamError="The usage limit has been reached"

That reporter is on a stock loopback install with codexDesktopAuthless unset. Because the flag
is off, isCodexReserveRequestEligible is false, no Reserve authorization is attempted, and
gpt-reserve is forwarded as an ordinary native model. Nothing in the error names the setting
that would have changed the outcome.

Both reports describe the same underlying shape: a capability whose availability is decided
somewhere the operator has no reason to look.

Alternatives or workarounds

An operator can set codexDesktopAuthless: true to obtain Reserve, but that also changes how
the Codex app authenticates, which is a separate decision they may not want to make. There is no
way to take one without the other, and no diagnostic that connects the two.

Additional context

All references above were read at dev a0f611d4aceb9476d44268e43722273b7b211846. No runtime
evidence is claimed; every statement here is from source.

Checks

  • I searched existing issues and documentation.
  • This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
  • I removed secrets and personal data.

Sub-issues

Sub-issues

2 of 2 Issues completed
Loading 2 sub-issues

Activity

  1. added
    enhancement
    on Sep 17, 2026
  2. added
    account-pool
    catalog
    tools
    on Sep 17, 2026
  3. added
    priority: P2
    on Sep 24, 2026
  4. lidge-jun commented on Sep 27, 2026

    @lidge-jun
    OwnerAuthor

    Release train 4 (account-pool lane) confirmed that the coupling is still present on dev: src/codex/loopback-target.ts and src/codex/catalog/reserve.ts gate every Reserve affordance on codexDesktopAuthless. We are keeping this open and changing nothing this train, because removing the check would silently change existing operators' Reserve entitlement.

    A fix needs:

    • A separate Reserve capability setting, with a migration that preserves today's behavior for installs that have authless on.
    • Catalog advertisement and request authorization using the same eligibility predicate.
    • Tests for both combinations of the two settings.

    #5879 would make this more pressing, since it toggles the flag automatically.

  5. added
    needs-design
    on Oct 6, 2026
  6. lidge-jun commented on Oct 6, 2026

    @lidge-jun
    OwnerAuthor

    Maintainer note (interview 2026-10-06): keeping open with needs-design.

    Reserve is still coupled to codexDesktopAuthless on current dev (~0% toward a separate capability). Needs a migration-preserving design before implementation.

  7. lidge-jun commented on Oct 28, 2026

    @lidge-jun
    OwnerAuthor

    I checked dev at fdc6dd82d930295880dcf6d10bbb9f2c61994574. The coupling remains: request eligibility reads codexDesktopAuthless in src/codex/loopback-target.ts:50, while catalog projection uses the effective authless setting in src/codex/catalog/reserve.ts:25. The refusal still recommends --desktop-authless (src/codex/loopback-target.ts:8). Actual Reserve permission remains a separate, credential-bound upstream check (src/codex/reserve-availability.ts:82); enabling a capability must never manufacture that permission.

    Two migration options fit the maintainer's requirement:

    • Add an optional Reserve boolean whose missing value continually inherits authless. This preserves old configurations with little migration machinery, but future authless changes would still change Reserve availability, leaving the central coupling unresolved.
    • Add an independent codexReserveEnabled boolean and migrate legacy configurations once. Before any authless-setting mutation, materialize the old boolean value into the new capability, preserving explicit new values. New configurations start disabled. Persist a migration version so deleting the new field cannot accidentally reactivate inheritance.

    I recommend the second option. Run the projection inside the existing configuration mutation/publication discipline, including import and reload entry points; do not save an earlier in-memory snapshot over newer settings. Keep explicit false persisted. After migration, changing authless in either direction must leave Reserve unchanged. A migration write failure must remain visible and prevent a misleading successful settings receipt.

    The smallest coherent slice is a migration helper under src/config/, wiring through src/config.ts and src/config/persisted-mutation.ts, schema/types and settings exposure, plus the Reserve predicates and refusal text in src/codex/loopback-target.ts and catalog projection. Share the capability/role/listener eligibility logic between catalog and request authorization, while retaining runtime listener admission as authority. Preserve account-qualified rows, main selectors, upstream authorization and helper restrictions; this does not reopen the rejected bare-row proposal in #3844.

    Prove the slice with a new tests/config/reserve-capability-migration.test.ts and the existing reserve-catalog, reserve-auth-context and reserve-helper-boundary suites: all four explicit flag combinations, legacy on/off/unset, repeated migration, persisted disable, reload/import and failed publication. Register the new test in both layout manifests and update configuration/operator documentation. This is a source-based design; execution has not been performed.

  8. lidge-jun commented on Nov 16, 2026

    @lidge-jun
    OwnerAuthor

    Owner decision (lidge-jun, 2026-11-16): introduce an independent Reserve setting and migrate the current codexDesktopAuthless value into it once, so the two settings no longer move together.

  9. added a commit that references this issue on Nov 16, 2026
    5b864ad
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

    account-poolcatalogenhancementneeds-designpriority: P2tools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions