Skip to content

Thread rename may not sync across multiple open VS Code windows #4

Description

@Just-Boring-Cat

Summary

When multiple VS Code windows are open at the same time, renaming a Codex thread in one window may not update the same thread title in other open windows/sessions.

This appears to be a multi-window state synchronization issue. One window updates the title correctly, but another already-open window can continue showing stale data (and may later overwrite persisted cache/state on shutdown/reload).

Repro Steps

  1. Open VS Code window A with the OpenAI ChatGPT/Codex extension.
  2. Open VS Code window B (same machine, same user profile) with the OpenAI ChatGPT/Codex extension.
  3. Ensure both windows have access to Codex threads and the patch is applied.
  4. In window A, rename a thread using Rename Codex Thread (Command Palette or right-click menu).
  5. Observe the renamed thread in window A updates immediately.
  6. Switch to window B and inspect the same thread.

Actual Behavior

  • Window B may still show the old thread title.
  • Depending on reload/restart timing, stale in-memory state from another window may overwrite the updated title/cache.

Expected Behavior

  • Thread renames should propagate to all open VS Code windows using the same profile/session.
  • At minimum, other windows should refresh the thread title when the thread list is reopened or when a thread becomes active.

Suspected Cause

  • The extension/webview title cache is maintained in-memory per VS Code window.
  • Rename updates are applied in the active window runtime, but other windows do not receive a live sync event.
  • On shutdown/reload, another window may flush stale thread-title cache back to disk.

Impact

  • Confusing UX when working with multiple projects/windows.
  • Renames can appear flaky or "revert" unexpectedly.
  • Harder to trust the rename feature in multi-window workflows.

Possible Fix Directions

  • Broadcast thread-title updates to all open extension hosts/windows (if possible through extension host state or shared event channel).
  • Rehydrate/reconcile thread titles from backend persistent state before writing caches.
  • Add conflict-safe cache writes (avoid overwriting newer timestamps/versions).
  • Refresh titles when opening the thread list or on window focus.

Environment (example)

  • VS Code: multiple windows open
  • OpenAI extension: stable (release) build with patch applied
  • OS: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions