Repository navigation
sessions: add saved drafts and scheduled chat requests - #347963
Merged
Megan Rogge (meganrogge) merged 14 commits intoNov 13, 2026
Merged
Conversation
Megan Rogge (meganrogge)
requested
a balanced review from Copilot
and removed request for
Copilot
November 12, 2026 18:34
Copilot stopped reviewing on behalf of
Megan Rogge (meganrogge) due to an error
November 12, 2026 18:36
Contributor
Screenshot ChangesBase: Changed (1)Added (4) |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Saved-draft restoration can enable sending in the wrong workspace, while unresolved storage and scheduling races can lose users' compositions.
12 open issues
Failed workspace restore can send in the wrong workspace · New Successful comparisons leave sent drafts in Drafts · New Accepted handoffs can suppress later identical submissions · New Draft restoration incorrectly requires Automation eligibility · New Scheduling completion can clear a different draft's input · New Unreadable draft storage blocks sending · New Removed draft identity can break later scheduling · New Draft restore records an intermediate identity in navigation history · New Cancelled history restore can persist mismatched draft identity and input · New Deleting a stowed draft can navigate away from the current session · New Draft-opening failures are unhandled and not shown to users · New Concurrent storage writes can permanently drop drafts · New
What changed in this PR
Adds saved drafts and Send Later to the Agents window, building on the existing Sessions and durable Automations infrastructure.
Changes:
- Preserve unsent compositions, attachments, target configuration, and navigation identity.
- Add Drafts and Scheduled sections with resume, preview, rescheduling, cancellation, and recovery actions.
- Extend Automation contracts and provider adapters for one-time requests and exact existing-chat targets, behind independent default-off settings.
| File | Description |
|---|---|
src/vs/workbench/services/sessions/common/session.ts |
Adds scheduled-chat session provenance. |
src/vs/workbench/services/sessions/browser/sessionsRecencyHistory.ts |
Gives drafts distinct navigation identities. |
src/vs/workbench/contrib/sessions/test/common/scheduledChatRequest.test.ts |
Tests durable attachment capture and time parsing. |
src/vs/workbench/contrib/sessions/test/common/newChatDraftState.test.ts |
Tests saved-draft persistence and revisions. |
src/vs/workbench/contrib/sessions/test/browser/views/testSessionsList.ts |
Supports selecting pending rows in tests. |
src/vs/workbench/contrib/sessions/test/browser/sessionsListModelService.test.ts |
Tests normal listing for scheduled chats. |
src/vs/workbench/contrib/sessions/test/browser/sessionDraftsService.test.ts |
Covers draft lifecycle and recovery. |
src/vs/workbench/contrib/sessions/providers/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts |
Maps conversation identities and disables one-time authoring. |
src/vs/workbench/contrib/sessions/providers/copilotChatSessions/browser/copilotChatSessionsProvider.ts |
Exposes synchronous draft configuration capture. |
src/vs/workbench/contrib/sessions/providers/agentHost/browser/reconnectableAgentHostAutomationStore.ts |
Forwards negotiated scheduling capabilities. |
src/vs/workbench/contrib/sessions/providers/agentHost/browser/localAgentHostSessionsProvider.ts |
Enables local scheduling and conversation mapping. |
src/vs/workbench/contrib/sessions/providers/agentHost/browser/baseAgentHostSessionsProvider.ts |
Captures draft configuration and scheduled provenance. |
src/vs/workbench/contrib/sessions/providers/agentHost/browser/agentHostAutomationStore.ts |
Translates captured requests, schedules, and receipts. |
src/vs/workbench/contrib/sessions/common/sessionsProvider.ts |
Defines draft and scheduling provider contracts. |
src/vs/workbench/contrib/sessions/common/sessionsManagement.ts |
Adds draft configuration orchestration. |
src/vs/workbench/contrib/sessions/common/sessionConfig.ts |
Defines independent feature-setting keys. |
src/vs/workbench/contrib/sessions/common/scheduledChatRequest.ts |
Captures durable context and parses local times. |
src/vs/workbench/contrib/sessions/common/savedSessionDrafts.ts |
Persists drafts with stable IDs and revisions. |
src/vs/workbench/contrib/sessions/common/contextkeys.ts |
Adds input scheduling availability context. |
src/vs/workbench/contrib/sessions/browser/views/sessionsView.ts |
Combines Drafts and Scheduled sections. |
src/vs/workbench/contrib/sessions/browser/views/sessionsList.ts |
Integrates pending rows with list behavior. |
src/vs/workbench/contrib/sessions/browser/views/pendingSessions.ts |
Renders and filters pending items. |
src/vs/workbench/contrib/sessions/browser/sessionsService.ts |
Connects saved drafts to navigation. |
src/vs/workbench/contrib/sessions/browser/sessionsManagementService.ts |
Restores provisional-session configuration. |
src/vs/workbench/contrib/sessions/browser/sessionsListModelService.ts |
Lists scheduled-chat sessions normally. |
src/vs/workbench/contrib/sessions/browser/sessionNavigation.ts |
Restores draft history with cancellation. |
src/vs/workbench/contrib/sessions/browser/sessionGroupsService.ts |
Preserves pending draft group selection. |
src/vs/workbench/contrib/sessions/browser/sessionDraftsService.ts |
Manages draft ownership and lifecycle. |
src/vs/workbench/contrib/sessions/browser/chat/sharedChatInputComposer.ts |
Adds draft callbacks and scheduling lifecycle. |
src/vs/workbench/contrib/sessions/browser/chat/newChatWidget.ts |
Connects composition capture, restoration, and scheduling. |
src/vs/workbench/contrib/sessions/browser/chat/newChatComposerInput.ts |
Extends composer options for drafts and scheduling. |
src/vs/workbench/contrib/sessions/browser/chat/chatView.ts |
Registers existing-chat scheduling and send guards. |
src/vs/workbench/contrib/chat/test/browser/actions/chatQueueActions.test.ts |
Tests attachment-only secondary send options. |
src/vs/workbench/contrib/chat/common/automations/automationService.ts |
Extends Automation creation and update contracts. |
src/vs/workbench/contrib/chat/common/automations/automationBlueprint.ts |
Rejects nonportable one-time blueprints. |
src/vs/workbench/contrib/chat/common/automations/automation.ts |
Models one-time schedules and captured requests. |
src/vs/workbench/contrib/chat/common/actions/chatContextKeys.ts |
Tracks additional send actions. |
src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.ts |
Includes contributed secondary send actions. |
src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts |
Adds a send-options split button. |
src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.ts |
Exposes options for attachment-only busy inputs. |
src/vs/sessions/SESSIONS.md |
Documents draft and scheduling ownership. |
src/vs/sessions/SESSIONS_LIST.md |
Documents pending-item placement and listing. |
src/vs/sessions/services/sessions/test/browser/sessionsManagementService.test.ts |
Tests saved-draft navigation integration. |
src/vs/sessions/services/sessions/test/browser/sessionNavigation.test.ts |
Covers draft history and cancellation. |
src/vs/sessions/services/sessions/browser/sessionsCoreServices.registration.ts |
Registers draft and scheduling services. |
src/vs/sessions/contrib/sessions/test/browser/sessions.contribution.test.ts |
Verifies independent experimental settings. |
src/vs/sessions/contrib/sessions/test/browser/pendingSessionsList.test.ts |
Covers pending-row interaction and filtering. |
src/vs/sessions/contrib/sessions/test/browser/automationsView.test.ts |
Tests scheduled-definition visibility. |
src/vs/sessions/contrib/sessions/test/browser/automationSessionsListing.test.ts |
Exempts scheduled chats from reply gating. |
src/vs/sessions/contrib/sessions/browser/views/automationsView.ts |
Filters scheduled definitions and formats one-time schedules. |
src/vs/sessions/contrib/sessions/browser/views/automationsAccessibility.ts |
Describes one-time schedules accessibly. |
src/vs/sessions/contrib/sessions/browser/sessions.contribution.ts |
Registers default-off feature settings. |
src/vs/sessions/contrib/sessions/browser/automationSessionsListing.ts |
Bypasses recurring-Automation listing rules for scheduled chats. |
src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts |
Tests cached scheduled-chat provenance. |
src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostAutomationStore.test.ts |
Covers scheduling capabilities, mapping, and receipts. |
src/vs/sessions/contrib/chat/test/browser/sharedChatInputComposerActions.test.ts |
Tests Send Later gating and input routing. |
src/vs/sessions/contrib/chat/browser/sharedChatInputComposer.contribution.ts |
Contributes the Send Later command. |
src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.ts |
Explains draft and scheduling keyboard workflows. |
src/vs/sessions/contrib/automations/test/browser/automationDialog.test.ts |
Tests read-only one-time previews. |
src/vs/sessions/contrib/automations/browser/providerAutomationService.ts |
Routes explicitly supported scheduling operations. |
src/vs/sessions/contrib/automations/browser/automationDialogService.ts |
Protects one-time definitions from recurring edits. |
src/vs/sessions/AUTOMATIONS.md |
Documents scheduling and recovery contracts. |
src/vs/platform/agentHost/test/node/agentHostCatalogProjection.test.ts |
Tests durable scheduled-chat provenance. |
src/vs/platform/agentHost/node/agentService.ts |
Wires local scheduling and existing-conversation queueing. |
src/vs/platform/agentHost/node/agentHostCatalogProjection.ts |
Validates scheduled-chat origin metadata. |
src/vs/platform/agentHost/common/state/protocol/common/commands.ts |
Declares one-time and conversation capabilities. |
src/vs/platform/agentHost/common/state/protocol/channels-session/state.ts |
Carries scheduled purpose in session origins. |
src/vs/platform/agentHost/common/state/protocol/channels-automation/state.ts |
Defines one-time triggers, targets, and receipts. |
src/vs/platform/agentHost/common/state/protocol/channels-automation/actions.ts |
Adds purpose updates and modification guards. |
src/vs/platform/agentHost/common/state/protocol/channels-automation-run/state.ts |
Preserves scheduled purpose on runs. |
src/vs/platform/agentHost/common/meta/vscode/agentHostAutomationsMeta.ts |
Reads and writes stable creation receipts. |
src/vs/platform/agentHost/common/meta/agentHostAutomationsMeta.ts |
Exposes creation-receipt helpers. |
src/vs/platform/agentHost/common/automationRequest.ts |
Validates absolute times and durable attachments. |
src/vs/platform/actions/test/browser/menuEntryActionViewItem.test.ts |
Tests split-button keyboard accessibility. |
src/vs/platform/actions/common/actions.ts |
Adds the secondary execute menu. |
src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.ts |
Corrects split-button roles and focus handling. |
Review effort: Max
Persist unsent Agents window compositions and expose Send Later in new-session and existing-chat send dropdowns. Use durable one-time Automations with exact conversation routing, cancellation recovery, and dedicated Drafts and Scheduled list sections. Keep both authoring features independently disabled by default behind experimental application settings. Co-authored-by: Copilot <[email protected]>
Reuse the existing send dropdown, save and clear new-session compositions, and align draft and scheduled rows with ordinary sessions. Supply the new fixture services and correct repository formatting. Co-authored-by: Copilot <[email protected]>
Show scheduled follow-ups in their originating chat, add session clock indicators and Scheduled Only filtering, and group new-session schedules under Drafts. Refine draft labels and send-menu icons, with accessible descriptions, focused tests and component fixtures. Co-authored-by: Copilot <[email protected]>
Keep scheduling indicators beside the row toolbar with matching icon size and equal spacing in regular and compact layouts. Add focused visual fixtures and retain indicator visibility coverage. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Preserve draft input and identity across cancellation, scheduling, and comparison sends. Restore ordinary provider configuration independently of Automations and persist revisions safely across windows. Co-authored-by: Copilot <[email protected]>
Megan Rogge (meganrogge)
force-pushed
the
agents/scheduled-chat-requests-and-drafts
branch
from
November 12, 2026 21:37
57593b8 to
de270c6
Compare
Align scheduled messages with steering actions, edit text and timing in place, and simplify draft navigation with creation notifications. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical defects can admit client-sponsored conversations to the server-owned queue after restart and dispatch the same input through both ordinary send and Send Later.
10 open issues
Restore credential principal before checking scheduling eligibility · New Validate the same composition throughout asynchronous submission · New Match accepted automations by resource when host metadata is absent · New Catch scheduling failures and report them to the user · New Disable text-only send actions for attachment-only input · New Preserve inline-reference bindings when drafts have no attachment pills · New Guard disposed composer input in schedule cleanup · New Update the current composer history entry when its identity changes · New Apply explicit session hides before scheduled-chat listing exemption · New Avoid unchanged draft revisions and bound tombstone retention · New
12 resolved since last review
Failed workspace restore can send in the wrong workspace Concurrent storage writes can permanently drop drafts Draft-opening failures are unhandled and not shown to users Deleting a stowed draft can navigate away from the current session Cancelled history restore can persist mismatched draft identity and input Draft restore records an intermediate identity in navigation history Removed draft identity can break later scheduling Unreadable draft storage blocks sending Scheduling completion can clear a different draft's input Draft restoration incorrectly requires Automation eligibility Accepted handoffs can suppress later identical submissions Successful comparisons leave sent drafts in Drafts
Review effort: Max
Reuse the inline chat editor for scheduled messages, restore the Scheduled divider, and keep Send split controls stable during scheduling. Fix scheduled editor footer interaction and edit-state cleanup.\n\nCreate saved drafts only when leaving a nonempty new-session composer, and focus the input after explicit restoration. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Validate ordinary sends at dispatch, reconcile scheduled handoffs by provider identity, and restore credential ownership before autonomous admission. Preserve draft navigation and unchanged revisions without accumulating new tombstones, surface scheduling failures, and retain input references and lifecycle safety. Co-authored-by: Copilot <[email protected]>
This was referenced Nov 13, 2026
Preserve the scheduled editor controls alongside the upstream attachment hover delegate when resolving the renderer imports. Co-authored-by: Copilot <[email protected]>
Apply the repository formatter to the two files rejected by Compile & Hygiene. No runtime behavior changes. Co-authored-by: Copilot <[email protected]>
NewChatView starts hidden until its host marks it visible. Follow that lifecycle in the fixture so the composer is rendered before layout assertions and screenshot capture. Keep existing screenshot baselines and assertions unchanged. Co-authored-by: Copilot <[email protected]>
Megan Rogge (meganrogge)
marked this pull request as ready for review
November 13, 2026 02:18
Megan Rogge (meganrogge)
enabled auto-merge
November 13, 2026 02:18
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Ulugbek Abdullaev (@ulugbekna)Matched files:
Ben Villalobos (@benvillalobos)Matched files:
Sandeep Somavarapu (@sandy081)Matched files:
Ladislau Szomoru (@lszomoru)Matched files:
|
Dmitriy Vasyura (dmitrivMS)
previously approved these changes
Nov 13, 2026
Preserve scheduled-message accessibility alongside upstream native-component text support. Co-authored-by: Copilot <[email protected]>
Bhavya U (bhavyaus)
approved these changes
Nov 13, 2026
Megan Rogge (meganrogge)
deleted the
agents/scheduled-chat-requests-and-drafts
branch
November 13, 2026 05:33
This was referenced Nov 13, 2026
Megan Rogge (meganrogge)
added a commit
that referenced
this pull request
Nov 13, 2026
Adopts the upstreamed one-time trigger (microsoft/agent-host-protocol#603) on top of #348236, replacing the local protocol patch that preserved the Send Later edits from #347963. ### What changed - Ran `scripts/sync-agent-host-protocol.ts` against AHP `main` (`f1f4d4ac`) and deleted `scripts/agent-host-protocol.patch`. The sync script now applies that patch only when it exists. - AHP now defines only `oneTime` triggers and `automations.oneTime`. Generic "run once" automations also use `oneTime` triggers, so a scheduled chat can't be inferred from the trigger. The VS Code-only state moves into namespaced `_meta` through helpers in `agentHostAutomationsMeta.ts`: - Scheduled-chat purpose: `vscode.scheduledChat` on definition and run `_meta`. - Existing-chat target: `vscode.scheduledChatConversation` on definition `_meta`. - Admission and dispatch receipts: `vscode.oneTimeReceipts` on entry `_meta`. - Existing-chat support: the `vscode.scheduledChatExistingConversation` initialize `_meta` flag. - `AutomationSessionOrigin` has no `_meta`, so `purpose` stays on the session origin as a typed VS Code extension member (`IAgentHostAutomationSessionOrigin`). - `expectedModifiedAt` is removed, per AHP review. The host still rejects edits once a one-time run has been admitted, and it now rejects updates that change scheduled-chat purpose or target through `_meta`. - Hosts migrate stored Automations and runs from the earlier top-level fields into `_meta` on load, so already-scheduled chats keep working. ### Testing - `pnpm run typecheck-client`: passed. - `pnpm run oxlint <changed files>`: passed. - `./scripts/test.sh --reporter dot` with `agentHostAutomationService`, `agentHostAutomationStore`, `localAgentHostSessionsProvider`, `automationTools`, `scheduledChatsService`, `automationRunner`, `cloudAutomationStore`, `protocolServerHandler`, `agentHostAutomationsMeta`, `agentHostCatalogProjection`, and `automationsView`: **1879 passing, 12 pending**. - Added tests for migrating legacy stored fields and for scheduled-chat purpose and target immutability. No manual UI validation was done.
This was referenced Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
sessions.drafts.enabledandsessions.sendLater.enabledindependently default-off, application-scoped, experimental settings with ExP metadata.Review and merge notes
This is a combined draft for end-to-end review. The intended review slices are saved drafts, one-time Automations support, and Send Later integration.
The generated Agent Host Protocol changes depend on a companion upstream protocol change that still needs to be published and reviewed before merging. Existing-conversation scheduling and one-time authoring initially support only the local desktop Agent Host.
The host must be available to execute a request; this does not wake a sleeping computer or start a stopped host. Turning off Send Later does not cancel accepted schedules, which remain manageable in Automations. Unsupported durable attachments are rejected rather than silently dropped.
How to try
Launch the Agents window and enable:
{ "sessions.drafts.enabled": true, "sessions.sendLater.enabled": true, "chat.automations.enabled": true }Validation
corepack pnpm run build-fast— passed; full-product outputs are current.corepack pnpm run build-fast --client-only— passed after the final recovery fix.corepack pnpm run typecheck-client— passed.corepack pnpm run valid-layers-check— passed.corepack pnpm run oxlint src/vs/workbench/contrib/sessions/browser/scheduledChatsService.ts src/vs/workbench/contrib/sessions/test/browser/scheduledChatsService.test.ts— passed after the final fix; broader changed-file lint also passed.The earlier coordinated frontend/host/adapter batch passed with 1,957 tests and 13 pending. Subsequent focused checks covered split-button keyboard behavior, draft lifecycle, and navigation. The final cancellation-retry fix was validated by the affected suites above.
An isolated Code OSS Agents window was used to verify multiple drafts, restoration, Back/Forward, keyboard access to Send Later, picker cancellation, host acceptance, Scheduled projection, and cancellation recovery. Authenticated existing-chat/model execution and a real screen-reader session have not been tested end to end.