Skip to content

feat(codex): add an on-demand native queue fallback for blocked composers - #5829

Draft
luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:feat/native-queue-fallback-upstream
Draft

luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:feat/native-queue-fallback-upstream

Conversation

@luvs01

@luvs01 luvs01 commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Provide an on-demand alternate input path for a compatible Codex installation when the desktop composer is blocked but an existing thread has an otherwise usable, authorized provider route. The Bash and PowerShell helpers submit one text message through native codex queue; they do not modify account state or proxy routing.

This is the focused upstream submission of luvs01#619, carried through source commit 9efc3c689fea00f7799ff8793f5890a2768c8ee0. The original review history remains intact. This branch is one commit (3406b0bc2a8ae677dd46697445220c2a81679a37) on upstream dev at 0f4c8d4a0f4f2873a72dad6bf0e241529491c277, with six changed files and no unrelated base changes.

Related reports and limits

Report/change Relationship to this proposal
#4878 Records both regular and Luna Reserve allowances exhausted, picker available but Send disabled. That exact state still needs live validation; this PR does not repair the picker or composer.
#5694 Related macOS exhausted-account composer report. It was closed after prevention work; the later reporter follow-up does not establish an updated-proxy regression.
#5797 Related Windows report on OpenCodex 2.64.0 / Desktop 26.917.71314. The maintainer closed it with v2.65.0 prevention guidance; this PR is not a request to reopen it.
#5743 / #5748 Preserve the default-on main-account pre-exhaustion admission guard and its lifecycle fixes. Prevention and an alternate input path are different concerns. The helper never disables that guard.
#5733 A separate interception-based proposal aiming to restore the existing composer. This non-intercepting fallback neither copies its implementation nor claims equivalent integrated UX.

These are related reports, not automatic closure claims. A custom model label alone does not prove independent authorization. Queue acceptance is not model dispatch or completion, and a thread already configured for gpt-reserve is not rerouted by queueing text.

Implementation and lifecycle

  • Require an explicit thread UUID/exact name, or deliberate latest-rollout discovery. The latest file can be a different project/subagent, not the visible conversation. Honor the effective CODEX_HOME, preserve OPENCODEX_HOME and the working directory, and do not fall back to another session store.
  • Prefer queue-capable app/standalone CLIs, support authoritative executable pinning, preserve literal Unicode/quotes/newlines and native exit status, and never automatically retry an ambiguous submission. Help probing does not establish daemon protocol compatibility.
  • Address the remaining source-PR CodeRabbit finding: both shells ignore empty/relative PATH entries before probing, while explicit trusted local pinning remains supported. Absolute PATH/configured installation roots are still operator trust decisions, not signature verification.
  • Redact paths, thread identifiers/names and prompts from default dry-run diagnostics. Explicit target display requires dry run plus a local terminal. Normal native CLI output and process arguments are not made private by the wrapper.
  • No invocation means no helper process, timer, polling or request. An invocation while quota is available sends one normal message; there is no persistent on/off setting. Stopping future invocations does not cancel accepted queue items. Inspect/open/resume the same thread without resending the prompt.
  • No TLS/Statsig/app patch, authentication change, model/account override, restart, guard adjustment or runtime/package modification. These are repository-checkout helpers, not a released ocx queue command or dashboard button.

Files: two helpers, one standalone offline Node harness, a dedicated read-only platform workflow, a guide, and one sidebar entry. Current upstream navigation and internal-link validation remain intact.

Verification

Executed locally

Partial validation workspace: Linux, Node 22.16.0, Bash 5.2.37. Git blob hashes were checked against retrieved/published files; no real Codex account, daemon or model was used.

  • CODEX_QUEUE_TEST_SHELLS=bash node --test scripts/codex-queue.test.mjs: 45 passed, 0 failed, 0 skipped.
  • New PATH tests driven red/green: three unsafe-discovery cases fail against the parent helper; the explicit-pin positive control passes. All four pass with the correction, covering both dry-run and actual fake-CLI submission.
  • bash -n scripts/codex-queue.sh, node --check scripts/codex-queue.test.mjs, node --check docs-site/astro.config.mjs: passed.
  • After the latest upstream sidebar change, the navigation contract was re-run and passed; the underlying wrapper/test blobs did not change.
  • git diff --cached --check in the partial workspace: passed. GitHub comparison against the pinned dev parent confirms only the intended six paths, one commit ahead and zero behind that parent.

Hosted evidence and remaining gates

The identical helper/test blobs passed the source-branch Codex queue helpers run 36102691829 at 9efc3c6: Windows PowerShell 5.1 and 7, macOS system Bash, and Linux. That source-branch result is not a claim that this newly rebased upstream head has passed required CI. Upstream checks and independent review must be observed separately.

The added workflow uses ordinary pull_request / integration-branch push, hosted runners, contents: read, a full-SHA-pinned checkout with persist-credentials: false, and no dependency installation, secrets or real model calls. This technical inspection does not replace independent maintainer security review.

Not executed locally: full bun run typecheck, bun run test, bun run privacy:scan, bun run prepush, and the Astro install/build. This environment has no Bun, PowerShell or full checkout, and container DNS prevented dependency retrieval. This resource limitation is why this submission remains draft; no unrun check is reported as passing.

Still needed before claiming real compatibility: matching Desktop/CLI/daemon dispatch through the intended OpenCodex provider and an actual completed turn, pending-approval/unloaded-thread behavior, and remote-control continuity. Preserve regular-available, regular-exhausted/Reserve-available, both-exhausted, and recovery as distinct states. Do not deliberately exhaust a live account to populate that matrix. Keep native-provider and non-quota restrictions intact.

The guide links pinned OpenAI Codex sources at 7dae8c53d97e61cd774e4d6bcca5243c29ca615c; the historical author-reported Desktop 26.917.9434.0 probe established acceptance only, not end-to-end completion.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults by an independent maintainer; technical inspection is recorded above.
  • Required exact-head repository and documentation checks completed.
  • Real Desktop/OpenCodex dispatch and remote-control compatibility verified.

Attribution: source code, original discussion and prior commits remain in luvs01#619. The CodeRabbit test/documentation contributions are retained and credited in the branch commit.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

…sers

Carry the focused implementation from #619 through
9efc3c6 onto current upstream dev.
Original review and commit history remain intact on the source branch.

Add explicit-target Bash/PowerShell wrappers, private dry-run diagnostics,
literal native arguments, native queue capability checks, and offline CI.
Automatic PATH discovery skips empty/relative entries; explicit local
pinning remains supported. No routing, authentication, quota, runtime,
packaging, or application-file changes are introduced.

Document the pre-dispatch boundary, ordinary-usage/on-off behavior,
queue acceptance versus completion, and unchanged main-account admission.
Retain the upstream sidebar and internal-link validation changes.

Related reports: lidge-jun#4878, lidge-jun#5694, lidge-jun#5797.
This is a limited alternate input path, not complete issue closure,
Reserve rerouting, a composer/model-picker repair, or a quota reset.

Validation: 45/45 local Linux offline wrapper tests, 4-case red/green PATH
regressions, Bash/Node syntax, sidebar rebase contract, and whitespace checks.
Identical wrapper/test blobs passed source-branch three-platform workflow
36102691829 at 9efc3c6; that result does not certify this new upstream head.
Full Bun/prepush/Astro and live Desktop/provider/remote tests remain pending.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

luvs01 commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator Author

Publication verification — exact upstream head 3406b0bc2a8ae677dd46697445220c2a81679a37

The checks below are for this upstream submission, not transferred from the source fork:

GitHub comparison confirms a one-commit, six-file diff against dev parent 0f4c8d4. I fetched all six files from the published head and verified their blob SHAs against the locally validated copies. The current upstream protocol-path sidebar entry and internal-link integration are preserved; the only sidebar diff is the fallback guide entry.

The additional source-PR PATH discovery finding is fixed in both shells, with a red/green regression and exact source-head platform evidence recorded in its review reply. Source history and CodeRabbit contribution credit remain intact.

This remains a draft: offline native-wrapper success is not a completed real Desktop/provider turn, remote-control validation, a full local Bun/prepush/Astro run, or independent workflow security review. No approval, merge, user-app restart, configuration change, quota change, or issue closure is implied.

@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 62 / 80

이 PR은 데스크톱 입력창이 잠겨 있을 때, 이미 있는 Codex 대화에 글 한 편을 넣는 스크립트를 더한다. 바탕 브랜치는 dev다. 앱 파일, 로그인, 모델, 사용량 숫자는 그대로 둔다. scripts/codex-queue.sh(맥, 리눅스)와 scripts/codex-queue.ps1(윈도우)가 그 컴퓨터의 codex queue를 한 번 호출한다. 대화는 --thread로 지정한다. --latest는 세션 폴더에서 수정 시각이 가장 최근인 파일을 고른다. 화면의 대화와 다른 파일을 고를 수 있다. --dry-run은 글을 보내지 않고, 고른 경로와 대화 이름은 기본으로 숨긴다. 안내 페이지를 문서 사이트 옆 메뉴에 넣는다. 설치 패키지에는 이 스크립트가 없다. 저장소를 받아 둔 사람이 scripts/에서 직접 실행한다.

이 커밋은 초안이다. 대기열에 넣었다는 글만 나와도, 답 작성은 아직이다. 작성자도 데스크톱에서 그 대화로 답이 끝나는지, 다른 컴퓨터에서 이어 쓰이는지는 아직 안 봤다고 적었다.

scripts/codex-queue.ps1:188 - 윈도우 -Latest는 Get-ChildItem -Recurse로 세션 폴더를 훑는다. Windows PowerShell 5.1에서는 이 훑기가 폴더 바로가기를 따라 들어간다. 바로가기가 세션 폴더 밖을 가리키면 다른 대화가 골라지고, 글도 그 대화로 간다. 바로가기가 서로를 가리키면 스크립트가 끝나지 않을 수 있다. 맥/리눅스 스크립트는 그 바로가기를 따라가지 않는다. 밖 폴더를 고르지 않는 테스트도 있다. 윈도우에는 그 테스트가 없다.

scripts/codex-queue.sh:104 - 파일을 고르기 전에 codex queue --help를 실행한다. 이 확인에는 시간 제한이 없다. 그 프로그램이 멈추면 이 스크립트도 멈춘다. 글은 나가지 않는다. 윈도우 스크립트는 같은 확인을 10초 뒤에 끊고 오류로 끝낸다 (scripts/codex-queue.ps1:92).

scripts/codex-queue.ps1:144 - -CodexExe를 안 주면, 앱 묶음 폴더에서 도움말에 queue가 있는 codex.exe 중 수정 시각이 가장 최근인 파일을 쓴다. 지금 켜진 데스크톱과 같은 파일인지는 보지 않는다. 더 최근에 깔린 다른 빌드가 도움말만 통과해도 글은 그 빌드로 간다. 맥/리눅스는 정해 둔 경로와 PATH를 앞에서부터 실행해 보고, 처음 통과한 파일을 쓴다.

메인테이너의 판단이 필요한 지점

이 안내를 문서 사이트 메뉴에 둘지 정해야 한다. 페이지는 사용법처럼 읽히는데, npm 설치본에는 scripts/가 없고, 이 커밋에는 실제 앱에서 그 대화로 답이 끝났다는 확인이 없다.

-Latest에 글을 같이 주면 경고만 찍고 바로 보낸다. 고른 대화 번호를 보여 주고 멈추게 할지가 더 안전하다. --dry-run도 고른 실행 파일을 실제로 띄운다. 그 파일을 사용자가 경로로 지정했을 때만 실행할지도 정하면 된다.

#5733은 입력창 잠금을 앱 통신을 고쳐 푸는 다른 초안이다. 이 PR과 코드가 겹치지 않는다. 중복으로 닫을 대상이 아니다. types.ts와 config.ts를 나누는 작업도 아니다.

Cross-platform CI의 test 1/4와 합계 ci는 실패다. 깨진 테스트는 tests/responses/protocol-direct-encoders-chat.test.ts의 stall watchdog이고, 이번 여섯 파일 밖이다. 헬퍼 테스트 워크플로는 우분투, 맥, 윈도우에서 통과했다.

너의 추천

초안을 유지하면 된다. 문서 메뉴에 올리기 전에, 화면에 열린 그 대화로 글이 들어가고 답이 끝나는지 확인하면 된다. 윈도우 -Latest가 세션 폴더 밖 바로가기를 따라가지 않게 막고, 그 경우를 테스트에 넣으면 된다. 맥/리눅스 도움말 확인에도 10초 제한을 두면 된다. 실행 파일은 경로를 적었을 때만 쓰고, 최근 파일로 보낼 때는 고른 대화 번호를 보여 준 뒤 멈추는 편이 낫다.

이 댓글은 grok-bot이 작성했습니다

@lidge-jun

Copy link
Copy Markdown
Owner

어떤걸 넣으시려는건가요

@luvs01

luvs01 commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator Author

어떤걸 넣으시려는건가요

이 새메시지 차단이 앱에만 있고 CLI에는 없는데다가 로컬 전용 차단(리모트시에는 차단안함)이더라구요. 그래서 우회가 불가능한건 아닌것같아서 테스트 중입니다.

This branch has not been deployed

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants