-
Notifications
You must be signed in to change notification settings - Fork 37.9k
Add handleRestoreCheckpoint to ChatSessionContentProvider API with UI support for contributed sessions #294792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: TylerLeonhardt <[email protected]>
Co-authored-by: TylerLeonhardt <[email protected]>
Co-authored-by: TylerLeonhardt <[email protected]>
TylerLeonhardt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot you don't need to bump the version if it's purely additive
also, before this change, it seems like the restore checkpoint UI does not show up for non-default agents.
Is there a UI change here that actually enables that UI based on the capabilities of the content provider?
Co-authored-by: TylerLeonhardt <[email protected]>
Fixed in e99a31c - reverted the version bump since the change is purely additive. Regarding the UI: The restore checkpoint UI already shows for non-coding-agent sessions via |
|
@copilot no you are wrong. I don't see the Restore Checkpoint UI when I use any other Session Target other than Local (the default). Why is that? |
…ckpoints Co-authored-by: TylerLeonhardt <[email protected]>
You're right — contributed session types are locked to the coding agent via Fixed in 08ec2a5:
|
Description
Restore Checkpoint currently only works for the default agent, which uses full history-based restoration. External agents (e.g., Claude SDK) that track state via user message IDs cannot customize this behavior. Additionally, the checkpoint UI was hidden for all contributed (non-default) session targets because they are locked to the coding agent.
Changes
API
handleRestoreCheckpoint(resource, requestId, token)toChatSessionContentProvidersupportsCheckpoints?: booleantoChatSessionCapabilities— extensions declare checkpoint support at registration timeImplementation
ExtHostChatSessionsShape.$handleRestoreCheckpointIChatSessionsService.getContentProvider()for provider accessIChatSessionsService.supportsCheckpointsForSessionType()to query capabilitiessupportsCheckpointsthrough registration: ExtHost → Protocol → MainThread → ServicechatEditingActions.tsto invoke provider handler if present (before the editing session guard), else fall back to default snapshot restorationUI Changes
chatSessionSupportsCheckpointscontext key, set when locking to a coding agent with checkpoint supportlockToCodingAgentto accept{ restorable }option — callers (chatEditor, chatViewPane, chatInputPart) checksupportsCheckpointsForSessionType()and pass it throughwhenclauses for RestoreCheckpoint, RestoreLastCheckpoint, and UndoRequests actions to useContextKeyExpr.or(lockedToCodingAgent.negate(), sessionSupportsCheckpoints)— checkpoint UI now shows for contributed session targets that declare checkpoint supportExample Usage
Providers not implementing the method continue using default behavior. Providers that register with
supportsCheckpoints: truewill see checkpoint UI even when using a non-default session target.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.