Skip to content

VSCode extension: open-in-targets error loop causes high CPU (Code Helper Renderer 100%+) #16849

Closed

Description

@ofrnsb

Summary

The openai.chatgpt VS Code extension (Codex) has a bug where the open-in-targets and set-preferred-app handlers throw an error instead of returning gracefully. Because the webview queries open-in-targets on a 1-minute interval (staleTime: ONE_MINUTE), the failure triggers a React Query retry loop, resulting in continuous log spam and sustained 100-170% CPU usage on Code Helper (Renderer) processes.

This happens in every open VS Code window that has the Codex panel loaded.

Affected versions

  • 26.325.31654-darwin-arm64
  • 26.5401.11717 (latest as of 2026-04-05)

Evidence

VS Code extension logs rotate 6+ times within a single session:

~/.vscode/Code/logs/.../exthost/openai.chatgpt/Codex.1.log  (1,556 lines)
~/.vscode/Code/logs/.../exthost/openai.chatgpt/Codex.2.log  (1,556 lines)
~/.vscode/Code/logs/.../exthost/openai.chatgpt/Codex.3.log  (1,556 lines)
~/.vscode/Code/logs/.../exthost/openai.chatgpt/Codex.4.log  (1,556 lines)
~/.vscode/Code/logs/.../exthost/openai.chatgpt/Codex.5.log  (1,556 lines)
~/.vscode/Code/logs/.../exthost/openai.chatgpt/Codex.6.log  (1,556 lines)

Repeated error:

Error: open-in-target not supported in extension
    at open-in-targets (extension.js:255:22561)
    at W_.handleVSCodeRequest (extension.js:255:27618)
    at Qw.fetch (extension.js:214:1973)
    ...

Activity Monitor during the loop:

Code Helper (Renderer)  171.1%  CPU
Code Helper (Renderer)  112.4%  CPU
Code Helper (Plugin)     31.6%  CPU

Root cause

In extension.js, both handlers are intentional stubs for features unsupported in extension mode, but they throw instead of returning gracefully:

// extension.js (both 26.325.31654 and 26.5401.11717)
"open-in-targets": async () => {
  throw new Error("open-in-target not supported in extension")
},
"set-preferred-app": async () => {
  throw new Error("open-in-target not supported in extension")
},

The webview (index-*.js) queries open-in-targets via React Query with staleTime: ONE_MINUTE:

queryFn: async () => pr(`open-in-targets`, { params: { cwd: e } }),
queryKey: Sr(`open-in-targets`, { cwd: e }),
staleTime: Fr.ONE_MINUTE

When the query throws, React Query retries, creating a continuous failure loop.

Requested fix

Return an empty/no-op response instead of throwing, so the webview treats the feature as unavailable without retrying:

"open-in-targets": async () => ({ targets: [] }),
"set-preferred-app": async () => ({}),

This makes the behavior consistent with other unsupported stubs in the extension and stops the retry loop entirely. The fix is a one-liner in the extension source, no functional change, just converting an unhandled throw into a graceful empty response.

Activity

  1. added
    bugSomething isn't working
    extensionIssues related to the VS Code extension
    on Apr 5, 2026
  2. ofrnsb commented on Apr 5, 2026

    @ofrnsb
    Author

    cc @bolinfest @jif-oai @aibrahim-oai @nornagon-openai @dylan-hurd-oai @charley-oai — tagging core contributors, this affects the VS Code extension specifically.

  3. MingLi3306 commented on Apr 5, 2026

    @MingLi3306

    I've encountered the same problem.

    After using the latest version of the CodeX vs Code extension and having several conversations with CodeX,

    my Macbook Air M4's CPU usage exceeded 100%, and the computer overheated significantly.

  4. ofrnsb commented on Apr 5, 2026

    @ofrnsb
    Author

    I've encountered the same problem.

    After using the latest version of the CodeX vs Code extension and having several conversations with CodeX,

    my Macbook Air M4's CPU usage exceeded 100%, and the computer overheated significantly.

    run this script to fix it

    set -euo pipefail
    
    EXT_DIR="$HOME/.vscode/extensions"
    PATCHED=0
    SKIPPED=0
    ALREADY=0
    
    find "$EXT_DIR" -maxdepth 1 -type d -name "openai.chatgpt-*" | sort | while read -r dir; do
      ext_js="$dir/out/extension.js"
      version=$(basename "$dir")
    
      if [[ ! -f "$ext_js" ]]; then
        echo "[$version] extension.js not found, skipping"
        continue
      fi
    
      # Check if bug is present
      if grep -q '"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}' "$ext_js"; then
        echo "[$version] bug detected — patching..."
    
        # Backup (only once per version)
        if [[ ! -f "$ext_js.bak" ]]; then
          cp "$ext_js" "$ext_js.bak"
          echo "[$version] backup created: extension.js.bak"
        fi
    
        sed -i '' \
          's/"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}/"open-in-targets":async()=>({targets:[]})/g' \
          "$ext_js"
    
        sed -i '' \
          's/"set-preferred-app":async()=>{throw new Error("open-in-target not supported in extension")}/"set-preferred-app":async()=>({})/g' \
          "$ext_js"
    
        # Verify
        if grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
          echo "[$version] patched successfully"
        else
          echo "[$version] patch verification failed — restoring backup"
          cp "$ext_js.bak" "$ext_js"
        fi
    
      elif grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
        echo "[$version] already patched, skipping"
      else
        echo "[$version] open-in-targets pattern not found — extension structure may have changed"
      fi
    done
    
    echo ""
    echo "Done. Reload VS Code windows to apply: Cmd+Shift+P → Developer: Reload Window"
    
  5. bagerxx commented on Apr 5, 2026

    @bagerxx

    I believe I was seeing the same issue.

    When Codex was active in VS Code, Code Helper (Renderer) was reaching around 200% CPU and my Mac was overheating very quickly. Your root-cause analysis matches my symptoms closely.

    Thank you for identifying and documenting this so clearly.

    I applied the patch script shared in this thread, reloaded VS Code, and after that the abnormal CPU and overheating behavior stopped on my side. I tested it several times and the issue no longer seems to occur, although I will continue testing.

  6. Ga1axy0 commented on Apr 5, 2026

    @Ga1axy0

    Thanks a lot to identifying and solving the problem. After using the script, the behavior of the CPU over usage seems disappear.

    Moreover, thanks to @bagerxx for leading me to see this solution.

  7. 9426224 commented on Apr 6, 2026

    @9426224

    I've encountered the same problem.我也遇到过同样的问题。
    After using the latest version of the CodeX vs Code extension and having several conversations with CodeX,在使用最新版本的 CodeX vs Code 扩展程序并与 CodeX 进行多次沟通后,
    my Macbook Air M4's CPU usage exceeded 100%, and the computer overheated significantly.我的 Macbook Air M4 的 CPU 使用率超过 100%,电脑严重过热。

    run this script to fix it运行此脚本即可修复它

    set -euo pipefail
    
    EXT_DIR="$HOME/.vscode/extensions"
    PATCHED=0
    SKIPPED=0
    ALREADY=0
    
    find "$EXT_DIR" -maxdepth 1 -type d -name "openai.chatgpt-*" | sort | while read -r dir; do
      ext_js="$dir/out/extension.js"
      version=$(basename "$dir")
    
      if [[ ! -f "$ext_js" ]]; then
        echo "[$version] extension.js not found, skipping"
        continue
      fi
    
      # Check if bug is present
      if grep -q '"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}' "$ext_js"; then
        echo "[$version] bug detected — patching..."
    
        # Backup (only once per version)
        if [[ ! -f "$ext_js.bak" ]]; then
          cp "$ext_js" "$ext_js.bak"
          echo "[$version] backup created: extension.js.bak"
        fi
    
        sed -i '' \
          's/"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}/"open-in-targets":async()=>({targets:[]})/g' \
          "$ext_js"
    
        sed -i '' \
          's/"set-preferred-app":async()=>{throw new Error("open-in-target not supported in extension")}/"set-preferred-app":async()=>({})/g' \
          "$ext_js"
    
        # Verify
        if grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
          echo "[$version] patched successfully"
        else
          echo "[$version] patch verification failed — restoring backup"
          cp "$ext_js.bak" "$ext_js"
        fi
    
      elif grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
        echo "[$version] already patched, skipping"
      else
        echo "[$version] open-in-targets pattern not found — extension structure may have changed"
      fi
    done
    
    echo ""
    echo "Done. Reload VS Code windows to apply: Cmd+Shift+P → Developer: Reload Window"
    

    Thanks a lot, this patch really works on M1 Max macOS 2.6.

  8. MingLi3306 commented on Apr 6, 2026

    @MingLi3306

    我也遇到过同样的问题。
    在使用最新版本的CodeX vs Code扩展并与CodeX进行多次对话后,在使用最新版本的CodeX vs Code扩展程序并与CodeX进行多次沟通后,
    我的Macbook Air M4的CPU使用率超过100%,计算机明显过热。我的Macbook Air M4的CPU使用率超过100%,计算机严重过热。

    运行此脚本来修复它运行此脚本即可修复它

    set -euo pipefail
    
    EXT_DIR="$HOME/.vscode/extensions"
    PATCHED=0
    SKIPPED=0
    ALREADY=0
    
    find "$EXT_DIR" -maxdepth 1 -type d -name "openai.chatgpt-*" | sort | while read -r dir; do
      ext_js="$dir/out/extension.js"
      version=$(basename "$dir")
    
      if [[ ! -f "$ext_js" ]]; then
        echo "[$version] extension.js not found, skipping"
        continue
      fi
    
      # Check if bug is present
      if grep -q '"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}' "$ext_js"; then
        echo "[$version] bug detected — patching..."
    
        # Backup (only once per version)
        if [[ ! -f "$ext_js.bak" ]]; then
          cp "$ext_js" "$ext_js.bak"
          echo "[$version] backup created: extension.js.bak"
        fi
    
        sed -i '' \
          's/"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}/"open-in-targets":async()=>({targets:[]})/g' \
          "$ext_js"
    
        sed -i '' \
          's/"set-preferred-app":async()=>{throw new Error("open-in-target not supported in extension")}/"set-preferred-app":async()=>({})/g' \
          "$ext_js"
    
        # Verify
        if grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
          echo "[$version] patched successfully"
        else
          echo "[$version] patch verification failed — restoring backup"
          cp "$ext_js.bak" "$ext_js"
        fi
    
      elif grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
        echo "[$version] already patched, skipping"
      else
        echo "[$version] open-in-targets pattern not found — extension structure may have changed"
      fi
    done
    
    echo ""
    echo "Done. Reload VS Code windows to apply: Cmd+Shift+P → Developer: Reload Window"
    

    非常感谢,这个补丁在 M1 Max macOS 2.6 上真的有效。

    Thank you for your help.

  9. MingLi3306 commented on Apr 6, 2026

    @MingLi3306

    I've encountered the same problem.
    After using the latest version of the CodeX vs Code extension and having several conversations with CodeX,
    my Macbook Air M4's CPU usage exceeded 100%, and the computer overheated significantly.

    run this script to fix it

    set -euo pipefail
    
    EXT_DIR="$HOME/.vscode/extensions"
    PATCHED=0
    SKIPPED=0
    ALREADY=0
    
    find "$EXT_DIR" -maxdepth 1 -type d -name "openai.chatgpt-*" | sort | while read -r dir; do
      ext_js="$dir/out/extension.js"
      version=$(basename "$dir")
    
      if [[ ! -f "$ext_js" ]]; then
        echo "[$version] extension.js not found, skipping"
        continue
      fi
    
      # Check if bug is present
      if grep -q '"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}' "$ext_js"; then
        echo "[$version] bug detected — patching..."
    
        # Backup (only once per version)
        if [[ ! -f "$ext_js.bak" ]]; then
          cp "$ext_js" "$ext_js.bak"
          echo "[$version] backup created: extension.js.bak"
        fi
    
        sed -i '' \
          's/"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}/"open-in-targets":async()=>({targets:[]})/g' \
          "$ext_js"
    
        sed -i '' \
          's/"set-preferred-app":async()=>{throw new Error("open-in-target not supported in extension")}/"set-preferred-app":async()=>({})/g' \
          "$ext_js"
    
        # Verify
        if grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
          echo "[$version] patched successfully"
        else
          echo "[$version] patch verification failed — restoring backup"
          cp "$ext_js.bak" "$ext_js"
        fi
    
      elif grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
        echo "[$version] already patched, skipping"
      else
        echo "[$version] open-in-targets pattern not found — extension structure may have changed"
      fi
    done
    
    echo ""
    echo "Done. Reload VS Code windows to apply: Cmd+Shift+P → Developer: Reload Window"
    

    Thank you for your help.

  10. KeriaGuma commented on Apr 7, 2026

    @KeriaGuma

    Thanks for the investigation.

    I applied the workaround locally on macOS by changing:

    "open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")},
    "set-preferred-app":async()=>{throw new Error("open-in-target not supported in extension")},

    to:

    "open-in-targets":async()=>({targets:[]}),
    "set-preferred-app":async()=>({}),

    After restarting VS Code, Codex loaded normally and the high CPU / overheating issue disappeared.

    Really appreciate you sharing this.

  11. bwesen commented on Apr 8, 2026

    @bwesen

    Great find, I had to kill VSCode after every prompt in the Codex plugin because of the 100% CPU

  12. Smexey commented on Apr 8, 2026

    @Smexey

    Little script i made that fixes it since any manual fixes break on update:

    #!/usr/bin/env bash
    #
    # Source-aware local workaround for Codex VS Code CPU hotspots.
    # This patches the installed extension bundle in-place and keeps a .bak copy.
    
    set -euo pipefail
    
    APP="auto"
    CHECK_ONLY=0
    
    usage() {
        cat <<'EOF'
    Usage: fix_codex.sh [--app vscode|windsurf|auto] [--check]
    
    Options:
      --app    Choose which editor extension to inspect. Default: auto.
      --check  Report which patches would apply without modifying files.
    EOF
    }
    
    while [[ $# -gt 0 ]]; do
        case "$1" in
            --app)
                if [[ $# -lt 2 ]]; then
                    echo "ERROR: --app requires a value." >&2
                    exit 1
                fi
    
                APP="$2"
                shift 2
                ;;
            --check)
                CHECK_ONLY=1
                shift
                ;;
            -h|--help)
                usage
                exit 0
                ;;
            *)
                echo "ERROR: Unknown argument: $1" >&2
                usage >&2
                exit 1
                ;;
        esac
    done
    
    case "$APP" in
        auto|vscode|windsurf)
            ;;
        *)
            echo "ERROR: --app must be one of: auto, vscode, windsurf." >&2
            exit 1
            ;;
    esac
    
    find_extension_dir() {
        local -a base_dirs=()
        local -a candidates=()
        local base_dir
    
        case "$APP" in
            vscode)
                base_dirs=("$HOME/.vscode/extensions")
                ;;
            windsurf)
                base_dirs=("$HOME/.windsurf/extensions")
                ;;
            auto)
                base_dirs=("$HOME/.vscode/extensions" "$HOME/.windsurf/extensions")
                ;;
        esac
    
        for base_dir in "${base_dirs[@]}"; do
            if [[ -d "$base_dir" ]]; then
                while IFS= read -r candidate; do
                    [[ -n "$candidate" ]] && candidates+=("$candidate")
                done < <(ls -d "$base_dir"/openai.chatgpt-*-darwin-arm64 2>/dev/null || true)
            fi
        done
    
        if [[ ${#candidates[@]} -eq 0 ]]; then
            return 1
        fi
    
        printf '%s\n' "${candidates[@]}" | while IFS= read -r candidate; do
            printf '%s\t%s\n' \
                "$(basename "$candidate" | sed -E 's/^openai\.chatgpt-//; s/-darwin-arm64$//')" \
                "$candidate"
        done | sort -V | tail -1 | cut -f2-
    }
    
    EXT_DIR=$(find_extension_dir || true)
    
    if [[ -z "${EXT_DIR:-}" ]]; then
        echo "ERROR: Could not find Codex extension directory in ~/.windsurf/extensions or ~/.vscode/extensions."
        exit 1
    fi
    
    BUNDLE=$(ls "$EXT_DIR"/webview/assets/index-*.js 2>/dev/null | head -1)
    EXT_HOST="$EXT_DIR/out/extension.js"
    
    if [[ -z "${BUNDLE:-}" ]]; then
        echo "ERROR: Could not find Codex webview bundle."
        exit 1
    fi
    
    if [[ ! -f "$EXT_HOST" ]]; then
        echo "ERROR: Could not find Codex extension host bundle."
        exit 1
    fi
    
    echo "Found extension: $EXT_DIR"
    echo "Found bundle:    $BUNDLE"
    echo "Found host JS:   $EXT_HOST"
    echo "App mode:        $APP"
    echo "Check only:      $CHECK_ONLY"
    echo "Size:            $(du -h "$BUNDLE" | cut -f1)"
    
    if [[ "$CHECK_ONLY" -eq 0 ]]; then
        if [[ ! -f "$BUNDLE.bak" ]]; then
            cp "$BUNDLE" "$BUNDLE.bak"
            echo "Backup created:  $BUNDLE.bak"
        else
            echo "Backup exists:   $BUNDLE.bak"
        fi
    
        if [[ ! -f "$EXT_HOST.bak" ]]; then
            cp "$EXT_HOST" "$EXT_HOST.bak"
            echo "Backup created:  $EXT_HOST.bak"
        else
            echo "Backup exists:   $EXT_HOST.bak"
        fi
    fi
    
    PATCHED=0
    
    replace_all() {
        local old="$1"
        local new="$2"
        local label="$3"
    
        python3 - "$BUNDLE" "$old" "$new" "$label" "$CHECK_ONLY" <<'PY'
    from pathlib import Path
    import sys
    
    bundle_path = Path(sys.argv[1])
    old = sys.argv[2]
    new = sys.argv[3]
    label = sys.argv[4]
    check_only = sys.argv[5] == "1"
    
    text = bundle_path.read_text()
    count = text.count(old)
    if count == 0:
        print(f"{label}: skipped")
        raise SystemExit(1)
    
    if check_only:
        print(f"{label}: would apply ({count} replacements)")
    else:
        bundle_path.write_text(text.replace(old, new))
        print(f"{label}: applied ({count} replacements)")
    PY
    }
    
    replace_all_in_file() {
        local file_path="$1"
        local old="$2"
        local new="$3"
        local label="$4"
    
        python3 - "$file_path" "$old" "$new" "$label" "$CHECK_ONLY" <<'PY'
    from pathlib import Path
    import sys
    
    bundle_path = Path(sys.argv[1])
    old = sys.argv[2]
    new = sys.argv[3]
    label = sys.argv[4]
    check_only = sys.argv[5] == "1"
    
    text = bundle_path.read_text()
    count = text.count(old)
    if count == 0:
        print(f"{label}: skipped")
        raise SystemExit(1)
    
    if check_only:
        print(f"{label}: would apply ({count} replacements)")
    else:
        bundle_path.write_text(text.replace(old, new))
        print(f"{label}: applied ({count} replacements)")
    PY
    }
    
    echo ""
    echo "Checking for known Codex CPU hotspots"
    echo "============================================"
    
    if replace_all \
        'pp={numStars:1900,minStars:700,starsPerMegaPixel:900,baseTrailLength:2,maxTrailLength:22,speedBase:1,speedWarpMultiplier:38,clearAlphaWarpMultiplier:.8,warpEasing:.06,warpAlphaDamp:.35,idleMaxFps:20,activeMaxFps:60,unfocusedFpsMultiplier:.6' \
        'pp={numStars:200,minStars:100,starsPerMegaPixel:100,baseTrailLength:2,maxTrailLength:22,speedBase:1,speedWarpMultiplier:38,clearAlphaWarpMultiplier:.8,warpEasing:.06,warpAlphaDamp:.35,idleMaxFps:5,activeMaxFps:15,unfocusedFpsMultiplier:.1' \
        'PATCH 1 legacy starfield'; then
        PATCHED=$((PATCHED + 1))
    fi
    
    if replace_all \
        'oe?le=0:i&&!a&&(le=1e3)' \
        'oe?le=1e3:i&&!a&&(le=1e3)' \
        'PATCH 2 legacy interval'; then
        PATCHED=$((PATCHED + 1))
    fi
    
    if replace_all \
        'm.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`style`,`class`,`hidden`,`aria-hidden`]})' \
        'm.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:[`style`,`class`,`hidden`,`aria-hidden`]})' \
        'PATCH 3 hotkey observer'; then
        PATCHED=$((PATCHED + 1))
    fi
    
    if replace_all \
        'se?ue=0:i&&!a&&(ue=1e3)' \
        'se?ue=1e3:i&&!a&&(ue=1e3)' \
        'PATCH 4 prerelease exec interval'; then
        PATCHED=$((PATCHED + 1))
    fi
    
    if replace_all \
        'if(document.hidden)return;if(n-T.current>=e-1){' \
        'if(document.hidden){w.current=null;return}if(n-T.current>=e-1){' \
        'PATCH 5 sign-in hidden loop'; then
        PATCHED=$((PATCHED + 1))
    fi
    
    if replace_all \
        'let n=()=>{document.hidden||(T.current=0)};' \
        'let n=()=>{document.hidden||(T.current=0,w.current==null&&(w.current=window.requestAnimationFrame(t)))};' \
        'PATCH 6 sign-in resume'; then
        PATCHED=$((PATCHED + 1))
    fi
    
    if replace_all \
        'loop:h,renderConfig:te,autoplay:ne,className:`pointer-events-none h-full w-full contain-[paint_style_layout_inline-size]`' \
        'loop:h,renderConfig:te,autoplay:!1,className:`pointer-events-none h-full w-full contain-[paint_style_layout_inline-size]`' \
        'PATCH 9 animated icon autoplay disable'; then
        PATCHED=$((PATCHED + 1))
    fi
    
    if replace_all_in_file \
        "$EXT_HOST" \
        '"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")},"set-preferred-app":async()=>{throw new Error("open-in-target not supported in extension")}' \
        '"open-in-targets":async()=>({preferredTarget:null,availableTargets:[],targets:[]}),"set-preferred-app":async()=>({success:!1})' \
        'PATCH 7 open target handler'; then
        PATCHED=$((PATCHED + 1))
    fi
    
    if replace_all_in_file \
        "$EXT_HOST" \
        'this.anyBroadcastHandlers.size===0&&this.logger.warning("Received broadcast but no handler is configured",{safe:{method:e.method},sensitive:{}})' \
        'this.anyBroadcastHandlers.size===0&&e.method!=="thread-stream-state-changed"&&e.method!=="client-status-changed"&&this.logger.warning("Received broadcast but no handler is configured",{safe:{method:e.method},sensitive:{}})' \
        'PATCH 8 thread stream warning suppression'; then
        PATCHED=$((PATCHED + 1))
    fi
    
    if replace_all_in_file \
        "$EXT_HOST" \
        '"local-environments":async()=>{throw new Error("local-environments is not supported in the extension")}' \
        '"local-environments":async()=>[]' \
        'PATCH 10 local environments fallback'; then
        PATCHED=$((PATCHED + 1))
    fi
    
    echo ""
    echo "============================================"
    if [[ "$CHECK_ONLY" -eq 1 ]]; then
        echo "  $PATCHED patches would apply"
    else
        echo "  $PATCHED patches applied"
    fi
    echo "============================================"
    echo ""
    
    if [[ "$CHECK_ONLY" -eq 0 ]]; then
        echo "Next: Reload Windsurf or VS Code"
        echo "  Cmd+Shift+P -> 'Developer: Reload Window'"
        echo ""
        echo "To restore original:"
        echo "  cp \"$BUNDLE.bak\" \"$BUNDLE\""
        echo "  cp \"$EXT_HOST.bak\" \"$EXT_HOST\""
    fi
  13. 12 remaining items

  14. ofrnsb commented on Apr 14, 2026

    @ofrnsb
    Author

    thanks @shijie-oai!
    you might want to see another cases as well, will describe it here later.

  15. Dagsi commented on Apr 16, 2026

    @Dagsi

    Hi all! We have merged a fix and this should be addressed by the next release. Sorry about the close notification - linear was too eager at closing the ticket when we mark the task done internally.

    Hi, thanks for the update.

    Do you have an estimated timeline for when the next release will be rolled out? The current issue is blocking us from using the feature, so it’s quite urgent on our side.

    Appreciate your help!

  16. tinkeridze commented on Apr 16, 2026

    @tinkeridze

    Hello everyone!! Will running the fix script affect the extension's functionality in the future? What happens to the changes after the update? Will I need to do anything to undo all the changes made by the script?

    Or does anyone have information on how often they release?)

    Thank you for sharing, investigating, and resolving this issue.

  17. shijie-oai commented on Apr 16, 2026

    @shijie-oai
    Contributor

    Hi all! We should be releasing a VSCE version soon - I will post back when the version is updated.

  18. tinkeridze commented on Apr 16, 2026

    @tinkeridze

    The latest update made it even worse 😭

    (93 °C – average core temperature . Its 199 °F)

    Are there any ways to help troubleshoot this? I can share system logs or something

    Image Image
  19. ofrnsb commented on Apr 17, 2026

    @ofrnsb
    Author

    Hello everyone!! Will running the fix script affect the extension's functionality in the future? What happens to the changes after the update? Will I need to do anything to undo all the changes made by the script?

    Or does anyone have information on how often they release?)

    Thank you for sharing, investigating, and resolving this issue.

    i will maintain it and publish a GitHub repo so people can clone and run it instead of waiting on OpenAI to fix it.

  20. ofrnsb commented on Apr 17, 2026

    @ofrnsb
    Author

    I've encountered the same problem.
    After using the latest version of the CodeX vs Code extension and having several conversations with CodeX,
    my Macbook Air M4's CPU usage exceeded 100%, and the computer overheated significantly.

    run this script to fix it

    set -euo pipefail
    
    EXT_DIR="$HOME/.vscode/extensions"
    PATCHED=0
    SKIPPED=0
    ALREADY=0
    
    find "$EXT_DIR" -maxdepth 1 -type d -name "openai.chatgpt-*" | sort | while read -r dir; do
      ext_js="$dir/out/extension.js"
      version=$(basename "$dir")
    
      if [[ ! -f "$ext_js" ]]; then
        echo "[$version] extension.js not found, skipping"
        continue
      fi
    
      # Check if bug is present
      if grep -q '"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}' "$ext_js"; then
        echo "[$version] bug detected — patching..."
    
        # Backup (only once per version)
        if [[ ! -f "$ext_js.bak" ]]; then
          cp "$ext_js" "$ext_js.bak"
          echo "[$version] backup created: extension.js.bak"
        fi
    
        sed -i '' \
          's/"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}/"open-in-targets":async()=>({targets:[]})/g' \
          "$ext_js"
    
        sed -i '' \
          's/"set-preferred-app":async()=>{throw new Error("open-in-target not supported in extension")}/"set-preferred-app":async()=>({})/g' \
          "$ext_js"
    
        # Verify
        if grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
          echo "[$version] patched successfully"
        else
          echo "[$version] patch verification failed — restoring backup"
          cp "$ext_js.bak" "$ext_js"
        fi
    
      elif grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
        echo "[$version] already patched, skipping"
      else
        echo "[$version] open-in-targets pattern not found — extension structure may have changed"
      fi
    done
    
    echo ""
    echo "Done. Reload VS Code windows to apply: Cmd+Shift+P → Developer: Reload Window"
    

    this script still works.

  21. Ga1axy0 commented on Apr 17, 2026

    @Ga1axy0

    I've encountered the same problem.
    After using the latest version of the CodeX vs Code extension and having several conversations with CodeX,
    my Macbook Air M4's CPU usage exceeded 100%, and the computer overheated significantly.

    run this script to fix it

    set -euo pipefail
    
    EXT_DIR="$HOME/.vscode/extensions"
    PATCHED=0
    SKIPPED=0
    ALREADY=0
    
    find "$EXT_DIR" -maxdepth 1 -type d -name "openai.chatgpt-*" | sort | while read -r dir; do
      ext_js="$dir/out/extension.js"
      version=$(basename "$dir")
    
      if [[ ! -f "$ext_js" ]]; then
        echo "[$version] extension.js not found, skipping"
        continue
      fi
    
      # Check if bug is present
      if grep -q '"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}' "$ext_js"; then
        echo "[$version] bug detected — patching..."
    
        # Backup (only once per version)
        if [[ ! -f "$ext_js.bak" ]]; then
          cp "$ext_js" "$ext_js.bak"
          echo "[$version] backup created: extension.js.bak"
        fi
    
        sed -i '' \
          's/"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}/"open-in-targets":async()=>({targets:[]})/g' \
          "$ext_js"
    
        sed -i '' \
          's/"set-preferred-app":async()=>{throw new Error("open-in-target not supported in extension")}/"set-preferred-app":async()=>({})/g' \
          "$ext_js"
    
        # Verify
        if grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
          echo "[$version] patched successfully"
        else
          echo "[$version] patch verification failed — restoring backup"
          cp "$ext_js.bak" "$ext_js"
        fi
    
      elif grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
        echo "[$version] already patched, skipping"
      else
        echo "[$version] open-in-targets pattern not found — extension structure may have changed"
      fi
    done
    
    echo ""
    echo "Done. Reload VS Code windows to apply: Cmd+Shift+P → Developer: Reload Window"
    

    this script still works.

    Does it work or not?

    [openai.chatgpt-26.415.20818-darwin-arm64] open-in-targets pattern not found — extension structure may have changed
    
    Done. Reload VS Code windows to apply: Cmd+Shift+P → Developer: Reload Window
    
  22. Ga1axy0 commented on Apr 17, 2026

    @Ga1axy0

    Hi all! We should be releasing a VSCE version soon - I will post back when the version is updated.

    Does the newest version 26.415.20818 solved this issue? Same problem happened when I using the codex extention.

  23. ofrnsb commented on Apr 18, 2026

    @ofrnsb
    Author

    I've encountered the same problem.
    After using the latest version of the CodeX vs Code extension and having several conversations with CodeX,
    my Macbook Air M4's CPU usage exceeded 100%, and the computer overheated significantly.

    run this script to fix it

    set -euo pipefail
    
    EXT_DIR="$HOME/.vscode/extensions"
    PATCHED=0
    SKIPPED=0
    ALREADY=0
    
    find "$EXT_DIR" -maxdepth 1 -type d -name "openai.chatgpt-*" | sort | while read -r dir; do
      ext_js="$dir/out/extension.js"
      version=$(basename "$dir")
    
      if [[ ! -f "$ext_js" ]]; then
        echo "[$version] extension.js not found, skipping"
        continue
      fi
    
      # Check if bug is present
      if grep -q '"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}' "$ext_js"; then
        echo "[$version] bug detected — patching..."
    
        # Backup (only once per version)
        if [[ ! -f "$ext_js.bak" ]]; then
          cp "$ext_js" "$ext_js.bak"
          echo "[$version] backup created: extension.js.bak"
        fi
    
        sed -i '' \
          's/"open-in-targets":async()=>{throw new Error("open-in-target not supported in extension")}/"open-in-targets":async()=>({targets:[]})/g' \
          "$ext_js"
    
        sed -i '' \
          's/"set-preferred-app":async()=>{throw new Error("open-in-target not supported in extension")}/"set-preferred-app":async()=>({})/g' \
          "$ext_js"
    
        # Verify
        if grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
          echo "[$version] patched successfully"
        else
          echo "[$version] patch verification failed — restoring backup"
          cp "$ext_js.bak" "$ext_js"
        fi
    
      elif grep -q '"open-in-targets":async()=>({targets:\[\]})' "$ext_js"; then
        echo "[$version] already patched, skipping"
      else
        echo "[$version] open-in-targets pattern not found — extension structure may have changed"
      fi
    done
    
    echo ""
    echo "Done. Reload VS Code windows to apply: Cmd+Shift+P → Developer: Reload Window"
    

    this script still works.

    Does it work or not?

    [openai.chatgpt-26.415.20818-darwin-arm64] open-in-targets pattern not found — extension structure may have changed
    
    Done. Reload VS Code windows to apply: Cmd+Shift+P → Developer: Reload Window
    

    hmmm, it does work on my machine

  24. ofrnsb commented on Apr 18, 2026

    @ofrnsb
    Author

    Hi all! We should be releasing a VSCE version soon - I will post back when the version is updated.

    Does the newest version 26.415.20818 solved this issue? Same problem happened when I using the codex extention.

    update to 26.5409.20454 using VSIX then run that script. works perfectly

  25. Ga1axy0 commented on Apr 20, 2026

    @Ga1axy0

    26.5415.20818 is the newest version, and it seems like remove the parameter used in the script, which cause the failure of it.

    Image
  26. nicohouillon commented on Apr 22, 2026

    @nicohouillon

    My cpu was about 130% with 417 (or 5417 pre release) , I tried the patch but didnt work :

    [openai.chatgpt-26.5417.40842-darwin-arm64] open-in-targets pattern not found — extension structure may have changed
    
    Done. Reload VS Code windows to apply: Cmd+Shift+P → Developer: Reload Window
    

    Then I downgraded to .409. and applied the patch, but perf got even worse (300%)

    The script doesnt fix the problem unfortunately

  27. nkawli commented on Apr 23, 2026

    @nkawli

    My cpu was about 130% with 417 (or 5417 pre release) , I tried the patch but didnt work :

    [openai.chatgpt-26.5417.40842-darwin-arm64] open-in-targets pattern not found — extension structure may have changed
    
    Done. Reload VS Code windows to apply: Cmd+Shift+P → Developer: Reload Window
    

    Then I downgraded to .409. and applied the patch, but perf got even worse (300%)

    The script doesnt fix the problem unfortunately

    +1

  28. ofrnsb commented on Apr 23, 2026

    @ofrnsb
    Author

    My cpu was about 130% with 417 (or 5417 pre release) , I tried the patch but didnt work :

    [openai.chatgpt-26.5417.40842-darwin-arm64] open-in-targets pattern not found — extension structure may have changed
    
    Done. Reload VS Code windows to apply: Cmd+Shift+P → Developer: Reload Window
    

    Then I downgraded to .409. and applied the patch, but perf got even worse (300%)

    The script doesnt fix the problem unfortunately

    that's the pain-point with personal patch, it only works on specific circumstance, in this case, mine.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingextensionIssues related to the VS Code extension

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions