Chat sessions: expose provider-defined sticky session details in the chat editor
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
> *This was generated by AI during triage.*
## Feature request
Allow chat session providers to publish structured, dynamic session details that VS Code renders in a compact sticky section at the top of the chat editor.
## Motivation
`ChatSessionItem.metadata` supports arbitrary JSON-serializable data, but VS Code does not render it. `description` and `badge` are primarily session-list properties.
Providers currently have to include session state in model-generated Markdown. This has several drawbacks:
- It consumes model context and output tokens.
- It is repeated in every response.
- It scrolls out of view.
- It can become inconsistent with provider-owned state.
Useful session-level details include:
- Topic or task
- Current step
- Pull request link and state
- Suggested next steps
- Branch, environment, or deployment state
## Proposed UX
For sessions that provide details, display a compact section below the session title and above the transcript.
- Keep it visible while the transcript scrolls.
- Update values without adding a chat turn.
- Allow users to collapse the section.
- Preserve collapsed state per session.
- Support links where appropriate.
- Hide the section when no details are provided.
- Remain accessible and usable at narrow editor widths.
## Illustrative API
```ts
interface ChatSessionItem {
details?: readonly ChatSessionDetail[];
}
interface ChatSessionDetail {
readonly id: string;
readonly label: string;
readonly value: string | MarkdownString;
readonly iconPath?: ThemeIcon;
readonly target?: Uri | Command;
}
```
For example:
```ts
item.details = [
{ id: 'step', label: 'Current Step', value: 'Running targeted tests' },
{
id: 'pr',
label: 'Pull Request',
value: 'Open',
target: Uri.parse('https://github.com/microsoft/vscode/pull/123')
}
];
```
The exact API shape is only illustrative. Updating the details should refresh the existing session UI without recreating the session.
## Ownership and safety
- Providers should only update details for sessions they own.
- Arbitrary `metadata` should remain opaque and should not be rendered automatically.
- Only explicitly provided detail fields should appear.
- Markdown and link handling should follow existing chat trust and sanitization rules.
## Related issues
- #327671 requests read access to session status owned by other providers.
- #325507 requests observable agent and subagent lifecycle information.
- #268063 tracked broader chat-session API design work.
This proposal is complementary: it provides a provider-to-user presentation surface for dynamic session-level information.
Contributor guide
Assessment
This issue has not been assessed yet.