Repository navigation
Restore Fork Chat for API key users with a Codex plugin - #58
Open
Dandelion011 wants to merge 2 commits into
Open
Dandelion011 wants to merge 2 commits into
Dandelion011 wants to merge 2 commits into
Conversation
Dandelion011
requested review from
harshpatel-oai,
ness-oai,
rachita-droid,
sagar-vemuri-oai,
talaniz-oai and
tonyloehr
as code owners
November 18, 2026 10:55
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
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.
What this adds
Restores Fork Chat in Codex desktop when using API key authentication without a ChatGPT sign-in. In this mode, built-in Fork Chat can remain stuck at
execution-config-loadingbecause its Statsig sidebar gate is unavailable (openai/codex#59308). This Codex plugin forks local chats directly through aUserPromptSubmithook and the local App Server. Entering exactlyforkchatfixedforks into the current directory;forkchatinnewworktreefixedcreates a detached Git worktree with tracked changes and untracked files, records the chat owner, and forks into that directory. The trigger is handled before a model turn.This hook package is for manual installation through a local/GitHub marketplace; lifecycle-hook plugins are not eligible for the public plugin directory.
Actions, data, and requirements
The Node hook starts the local
codex app-server, callsthread/turns/list,thread/readwhen needed, andthread/fork. For new worktrees it runs local Git commands (rev-parse,worktree add,diff,apply,ls-files), reads tracked changes and untracked files, writes the new checkout plus its local owner metadata underCODEX_HOME/worktrees, and opens the resultingcodex://threads/URL with Windows PowerShell. It makes no plugin-originated network requests and does not store credentials. The app/server retains its usual authentication behavior. Requirements: local Codex desktop, Node.js, and Git with an existing commit for the worktree command. Outside Windows, the generated URL may need to be opened manually.To try: install
forkbuggedchatfrom the marketplace, trust the hook in/hooks, restart Codex, then send one of the two exact words in an existing local chat. To check the safe non-trigger path, sendforkchatfixed(with a trailing space); the hook exits without creating a fork. A Git or App Server error is reported in the original chat. A failed operation may leave a new worktree directory for inspection.Verification
npm run validate:marketplace— passed.npm run test:forkbuggedchat— passed, including exact-match rejection, both fork request shapes, worktree contents and owner metadata against a stub App Server.npm run test:marketplace:runner— passed.npm run test:marketplacewas not run locally because it also invokes unrelated plugin suites.Apache-2.0 license included with the plugin. No third-party code or runtime dependency is added.