Repository navigation
feat: add /codex:sessions, /codex:send and /codex:queue for existing Codex sessions - #833
Open
nobrainer-tech wants to merge 2 commits into
Open
nobrainer-tech wants to merge 2 commits into
nobrainer-tech wants to merge 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Reviewers could not verify the integration without a working Codex setup. The test drives sessions, send and queue through the real codex binary with an isolated CODEX_HOME and a loopback Responses stub, so CI and reviewers get end-to-end proof without credentials or network.
Author
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The plugin can continue its own latest rescue task, but users with an existing Codex conversation have no command to discover its section/ID and send it a follow-up. This adds an opt-in workflow for those conversations, including ones created outside the plugin.
/codex:sessionslists local sessions grouped by their persisted sections, with exact UUIDs and working directories. It paginates across all providers and includes an unsectioned group./codex:send <uuid> <message>previews the target, then queues the user-authorized message through nativecodex queue. It preserves the session settings and leaves its writer in control./codex:queue <uuid>shows pending IDs without message bodies. A queued receipt is explicitly distinct from task completion; uncertain sends are not retried.The implementation reuses the app-server client with an opt-in request timeout and closes failed initialization attempts. Discovery uses one unfiltered thread enumeration so moving a thread between sections cannot cause the per-section scan gap. No new dependency, background hook, state store, version bump, or branding change.
How to verify — no Codex account needed
tests/sessions-live.test.mjsruns the three commands against the realcodexbinary. It uses a throwawayCODEX_HOMEwhoseconfig.tomlpoints the model provider at a loopback Responses API stub, so it needs no login, network or credits and never touches~/.codex:The test seeds a session with one completed turn, then checks that:
sessions --jsonlists that session with its exact UUID and cwd;sendwithout--executewrites nothing;send --executereturns aQUEUEDreceipt,queueshows that exact ID without the message body, and no model turn starts;thread/resume, as Codex Desktop does) consumes the queue: the stub model receives the literal UTF-8, shell-sensitive message and the queue is empty afterwards.CI already installs
@openai/codex, so this runs on every push. That makes it the drift alarm for the experimental section, thread and queue APIs. The test is skipped whencodexorcodex queueis unavailable, and on Windows.Validation
npm test: 102/102 pass with Codex CLI 0.163.0, and the live test also passes with 0.166.0 (current npm). Mutating the message passed tocodex queuemakes the live test fail.npm run prebuild,npm run buildandnpm run check-versionpass.CLAUDE_PLUGIN_DATAandCODEX_COMPANION_SESSION_ID. fix(tests): keep the suite hermetic inside a live Claude Code session #456 fixes that; this PR leaves it alone.Compatibility
These commands require the experimental section/thread/queue APIs and native
codex queue. The listing is local-only, not an atomic snapshot or a full Desktop export; remote hosts and ChatGPT are excluded. Windows execution is unverified and.cmdwrappers are not run through a shell.codex queuetakes the message only as--message <TEXT>(no stdin option), so the text appears in the child process argv; the command docs prohibit sending secrets until Codex accepts stdin.Related: #700 covers explicit thread resumption; #351 proposes session/history tracking and hooks. This PR focuses on discovery and queueing without resuming a thread or storing its conversation history.