[VS Code] Existing task header becomes "New chat" while conversation history loads normally
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the IDE extension are you using?
openai.chatgpt 26.901.22334-linux-x64; bundled Codex CLI 0.153.0
What subscription do you have?
API-key authentication with a custom provider
Which IDE are you using?
Visual Studio Code with Remote SSH
What platform is your computer?
Windows client; Linux x86_64 remote extension host
What issue are you seeing?
Opening an existing task in the Codex VS Code extension changes its header to the localized New chat label (新聊天) even though its conversation history loads successfully. The task list has a meaningful preview-derived title, but the opened task does not recover that title.
I had also observed the same title symptom during earlier use.
Read-only thread/read calls with includeTurns: false for two affected tasks returned name: null and nonempty preview; their history mode was paginated. Resume logs showed successful history loading in roughly 0.6 seconds. This was a title restoration problem, not a missing transcript or a failed model response.
What steps can reproduce the bug?
Observed behavior:
- Have an existing, previously used task. The tasks inspected during the latest investigation had
name: nulland a meaningful, nonempty metadatapreview. - Open it from the task list after reloading the VS Code window.
- Its header immediately becomes New chat, while the recent conversation content loads normally.
- The title remains New chat after history loading completes.
Minimal metadata shape for a focused regression test (illustrative, not a complete RPC response):
{"name": null, "preview": "A meaningful existing task title", "historyMode": "paginated"}
Initialize the live conversation from this metadata, then replace its synthetic preview turn with real history data, without a prepopulated summary/catalog cache. Verify that the display title survives. A clean-install end-to-end reproduction still needs confirmation.
What is the expected behavior?
Opening an existing task should preserve the same meaningful display title used in the task list, independently of whether the original first turn is loaded. Explicitly assigned or user-renamed titles should retain precedence. Restoring a display title should not require loading the entire transcript or writing a new name to persistent storage.
Additional information
Identified failure path
In the inspected bundle, task-list title formatting already uses pUt(thread, formatter), which prefers a name and otherwise formats the preview. However, the live conversation initialization and metadata/resume title assignments used only thread.name:
CUtinitializedtitlefromnameand seeded a synthetic first turn containingpreview.- When real history replaced that synthetic turn, the preview was no longer available through that fallback.
- The metadata and final resume handlers also used only
name, which was null for the affected tasks.
The display title can be lost during history hydration. It should be resolved consistently from the available name or preview metadata.
Local fix
I reused the existing task-list formatter at all three title restoration points in webview/assets/app-initial-8208b359e7cf.js. These names/fragments are specific to this build; this is a description of a local bundle patch, not a source-level PR.
- let d=s.name?.trim()??``,f=IG(d)||d,p=s.forkedFromId
+ let d=s.name?.trim()??``,f=pUt(s,IG)??d,p=s.forkedFromId
- let n=S.thread.name?.trim()??``,{updatedAt:i,recencyAt:a}=RG(S.thread);
+ let n=pUt(S.thread,IG)??``,{updatedAt:i,recencyAt:a}=RG(S.thread);
- Ve=Ne.thread.gitInfo,He=Ne.thread.name?.trim()??``,Ue=await he.getResult(Ne,Be);
+ Ve=Ne.thread.gitInfo,He=pUt(Ne.thread,IG)??``,Ue=await he.getResult(Ne,Be);
The existing guards that preserve an already assigned or user-renamed title remain unchanged. The fix reuses existing preview cleanup, truncation and delegation-envelope handling. It does not rename stored tasks, modify the session database, delete history, or request a generated title from a model.
Validation and limits
- After applying the fix and reloading VS Code, I tried the affected UI flow and the title appeared to remain correct.
- An isolated test using the observed
name: null/ nonemptypreviewmetadata shape reproduced the empty live title before the fix and retained it afterward when the synthetic preview turn was replaced by real history data. - Targeted checks covered explicit names, preserving renamed titles, empty previews, truncation, separate tasks and delegation inputs. Unchanged Markdown-normalization dependencies were stubbed for the plain-text fixtures; these were not full frontend integration tests.
- The patched bundles passed JavaScript syntax checks.
Please investigate this title-restoration path and consider using the shared metadata-based title resolver consistently for task lists and opened tasks. A useful regression test would open an unnamed task with a nonempty preview while its oldest turn is absent, then verify that its title survives history hydration.
Related symptom: #22948 concerns macOS Desktop menu-bar Recent titles after restart. This report concerns the opened VS Code task header; I have not established that they share a root cause.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in webview/assets/app-initial-8208b359e7cf.js at the CUt initialization and metadata/resume title assignments, then inspect the existing pUt task-list formatter. Add a focused regression test for an unnamed task with a nonempty preview whose synthetic turn is replaced by paginated history, and run the JavaScript syntax checks. Done means the preview-derived title survives hydration while explicit or renamed titles retain precedence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, vscode
- Domain
- developer-experience, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100