Skip to content

Conversation

@roblourens
Copy link
Member

@roblourens roblourens commented Dec 10, 2025

Port fix for #281758 to main

Sorry for pinging the entire team because I ended up with the wrong base branch somehow

@roblourens roblourens self-assigned this Dec 10, 2025
@roblourens roblourens closed this Dec 10, 2025
@roblourens roblourens reopened this Dec 10, 2025
@roblourens roblourens changed the base branch from roblou/global-dolphin to main December 10, 2025 06:36
@microsoft microsoft deleted a comment from vs-code-engineering bot Dec 10, 2025
@vs-code-engineering
Copy link

vs-code-engineering bot commented Dec 10, 2025

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsProvider.ts

@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 10, 2025
chrmarti
chrmarti previously approved these changes Dec 10, 2025
Copilot AI review requested due to automatic review settings December 10, 2025 06:46
@roblourens roblourens enabled auto-merge (squash) December 10, 2025 06:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ports a fix from issue #281758 by adding a timing field to chat session metadata. The change centralizes timing information (start and end times) in the metadata rather than computing it on-demand, which improves consistency and simplifies code in the sessions provider.

Key Changes

  • Introduced IChatSessionTiming interface with startTime and optional endTime fields
  • Added timing property to IChatModel interface and implemented a getter in ChatModel that computes timing from the session's timestamp and last response
  • Added timing to IChatDetail (required) and IChatSessionEntryMetadata (optional for backward compatibility)

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/chat/common/chatService.ts Added IChatSessionTiming interface and timing field to IChatDetail
src/vs/workbench/contrib/chat/common/chatModel.ts Added timing property to IChatModel interface and implemented getter that computes timing from timestamp and last response
src/vs/workbench/contrib/chat/common/chatSessionStore.ts Added optional timing field to IChatSessionEntryMetadata and updated getSessionMetadata to populate timing from ChatModel or legacy data
src/vs/workbench/contrib/chat/common/chatServiceImpl.ts Added fallback logic to provide default timing for old data that doesn't have timing stored
src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsProvider.ts Simplified by using timing from metadata instead of computing it locally
src/vs/workbench/contrib/chat/browser/actions/chatActions.ts Added timing field when creating mock chat details
src/vs/workbench/contrib/chat/test/common/mockChatModel.ts Added timing property to MockChatModel
src/vs/workbench/contrib/chat/test/browser/localAgentSessionsProvider.test.ts Updated all test cases to include timing field in IChatDetail objects

isActive: true,
lastResponseState: ResponseModelState.Complete
lastResponseState: ResponseModelState.Complete,
timing: { startTime: 0, endTime: 1 },
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inconsistent trailing comma: The timing field has a trailing comma here, but most other test cases in this file don't have one (e.g., lines 325, 349, 375, 383). For consistency, either remove the trailing comma here or add it to all other instances.

Suggested change
timing: { startTime: 0, endTime: 1 },
timing: { startTime: 0, endTime: 1 }

Copilot uses AI. Check for mistakes.
isActive: true,
lastResponseState: ResponseModelState.Complete
lastResponseState: ResponseModelState.Complete,
timing: { startTime: 0, endTime: 1 },
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inconsistent trailing comma: The timing field has a trailing comma here, but most other test cases in this file don't have one (e.g., lines 325, 349, 375, 383). For consistency, either remove the trailing comma here or add it to all other instances.

Suggested change
timing: { startTime: 0, endTime: 1 },
timing: { startTime: 0, endTime: 1 }

Copilot uses AI. Check for mistakes.
isActive: true,
lastResponseState: ResponseModelState.Complete
lastResponseState: ResponseModelState.Complete,
timing: { startTime: 0, endTime: 1 },
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inconsistent trailing comma: The timing field has a trailing comma here, but most other test cases in this file don't have one (e.g., lines 325, 349, 375, 383). For consistency, either remove the trailing comma here or add it to all other instances.

Suggested change
timing: { startTime: 0, endTime: 1 },
timing: { startTime: 0, endTime: 1 }

Copilot uses AI. Check for mistakes.
@roblourens roblourens merged commit b3e4c3e into main Dec 10, 2025
33 of 34 checks passed
@roblourens roblourens deleted the roblou/silly-mink branch December 10, 2025 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants