Skip to content

Codex extension 0.4.69 doesn't work with code-server (persisted-atom sync failure) #10421

Closed

Description

@sanchomuzax

Environment

  • code-server version: 4.107.1 (VSCode 1.107.1)
  • Codex extension version: 0.4.69 (broken), 0.4.68 (works)
  • OS: Debian 13 / Raspberry Pi 5 (ARM64)
  • Node.js: v20.19.6

Problem

Codex extension 0.4.69 fails to load in code-server with this error in logs:
[error] [persisted-atom] host did not respond to sync request; continuing with legacy state only

The sidebar shows a loading spinner indefinitely.

Workaround

Downgrading to version 0.4.68 resolves the issue:

code-server --install-extension [email protected]
Additional context
The extension activates successfully
Login works (verified via CLI)
The issue is specific to code-server, desktop VSCode works fine

Sources:

Activity

  1. etraut-openai commented on Feb 2, 2026

    @etraut-openai
    Contributor

    Thanks for the bug report. I'm kind of surprised this ever worked. We don't test for this use case. I'll see if it's easy to fix.

  2. added
    bug
    extension
    on Feb 2, 2026
  3. not-Boris commented on Feb 3, 2026

    @not-Boris

    +1; just getting this today after updating to 0.4.69 using code-server

  4. aformusatii commented on Feb 5, 2026

    @aformusatii

    I’m experiencing the same issue on v0.4.71. I’ve downgraded to v0.4.68 and will stay on that version until a fix is released.
    Thanks a lot for your work on this!

  5. VTSTG233 commented on Feb 5, 2026

    @VTSTG233

    +1 I just discovered there's a related issue, which caused me to accidentally create a new topic, as I couldn't find any other posts with the same problem. I searched again and found that it already exists. Hope this issue is resolved soon, thank you.

  6. noskillahh commented on Feb 6, 2026

    @noskillahh

    Unfortunate timing for this to break, with gpt-5.3-codex now being available. Code-server is my primary IDE.

    Same issue for me, window doesnt load in any version after v0.4.68.

  7. BattermanZ commented on Feb 7, 2026

    @BattermanZ

    Same issue as well for me!

  8. huyleict commented on Feb 8, 2026

    @huyleict

    code-server: v4.108.2
    Code: 1.108.2
    Codex extension version: 0.4.69, v0.4.71
    Same issue for me.

  9. guagua0 commented on Feb 9, 2026

    @guagua0

    Only Code-server is not working; VS Code works normally.

  10. WhammyLeaf commented on Feb 10, 2026

    @WhammyLeaf
    Contributor

    Having the same problem. Sorry for raising a duplicate issue 😄

  11. seo-rii commented on Feb 12, 2026

    @seo-rii

    The problem occurs because of the enhanced verification of webview message. Since 0.4.69, codex backend(node) verifies webview message with origin, which is incompatible with code-server.
    I made a simple patch script with codex to replace getTrustedMessageForView with non-verification function. This works well with 0.4.69-0.4.73, but maybe this can be vulnerable, so use with caution. You should install nodejs to run this script.

    bash <(curl -sL https://gist.githubusercontent.com/seo-rii/99efd0cb50e74cad4ce2ca6978919b6b/raw/codex-patch.sh)

    The raw content is here :

    #!/usr/bin/env bash
    set -euo pipefail
    
    EXT_ROOT="${HOME}/.local/share/code-server/extensions"
    VERSION="${1:-}"
    
    if [ -z "$VERSION" ]; then
      candidates=()
      for dir in "${EXT_ROOT}"/openai.chatgpt-*-universal; do
        [ -d "$dir" ] || continue
        base="${dir##*/}"
        ver="${base#openai.chatgpt-}"
        ver="${ver%-universal}"
        [ -n "$ver" ] && candidates+=("$ver")
      done
      if [ ${#candidates[@]} -eq 0 ]; then
        echo "No openai.chatgpt-* extension found under $EXT_ROOT" >&2
        exit 1
      fi
      VERSION="$(printf '%s\n' "${candidates[@]}" | sort -V | tail -n1)"
    fi
    
    # Only patch versions newer than 0.4.68
    if [ "$(printf '%s\n' "0.4.68" "$VERSION" | sort -V | tail -n1)" = "0.4.68" ]; then
      echo "Version $VERSION is <= 0.4.68; patch not required."
      exit 0
    fi
    
    EXT_DIR="${EXT_ROOT}/openai.chatgpt-${VERSION}-universal"
    ASSET_DIR="${EXT_DIR}/webview/assets"
    
    if [ ! -d "$EXT_DIR" ]; then
      echo "Extension dir not found: $EXT_DIR" >&2
      exit 1
    fi
    
    if [ ! -d "$ASSET_DIR" ]; then
      echo "Assets dir not found: $ASSET_DIR" >&2
      exit 1
    fi
    
    shopt -s nullglob
    JS_FILES=("$ASSET_DIR"/index-*.js)
    if [ ${#JS_FILES[@]} -eq 0 ]; then
      echo "No index-*.js found in $ASSET_DIR" >&2
      exit 1
    fi
    
    for f in "${JS_FILES[@]}"; do
    
      # Create a backup once.
      if [ ! -f "$f.bak" ]; then
        cp "$f" "$f.bak"
      fi
    
      node - "$f" <<'NODE'
    const fs = require('fs');
    const path = process.argv[2];
    if (!path || path === '-') {
      console.error('Missing target JS file path');
      process.exit(2);
    }
    const text = fs.readFileSync(path, 'utf8');
    
    function replaceByName(src) {
      const fnName = 'function getTrustedMessageForView';
      const start = src.indexOf(fnName);
      if (start === -1) return null;
      const braceStart = src.indexOf('{', start);
      if (braceStart === -1) return null;
      let i = braceStart + 1;
      let depth = 1;
      while (i < src.length && depth > 0) {
        const ch = src[i];
        if (ch === '{') depth++;
        else if (ch === '}') depth--;
        i++;
      }
      if (depth !== 0) return null;
      const end = i;
      const replacement =
        'function getTrustedMessageForView(rt){const ut=rt.data;return ut==null||typeof ut!="object"||!hasStringType(ut)?null:ut}';
      return src.slice(0, start) + replacement + src.slice(end);
    }
    
    function replaceByPattern(src) {
      const marker = 'origin.startsWith';
      let from = 0;
      while (true) {
        const idx = src.indexOf(marker, from);
        if (idx === -1) return null;
        from = idx + marker.length;
    
        // Find nearest function start before marker.
        let fnStart = src.lastIndexOf('function', idx);
        while (fnStart !== -1) {
          const before = fnStart === 0 ? '' : src[fnStart - 1];
          if (!/[A-Za-z0-9_$]/.test(before)) break;
          fnStart = src.lastIndexOf('function', fnStart - 1);
        }
        if (fnStart === -1) continue;
    
        const braceStart = src.indexOf('{', fnStart);
        if (braceStart === -1) continue;
        let i = braceStart + 1;
        let depth = 1;
        while (i < src.length && depth > 0) {
          const ch = src[i];
          if (ch === '{') depth++;
          else if (ch === '}') depth--;
          i++;
        }
        if (depth !== 0) continue;
        const fnEnd = i;
        const fnText = src.slice(fnStart, fnEnd);
        if (!fnText.includes(marker) || !fnText.includes('.data')) continue;
    
        const nameMatch = fnText.match(/function\s+([A-Za-z0-9_$]+)\s*\(/);
        const paramMatch = fnText.match(/function\s+[A-Za-z0-9_$]+\s*\(([^)]*)\)/);
        if (!nameMatch || !paramMatch) continue;
        const fnName = nameMatch[1];
        const param = (paramMatch[1] || 't').split(',')[0].trim() || 't';
    
        const helperMatch = fnText.match(/\|\|!([A-Za-z0-9_$]+)\(/);
        const helper = helperMatch ? helperMatch[1] : null;
        const helperExpr = helper
          ? `!${helper}(i)`
          : '!(i.type&&typeof i.type=="string")';
        const replacement = `function ${fnName}(${param}){const i=${param}.data;return i==null||typeof i!="object"||${helperExpr}?null:i}`;
    
        return src.slice(0, fnStart) + replacement + src.slice(fnEnd);
      }
    }
    
    let updated = replaceByName(text);
    if (updated == null) updated = replaceByPattern(text);
    
    if (updated == null) {
      console.log('skip (no origin filter found):', path);
      process.exit(0);
    }
    
    if (updated === text) {
      console.log('already patched:', path);
      process.exit(0);
    }
    
    fs.writeFileSync(path, updated, 'utf8');
    console.log('patched', path);
    NODE
    
    done
    
    echo "Done. Reload the Code-Server window (or restart) to apply."
  12. shijie-oai commented on Feb 12, 2026

    @shijie-oai
    Contributor

    Hi all! We have just released version 0.4.74 which should contain fix for code server. Please let us know if you are still seeing the issue. Thanks!

  13. DeviaVir commented on Feb 12, 2026

    @DeviaVir

    Hi all! We have just released version 0.4.74 which should contain fix for code server. Please let us know if you are still seeing the issue. Thanks!

    Confirmed the "spinner" problem is solved, however, did 5.3-codex disappear in 0.4.74?

    edit: 5.3-codex just reappeared, thanks!

  14. sanchomuzax commented on Feb 12, 2026

    @sanchomuzax
    Author

    Its wotking fine, thanks!

    Image
  15. noskillahh commented on Feb 12, 2026

    @noskillahh

    Works for me too, great :)

  16. RgazHTale commented on Sep 8, 2026

    @RgazHTale

    I had the same problem with Codex extension version v26.901.22334. VS Code show error: "command 'chatgpt.openSidebar' not found". I downgraded the extension to older version, and the problem was resolved.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugextension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions