[Design] Minimum safe Desktop composer compatibility across client updates

Open
#7,587 9 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript

Research direction

Start with the package admission, HTTP controller, usage policy, routing preflight, and macOS RPC consumer boundary linked in the issue; then read the decisions requested for units A–E. The work is to agree on a consumer-facing contract, with several independently reviewable units and explicit dependencies. Done means owners resolve the security and consumer evidence questions and define acceptance against an actual submitted turn; symptom investigation remains in #6196 and identity revocation in #7582.

Written by the indexing model from the issue text.

Description

enhancement streaming

[Design] Minimum safe Desktop composer compatibility across client updates

Area

Multiple areas

What are you trying to accomplish?

Keep a signed-in Codex Desktop usable when the main account has exhausted its allowance but an independently authorized pool account or external provider can serve the selected route. Keep actual usage, credits, spending restrictions and server-side account/provider limits authoritative.

This is the design/security follow-up requested in #7368's closing comment, before adding a dependency or desktop UI. #7368 remains closed. The remaining composer symptom is already tracked in #6196.

What prevents this today?

At dev c51b0b4:

  • Windows admission pins one historical package version. Package identity, supported payloads and composer acceptance are separate claims.
  • HTTP correction covers GET JSON usage and GET SSE usage streams; upgraded sockets remain opaque. POST subscriptions and broker frames are outside that contract.
  • Account-wide consent lasts three minutes. Routing preflight cannot prove a conversation's selected provider.
  • The macOS RPC shim can be attached without seeing gate-bearing messages. Synthetic tests and attachment alone do not establish composer coverage (#6196).

Current status (2026-10-28): identity revocation #7582, fresh package-proof binding #7709, and paired GUI-session authority #7775 are merged. These are bounded completed slices. The maintainer's current disposition explicitly leaves version-independent admission, broker transport, usage consumers and session consent subject to their owner/security decisions. This issue remains open; those merges do not authorize the remaining expansion or establish live composer acceptance.

What should OpenCodex do?

Agree on the smallest consumer-facing contract and review the following units independently. Several can proceed in parallel.

Unit Scope and actual dependency
A. Identity revocation #7582 is merged into dev as bef4f50e281e5b3e240218c83fc4afc8cb8f8751. Preserve its stale-generation protection in later work.
B. Version-independent admission Retain official family/publisher, canonical basename and App-entry checks. A backend-only slice, independent of C/D/E.
C. Bounded broker transport Review dependency choice, fixed-host verified TLS/proxy routing, ordering, binary/text kind, heartbeat, backpressure and cancellation. Keep unrelated upgrades opaque.
D. Usage consumers D-HTTP would add POST subscription handling after proving its cache consumer, without C. D-push requires C and the snapshot/cache contract. Both can retain the existing trial.
E. Session consent Backend lifetime/revocation and capability negotiation can use existing GET/SSE without C/D-push. New UI depends on that contract and the requested design/security review.

Code dependencies are C -> D-push and E-backend -> E-UI. Newer-package activation additionally needs B's admission decision; authoring the other units need not wait. Shared controller edits need integration checks, not a five-PR serial chain.

Only paths shown to populate or update the affected composer's gate/cache should enter correction:

Surface Evidence and minimum treatment
GET /backend-api/wham/usage and GET /backend-api/wham/usage/stream Existing JSON/SSE contract; confirm the affected client consumes it.
POST /backend-api/wham/usage/subscriptions Closed #7368 prototype/tests only. Prove its cache consumer; preserve renewal/generation metadata and request bytes. No WS dependency.
Broker /backend-api/pages/realtime-broker/u<digits>/ws Prototype topic codex-work-usage-push-v1, usage.snapshot and recovered subscribe catchups only. Native consumer/host proof remains required; fixtures do not establish a universal WS or ws.chatgpt.com requirement.
App-server account/rateLimits/read result / account/rateLimits/updated notification Existing macOS projection; only useful where those messages feed the gate.

Partial pushes require a proven merge/retained-state contract; omitted protection data is not authorization. Unrelated topics, unknown schemas, protected states and non-success responses retain original content. UI projections never become pool capacity or billing evidence.

Owner/security decisions requested:

  1. May strict package identity and fail-closed payload validation replace exact-version admission? Define invalidation of any cached, completed package proof.
  2. Which consumer/cache evidence establishes the first supported surface? Leave unproved paths unclaimed.
  3. Approve or reject the WS dependency/host expansion, library and transport bounds. Define broker refresh: closing a shared socket also affects unrelated topics.
  4. Accept or reject account-wide runtime-session consent without per-conversation isolation. Define withdrawal, identity/routing changes, recovery/re-exhaustion, stop/crash and certificate deadlines. Require capability negotiation with older servers.
Example usage or interface

Main account exhausted + valid selected alternate route -> Desktop can submit -> the ordinary proxy dispatch admits or refuses using that route's real credentials and limits. A request that actually needs the exhausted native account still gets its genuine refusal.

Unknown identity/schema, withdrawal or protected spending -> original state remains authoritative. Report response production, native cache update and composer submission separately.

Alternatives or workarounds

Use the existing RPC projection where it reaches the consumer, or retain the existing short trial for a narrowly supported HTTP surface. Authless mode is a different workflow because it changes the signed-in account presentation. Provider inference routing alone cannot repair a turn the client never submits.

Keep cost small: no per-version/response model calls or bundle analysis; cheap path/method/topic rejection; bounded snapshot decoding; coalesced package probes with explicit invalidation; current identity/routing checks before output.

Additional context

Current source: package admission, HTTP controller, usage policy, routing preflight, RPC consumer boundary.

The closed #7368 diff is a prototype reference, not current-dev behavior or native end-to-end proof. No new implementation, dependency, UI, live configuration or exhausted-account acceptance run is included in this design request.

Related: #5941 is closed, #6196 open, #4878 closed as duplicate. Closed #7100 concerns pool spending priority. #4869 is closed as not planned and proposes a different per-thread Reserve override. Keep symptom investigation in #6196 and identity revocation in #7582.

Acceptance needs a genuinely exhausted signed-in account, eligible alternate route, proven consumer/cache update and an actual submitted turn. Also verify genuine native refusals, protected limits, identity changes and disable/restart/crash cleanup. Synthetic tests and transport counters alone are insufficient.

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.
Dominant language
TypeScript
Stars
16.9k
Forks
1.3k
Avg merge
1d 4h
Merged PRs (30d)
814

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lidge-jun/opencodex

All issues in lidge-jun/opencodex

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.