Skip to content

fix: let external Harnesses submit when Codex usage is exhausted - #378

Merged
BytePioneer-AI merged 2 commits into
mainfrom
fix/external-harness-codex-quota-gate
Sep 23, 2026
Merged

BytePioneer-AI merged 2 commits into
mainfrom
fix/external-harness-codex-quota-gate

Conversation

@BytePioneer-AI

Copy link
Copy Markdown
Owner

Purpose

When the ChatGPT-signed-in Codex subscription is out of usage, Desktop disables Composer submission even when an external Harness (Pi, Claude Code, …) is selected. The two gates — the Account rate-limit selector and the reserve hardBlocked selector — are Account-wide Renderer pre-checks, only apply to ChatGPT sign-in (API-key sign-in is unaffected), and are not a protocol limit: external turn/start is routed by the Host and never reaches the official backend.

This is a slimmer replacement for #377.

Changes

  • renderer-codex-usage-gate.ts: for a Composer routed to a ready external Harness, projects false for only that Composer's two gate subscriptions and keeps the native submit path. Gates are identified by the fields their selectors read, not minified names or hook positions. Accounts, atoms and query data are never written; the Codex path, other Composers and all other native blockers are unchanged. Unverifiable contracts keep the native restriction and show a hover hint on the Agent control.
  • renderComposerAgentControl returns its existing external-submission readiness, which drives the gate; Enter/submit remain guarded by prepareComposer.
  • After an Agent switch, the Send button is restored from the latest native props instead of a stale pre-switch flag.
  • npm run audit:codex-desktop gains a read-only codex-usage-gate surface (owner / reserve / Account gate counts). Reviewed baselines that predate a surface are still accepted and compare it as un-baselined.
  • Docs: codex-accounts.md, upgrade diagnosis playbook, audit README, and the codexhost-update-impact-audit skill.

Validation

  • npm run typecheck, eslint, tools/check-boundaries.mjs, prettier, git diff --check
  • vitest for renderer-extension, desktop-control and the audit tool: 65 files / 646 tests
  • Live on Desktop 26.917.51856 with an exhausted ChatGPT Codex account (npm start): both gates bound in the Pi Composer; Send enabled with text; no unsupported hint. The audit bundle run through the report builder against the 26.831 baseline reports codex-usage-gate 1/1/1 no-impact.
  • Not run: actually submitting a message (new Thread and existing Thread follow-up), switching back to Codex, and the full audit:codex-desktop CLI (the main-process Inspector was not open).

🤖 Generated with Claude Code

BytePioneer-AI and others added 2 commits September 23, 2026 23:24
Desktop disables Composer submission through two Account-wide selectors
(ChatGPT rate limit and reserve hardBlocked) regardless of the selected
Harness. For a Composer routed to a ready external Harness, project false
for only that Composer's two gate subscriptions and keep the native submit
path. Accounts, atoms and query data are never written; unverifiable
contracts keep the native restriction and show a hover hint.

Also restore the Send button from the latest native props after an Agent
switch instead of a stale pre-switch flag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add a read-only codex-usage-gate surface to npm run audit:codex-desktop
that counts the Composer owner, reserve gate and Account gate per editable
Composer. A dormant Account gate (API-key sign-in or loading) is reported
as unverified. Reviewed baselines that predate a surface are accepted and
compared as having no baseline for it. Point the update-impact skill at
the new surface.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@BytePioneer-AI
BytePioneer-AI merged commit 7565ab5 into main Sep 23, 2026
4 of 5 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T15:26:36.631717Z dd0cc62 PR opened
🔒 Security Review ✅ Completed 2026-09-23T15:28:07.633548Z dd0cc62 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: BytePioneer-AI/codex-host/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 819dd3a0-b731-40be-b652-af681b1542ad

📥 Commits

Reviewing files that changed from the base of the PR and between 374654c and dd0cc62.

📒 Files selected for processing (16)
  • .agents/skills/codexhost-update-impact-audit/SKILL.md
  • docs/index.md
  • docs/operations/codex-desktop-upgrade-diagnosis-playbook.md
  • docs/product/codex-accounts.md
  • packages/desktop-control/src/contract-audit.ts
  • packages/desktop-control/test/contract-audit.test.ts
  • packages/renderer-extension/src/contract-audit.ts
  • packages/renderer-extension/src/renderer-binding-probe.ts
  • packages/renderer-extension/src/renderer-codex-usage-gate.ts
  • packages/renderer-extension/src/renderer-composer-dom.ts
  • packages/renderer-extension/src/renderer-harness-localization.ts
  • packages/renderer-extension/test/renderer-codex-usage-gate.test.ts
  • tools/codex-desktop-contract-audit/README.md
  • tools/codex-desktop-contract-audit/report.mjs
  • tools/codex-desktop-contract-audit/report.test.mjs
  • tools/codex-desktop-contract-audit/run.mjs
 __________________________________________________
< Are you not entertained? By the bugs I've found? >
 --------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant