Skip to content

Codex in VS Code stalls / “Thinking” indefinitely; messages replay; Failed to release queued message send lock + undefined is not valid JSON ** Repair ** #50404

Closed

Description

@VitalOverdose

What version of the Codex App are you using (From “About Codex” dialog)?

latest

What subscription do you have?

pro

What platform is your computer?

Microsoft Windows NT 10.0.26300.0 x64

What issue are you seeing?

Codex in VS Code stalls / “Thinking” indefinitely; messages replay; Failed to release queued message send lock + undefined is not valid JSON

Product: Codex in VS Code (OpenAI ChatGPT extension: openai.chatgpt)

Duration: ~24 hours (intermittent; some replies eventually return)

What happens:

Codex chat frequently stalls on “Thinking” and never completes.

Completed prompts sometimes reappear/replay later (same client message ID sent again minutes later).

Feedback submission via / fails with “couldn’t verify feedback permissions.”

Observed error (extension log):

Failed to release queued message send lock

Also reports: "undefined" is not valid JSON

Evidence:

VS Code extension log:
C:\Users\Owner\AppData\Roaming\Code\logs...\exthost\openai.chatgpt\Codex.log

Session logs show identical client message IDs replayed after replies completed (example: a prompt completed ~22s, then the same message arrived again ~10 minutes later):
C:\Users\Owner.codex\sessions...

What I tried:

Updated VS Code / restarted / force-closed Code.exe

Started multiple new Codex chats

No VPN (normal network)

Impact:

Codex becomes unreliable/unusable due to frequent stalls and duplicated sends.

Please investigate: message delivery/retry/queue lock handling in the VS Code extension leading to stuck sends and duplicated message IDs.

What steps can reproduce the bug?

any time i send a message

What is the expected behavior?

spinners and stuck chat

Additional information

Image

New observation: while the chat was stalled with several messages showing as pending, I deleted one pending message using its bin icon. The chat immediately resumed responding without restarting VS Code.

Moving/resizing the UI has occasionally appeared to revive it too, but inconsistently. Deleting the pending message is the clearest recovery trigger I’ve observed so far. I haven’t confirmed whether it reliably reproduces.

its trying to fix itself every now end then

Image

latest reply

The strongest lead is a fault in the Codex extension’s message handling. I checked your current log (line 426), and this error is still occurring today:
Failed to release queued message send lock
"undefined" is not valid JSON
The extension is throwing an error while handling the queue. That could explain the next prompt waiting and sent text remaining in the composer. I haven’t proved that this causes every stall or found a verified fix. The desktop app doesn’t explain stalls that predated its installation.
This particular reply was also delayed by a separate Windows sandbox failure during the log check.
The official OpenAI troubleshooting page doesn’t document a fix for this exact error.

Update

Ok so ive been forcing codex to fix this itself. maybe openAI can refund me the tokens ive used to work through it. We have modified the extension.

The fix is a local patch to your installed Codex extension. It addresses three queue problems:

  1. Delivered messages left in the queue. It checks message IDs against recorded delivery evidence and removes matches. It uses exact IDs, so a new message with identical text is preserved.
  2. Old state bringing messages back. Successful sends now get permanent delivery receipts on disk. Queue reads, writes and notifications filter against those receipts, and the sender refuses to resend those IDs—even after restarting or after the original ten-minute protection expires.
  3. An error after releasing the send lock. The extension returned undefined, which its interface tried to parse as JSON. The patch returns valid JSON (null) so that successful cleanup doesn’t produce that error.

Your conversation history was preserved. The original extension is backed up, and the rollback script restores it.

The 25 tests passed, including stale-state replay and restart cases. That verifies the targeted queue behavior; the live panel still needs checking after Developer: Reload Window. An extension update may replace this local patch.

Activity

  1. added
    app
    on Oct 2, 2026
  2. added
    bug
    extension
    windows-os
    connectivity
    on Oct 2, 2026
  3. debuggerone commented on Oct 2, 2026

    @debuggerone

    We independently investigated the same release-response error and a separate stale-message replay gap on native Linux (extension 26.5928.31416). I added the findings, controlled live queue/steer checks, and an unresolved persistence trace to the technical issue: #49834 (comment)

    The JSON parse failure happens after the host has released the lock; by itself it does not prove that the lock remains held or causes the replay. A separate owner-side receipt check before lock acquisition prevented a reproduced resend of an already accepted pending message. The initial cause of the stale persisted record remains unresolved. Short local verification passed with both changes installed; this is not an upstream fix or proof that all stalls are resolved. Related prior workaround: #49975 (comment)

  4. VitalOverdose commented on Oct 5, 2026

    @VitalOverdose
    Author

    Ive managed to come up with an unoffcial experimental fix modifiying the extension

    1. Delivered messages left in the queue. It checks message IDs against recorded delivery evidence and removes matches. It uses exact IDs, so a new message with identical text is preserved.

    2. Old state bringing messages back. Successful sends now get permanent delivery receipts on disk. Queue reads, writes and notifications filter against those receipts, and the sender refuses to resend those IDs—even after restarting or after the original ten-minute protection expires.

    3. An error after releasing the send lock. The extension returned undefined, which its interface tried to parse as JSON. The patch returns valid JSON (null) so that successful cleanup doesn’t produce that error.

    Your conversation history was preserved. The original extension is backed up, and the rollback script restores it.
    The 25 tests passed, including stale-state replay and restart cases. That verifies the targeted queue behavior; the live panel still needs checking after Developer: Reload Window. An extension update may replace this local patch.

    Experimental workaround: Codex VS Code queue stalls (26.930.21537, Windows x64)

    I am sharing a small experimental patch for the follow-up queue failures that log:

    Failed to release queued message send lock
    "undefined" is not valid JSON

    The change normalizes void host responses to JSON null, returns null from successful queue-release handlers, and keeps delivery receipts keyed by exact thread and client-message IDs. Queue reads, writes and notifications filter IDs already recorded as delivered; serialized pruning removes those stale entries from storage. Uncertain local submissions can be reconciled against exact accepted IDs returned by thread/read.

    The attached review package contains a minimal diff, helper source, a read-only verification tool and validation notes. The diff targets the exact original bundle hash for extension 26.930.21537; it is not intended for other builds.

    The local repair has a recorded 25/25 controlled test result and two read-only app-server history checks. Packaging also verified the installed hashes and exact forward/reverse diff reconstruction. The original tests were not rerun during packaging, and live queue, cancellation and reload testing remains incomplete.

    My local installation used a private historical delivery seed. That seed is omitted: this public package may not clear older delivered messages still marked pending. It should not be presented as a universal or supported installer.

    Several replies have completed since the local modification. I would welcome maintainer review and independent testing before calling this a permanent fix.

    Related report: #50403
    The ZIP contains the code changes, helper, verification tool and test notes.

    experimental, for developer review, targeting version 26.930.21537
    codex-queue-workaround-26.930.21537.zip

  5. VitalOverdose commented on Oct 6, 2026

    @VitalOverdose
    Author

    IveSan83
    Please keep release announcements for your patch in your own discussion. You’ve already linked it here, so anyone interested can follow updates there.

    I shared my fix because it resolved the problem on my machine and might help others. I’d like this thread to stay focused on that fix and feedback from people using it.

  6. changed the title [-]Codex in VS Code stalls / “Thinking” indefinitely; messages replay; Failed to release queued message send lock + undefined is not valid JSON[/-] [+]Codex in VS Code stalls / “Thinking” indefinitely; messages replay; Failed to release queued message send lock + undefined is not valid JSON ** Fix **[/+] on Oct 6, 2026
  7. changed the title [-]Codex in VS Code stalls / “Thinking” indefinitely; messages replay; Failed to release queued message send lock + undefined is not valid JSON ** Fix **[/-] [+]Codex in VS Code stalls / “Thinking” indefinitely; messages replay; Failed to release queued message send lock + undefined is not valid JSON ** Repair **[/+] on Oct 6, 2026
  8. VitalOverdose commented on Oct 6, 2026

    @VitalOverdose
    Author

    Update: v2 of the Codex queue workaround

    Targets extension 26.930.21537 only, with exact bundle-hash verification.
    Thanks for the independent testing of the first package. I reproduced the receipt-write failure that leaves the send lock held, and both queue-storage loss scenarios.

    This revision adds:

    • Guaranteed lock cleanup when saving a delivery receipt fails, while preserving the error.
    • One overall history-check deadline, bounded concurrency and shared in-flight reads.
    • Recovery from history-read failures without discarding uncertain messages.
    • Exact returned-thread and accepted client-ID checks, including explicit client-ID overrides.
    • Reconciliation of explicitly local pending entries without a private seed.
    • Handling of malformed IDs, late responses and retries after timeouts.

    The included test suite passes 71 checks in Node and the same 71 in VS Code’s bundled runtime: 142 test executions. These are fresh, reproducible offline checks.

    The queue-storage races remain unresolved. Stale Memento snapshots and competing whole-queue writers still reproduce in controlled tests against both the original vendor host and v2. Delivery receipts do not provide cross-host queue consistency. Those defect reproductions are reported separately from passing repair tests.
    The ZIP includes source, checksums, runnable tests, a read-only verifier and a builder that prepares verified patch/rollback files without installing them.
    [

    codex-queue-workaround-26.930.21537-v2.zip

    ](url)
    This remains an experimental workaround. Live panel, reload and concurrent-client behavior are not verified

  9. IveSan83 commented on Oct 7, 2026

    @IveSan83

    Hey @VitalOverdose — sorry, that wasn't intentional. I got involved in the discussion and ended up posting release updates in your thread. I've removed my previous comments and moved the research and updates to my own discussion. I'll keep this thread focused on your fix. Feel free to ping me if you'd like to compare findings or tests. Thanks for pointing it out.

  10. VitalOverdose commented on Oct 7, 2026

    @VitalOverdose
    Author

    IveSan83
    Appreciated. Right now im happy ive got the extension to a point where i can get back to work which is my main focus. Good luck with whatever you are doing.

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

    appbugconnectivityextensionwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions