Skip to content
This repository was archived by the owner on Oct 20, 2026. It is now read-only.

About

[Archived] Unmaintained Codex VS Code workspace task filter. Maintenance ended 2026-10-20.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

codex-vscode-project-patch

No longer maintained as of October 20, 2026. Development, compatibility reviews, bug fixes, security fixes, and releases have ended. The allowlist is frozen. The technical documentation below is historical reference.

Remove the patch and return to the official extension

If Codex Patch is installed, set codexPatch.repairMode to off before restoring so it cannot reapply the patch. Run Codex Patch: Restore Official Extension, or use the last released CLI with Node.js 20 or newer:

npx --yes --prefer-online [email protected] restore

Then uninstall Codex Patch (cixiangtao.codex-patch) and run Developer: Reload Window. Repository archival does not disable companions already installed on users' machines.

If restore refuses a changed bundle, do not force an old backup over it. Keep the companion disabled or uninstalled and reinstall the official openai.chatgpt extension through VS Code instead.

Historical overview

A minimal, version-aware npm CLI that locally patches the installed official openai.chatgpt VS Code extension. The patch adds the active workspace folder paths to Webview-originated thread/list requests, so Codex task history is filtered by exact session cwd.

This package does not contain, download, repack, or redistribute OpenAI's VSIX or bundle. It modifies the user's existing local installation only.

Last reviewed builds (frozen)

The project used a narrow allowlist. No new builds will be reviewed:

Extension version Clean out/extension.js SHA-256
26.5820.60940 8cf883c518aa255f064ff6809cca9f3c476d165a288932be89cfc7bbcce4b7be
26.5818.41705 ecbc2fc452dde64f9be4bcd93928a18bd091f2d7f23dcb6ef756b4c239c2747d
26.5814.41407 bfbe07b5fcd521b743b6e548b04781ff9ed92f34da24b180c85180a92b8db8b7
26.908.40401 820691c93be40e73f0929b633cddc694b41775050cd72283faba283e53941f4f
26.908.31748 820691c93be40e73f0929b633cddc694b41775050cd72283faba283e53941f4f
26.908.31457 820691c93be40e73f0929b633cddc694b41775050cd72283faba283e53941f4f
26.903.71938 37b48db17a247f884a9173f66eb21f776af5cbdccafa525d99bb84ef39ca998f
26.903.61454 b040ad2e747bf9ec63eef9938864e2ee8550bbb2b58c905148ceed82e7e7fe26
26.901.22334 e8d3bb57b73a1fd316fd557859aec56e540b48de3489012d1952fa4a2e371208
26.825.51511 4d0dd3dd645b4fdb1e23d07c085e7e8576318de3253faacf0d2bf39705bc51cf
26.820.80927 25f55ab3e51b121800e82d3ccab3db2907588ec826bf7041558ee53d482fe2b2
26.820.71523 25f55ab3e51b121800e82d3ccab3db2907588ec826bf7041558ee53d482fe2b2
26.820.60940 8cf883c518aa255f064ff6809cca9f3c476d165a288932be89cfc7bbcce4b7be
26.818.61809 ef5fe33f04826846875c95a3da12c2c2ab7dfc7a34472c0cee5783cb101544e7
26.818.41705 ecbc2fc452dde64f9be4bcd93928a18bd091f2d7f23dcb6ef756b4c239c2747d
26.818.41509 ecbc2fc452dde64f9be4bcd93928a18bd091f2d7f23dcb6ef756b4c239c2747d
26.818.32112 8fb401d3e2fdc02a4892cc896c4b2c459030e1ccbe58a2e8e82249016621b690
26.814.41407 bfbe07b5fcd521b743b6e548b04781ff9ed92f34da24b180c85180a92b8db8b7
26.810.52044 5669921cf77b0de7e49c8e6c6ac6283baa593ccf131bef7b2eac3e1b8eeaf859
26.810.41047 5669921cf77b0de7e49c8e6c6ac6283baa593ccf131bef7b2eac3e1b8eeaf859

Unknown versions, unknown hashes, already modified bundles, missing workspace helpers, and ambiguous patch anchors are refused.

One-command use

Applying the patch is one command:

npx --yes --prefer-online codex-vscode-project-patch@latest

The explicit @latest selects npm's current published release, while --prefer-online forces an immediate freshness check on every run. --yes only accepts npm's install prompt; it does not mean "update to the latest version." No global installation and no separate status or dry-run step are required. With no subcommand, the CLI defaults to apply and performs discovery, compatibility checks, backup, atomic patching, and post-patch verification as one transaction. Running it again is safe: an already managed patch is reported without rewriting the bundle.

Successful output keeps the result and follow-up actions together:

✓ Workspace task filter enabled

Extension
  Version     [email protected]
  State       patched
  Filter      current workspace folders
  Backup      ~/.codex-vscode-project-patch/backups/<sha256>/extension.js

Next steps — reload required
  1. Reload VS Code
     Press ⌘⇧P, then run Developer: Reload Window
  2. Reopen the Codex task list
     It will be filtered to the current workspace folders.

Restore the official file
  npx --yes --prefer-online codex-vscode-project-patch@latest restore

Inspect details: npx --yes --prefer-online codex-vscode-project-patch@latest status --json

The same guidance is printed when the patch is already active, so rerunning the one-command workflow never leaves the user guessing about reload or recovery. In an interactive terminal, the three information types are visually distinct: Extension is cyan, Next steps is yellow, and Restore is magenta. Color is automatically omitted for non-interactive output and when NO_COLOR is set.

Reload the VS Code window after the command completes. An official extension update normally replaces the modified installation; run the same npx command again. If the new build is not allowlisted, it stops without modifying anything.

To remove the patch without installing the CLI globally:

npx --yes --prefer-online codex-vscode-project-patch@latest restore

Codex Patch companion extension

packages/vscode contains Codex Patch, an unofficial companion extension that removes the manual repair step after compatible official Codex updates. It listens for installed-extension changes, performs a fallback periodic check, and refreshes the reviewed compatibility registry with a short local cache.

The default codexPatch.repairMode is auto; prompt asks before each new compatible Codex build, while off keeps status reporting enabled but never writes automatically. A successful repair offers one Restart Extensions action. Unknown versions, unknown hashes, modified bundles, and unmanaged patches remain untouched.

Visual Studio Marketplace distribution is currently unavailable. Build and install the local VSIX from this repository checkout:

pnpm install --frozen-lockfile
pnpm vscode:package
code --install-extension .artifacts/codex-patch.vsix

The extension and CLI share src/core.ts; they do not maintain separate patch, backup, restore, or rollback implementations. The extension uses a UI extension host so it monitors the local VS Code installation rather than a remote workspace host. The CLI remains the headless and recovery surface.

Development and advanced use

The source is TypeScript and the package is built with tsdown. Development uses pnpm, Oxlint, Oxfmt, and Vitest. Node.js 24.11 or newer is required to run the current build toolchain; the generated CLI targets Node.js 20 and newer.

Bootstrap a checkout:

pnpm install --frozen-lockfile
pnpm release:check
pnpm link --global
codex-vscode-project-patch apply
codex-vscode-project-patch status
codex-vscode-project-patch restore

The quality commands are intentionally composable:

pnpm format:check
pnpm lint
pnpm typecheck
pnpm test
pnpm build
pnpm pack:check
pnpm vscode:check
pnpm vscode:package

pnpm release:check runs the complete local gate without publishing. The project has no local publication command. Public releases are owned by the explicit GitHub Actions release workflow documented in RELEASING.md.

The main source boundaries are:

  • src/bin.ts: executable entry point
  • src/cli.ts: arguments, human output, and JSON output
  • src/core.ts: discovery, compatibility, patch, backup, and restore logic
  • src/index.ts: public package exports
  • test/core.test.ts: synthetic bundle and CLI contract tests
  • packages/vscode/src/extension.ts: VS Code lifecycle, commands, notifications, and status bar
  • packages/vscode/src/guardian.ts: editor-independent repair orchestration
  • packages/vscode/src/registry.ts: validated compatibility refresh and cache

The default target is the newest valid openai.chatgpt directory under VS Code's extension folders. Override it when needed:

codex-vscode-project-patch status \
  --extension-dir /absolute/path/to/openai.chatgpt-<version>-darwin-arm64

--editor cursor and --editor auto are available for discovery, but no Cursor bundle is allowlisted in this first release.

Safety model

apply performs these checks and writes in this order:

  1. Validate package.json is openai.chatgpt and resolve its real main entry.
  2. Require an allowlisted extension version and clean entry SHA-256.
  3. Require exactly one clean request-bridge anchor and the existing workspaceFolders/WSL path helper.
  4. Write and hash-verify an original backup under ~/.codex-vscode-project-patch/backups/<sha256>/extension.js.
  5. Atomically replace the entry bundle.
  6. Verify the marker, transformed anchor, patched hash, and JavaScript syntax.
  7. Write an installation-specific manifest. A failed apply automatically rolls the bundle back from memory; the verified backup remains available.

restore only overwrites the bundle when its current hash exactly matches the hash recorded immediately after apply. This prevents restore from erasing a later official update or an unrelated local edit.

Set CODEX_VSCODE_PROJECT_PATCH_HOME or pass --state-dir to change backup and manifest storage.

An optional companion Codex skill is included at skill/codex-vscode-project-patch/SKILL.md. Copy that directory into your Codex skills folder only if you want agents to follow the same safe command ordering; the npm install does not modify global Codex configuration.

JSON contract

Use --json for automation:

codex-vscode-project-patch status --json
codex-vscode-project-patch apply --dry-run --json

Human output uses picocolors, which automatically respects non-interactive terminals and NO_COLOR. JSON output never contains ANSI styling. CLI argument parsing and help are provided by commander; patching, backup, and verification remain implemented in this package.

Success:

{
  "ok": true,
  "command": "status",
  "result": {
    "state": "clean",
    "patchable": true,
    "restorable": false
  },
  "tool": {
    "name": "codex-vscode-project-patch",
    "version": "0.3.1"
  }
}

Failure is JSON on stdout with a non-zero exit code:

{
  "ok": false,
  "error": {
    "code": "UNSUPPORTED_BUNDLE",
    "message": "Refusing to patch an unknown bundle."
  },
  "tool": {
    "name": "codex-vscode-project-patch",
    "version": "0.3.1"
  }
}

Human-readable apply, status, and restore output identifies both the patch tool version and the detected openai.chatgpt plugin version. Failures include the detected plugin version when discovery completed before the safety check stopped the command.

Useful states are clean, patched, restored, patched-unmanaged, inconsistent, modified-or-unknown-hash, and unsupported-version.

Patch point

The Webview's recent-task store calls thread/list without cwd. Its request is forwarded by the extension entry's mcp-request case. The patch intercepts that single bridge case and, only for thread/list, adds:

cwd: Cb();

Cb() is already provided by the official entry bundle. It reads all vscode.workspace.workspaceFolders paths and converts them for WSL when the extension is configured to run Codex there. The bundled Codex app-server schema accepts cwd as either one string or an array and performs exact session-cwd matching.

The patch intentionally does not alter the two separate native conversation preview/chat-session thread/list calls in out/extension.js; it targets the Codex Webview task list.

Compatibility risks

  • Minified identifiers and bridge layout can change in any extension update.
  • The app-server ThreadListParams.cwd contract can change with the bundled Codex binary.
  • Multi-root workspaces match any exact root; tasks started in nested folders do not match unless their recorded cwd equals one of those roots.
  • No workspace folder means no filter is injected, preserving the official list.
  • The primary Webview task list is filtered, but other VS Code-native conversation history surfaces remain global.
  • VS Code may report that extension files were modified, and official updates will normally remove the patch.

Historically, a new official build required regenerating the bundled app-server schema, confirming the cwd contract, tracing the request bridge, and testing a copied installation before adding a version/hash. This project no longer performs those reviews.

Retired automation

Scheduled Marketplace checks, automatic compatibility pull requests and merges, and npm/VSIX publishers have been retired. Their workflow definitions and the Dependabot update configuration were removed from the active tree; previous implementations remain in Git history.

The compatibility registry on main is frozen. Existing companions may still fetch it and repair previously reviewed bundles until disabled or uninstalled. No new compatibility data or companion releases will be provided.

License and status

MIT licensed. This is an unofficial proof of concept and is not affiliated with or endorsed by OpenAI. Contribution and security-reporting expectations are documented in CONTRIBUTING.md and SECURITY.md; the retired release process is documented in RELEASING.md.

About

[Archived] Unmaintained Codex VS Code workspace task filter. Maintenance ended 2026-10-20.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages