microsoft / microsoft/vscode

Agent session list and opened default chat show different titles

Open
#332,595 0 comments 0 reactions 1 assignee Claimed by @justschen View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## Reproduction

(reproduction on my computer)

1. Open the Chat sessions list in editor window.
2. Find the entry titled **Add extension launch config**.
3. Click the entry.

## Actual

The opened Chat view header says **Simplify VS Code adapter** even though the clicked list item says **Add extension launch config**.

## Expected

The list item and the view opened from it should use the same user-facing title, or the UI should make it clear that one is a parent agent-session title and the other is a child-chat title.

## Investigation

I attached `jsdbg` to the workbench renderer and captured a V8 heap snapshot. This is not a wrong-row selection or stale DOM text: both UI surfaces resolve to the same underlying agent session:

```text
copilotcli:/c95667f4-a3b2-4400-864e-f45a63cf4054
```

The live renderer heap contains:

```text
SessionState.title = "Add extension launch config"
default ChatState.title = "Simplify VS Code adapter"
ChatModel._sessionId = "agent-host-copilotcli:/c95667f4-a3b2-4400-864e-f45a63cf4054"
ChatModel._customTitle = "Simplify VS Code adapter"
```

The session has 23 chat catalog entries, and the opened chat URI is also the session's `defaultChat`:

```text
ahp-chat://default/Y29waWxvdGNsaTovYzk1NjY3ZjQtYTNiMi00NDAwLTg2NGUtZjQ1YTYzY2Y0MDU0
```

The two rendering paths intentionally read different fields:

- The sessions list maps `SessionSummary.title` in `AgentHostSessionListController._makeItemFromSummary`.
- `getChatTitle` in `AgentHostSessionHandler` returns `chat.title` before falling back to `state.title` for the default chat.
- `AgentHostStateManager.updateChatTitle` explicitly allows the default chat to have an independent non-empty title, while `_snapshotDefaultChatTitle` copies the session title only when the chat title is initially empty.

This permits the parent session title and default-chat title to diverge, but the navigation currently presents them as if they identify the same item.

## Version

```text
Version: 1.135.0-insider
Commit: 0052619e71feb774a574b37f4f2ea20c36547373
Architecture: arm64
OS: Windows
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.