Skip to content

sessions: support agent-authored scheduled chat requests - #348175

Merged
Megan Rogge (meganrogge) merged 3 commits into
mainfrom
agents/agent-scheduling-tool-investigation
Nov 13, 2026
Merged

Megan Rogge (meganrogge) merged 3 commits into
mainfrom
agents/agent-scheduling-tool-investigation

Conversation

@meganrogge

Copy link
Copy Markdown
Collaborator

Fixes #348172.

Summary

  • Extend configureAutomation with text-only, one-time requests. Default to the exact calling conversation, including peer chats; explicit new-session targets retain their existing meaning. Recurring automation behavior is unchanged.
  • Reuse Send Later's durable handoff, stable creation identity, host scheduler, and recovery. Add scheduling capability/clock discovery, accurate acceptance and queueing results, and guarded rescheduling/cancellation.
  • Preserve runtime tool approval and the existing Automations/Send Later gates. Update /automate guidance and chat accessibility help.

Validation

Passed after updating the branch to main:

corepack pnpm run typecheck-client
corepack pnpm run build-fast

The following regression batch passed: 1,079 passing, 11 existing pending tests. A session-local Corepack shim supplied pnpm on PATH.

./scripts/test.sh --reporter dot \
  --run src/vs/sessions/contrib/automations/test/browser/automationTools.test.ts \
  --run src/vs/workbench/contrib/sessions/test/browser/scheduledChatsService.test.ts \
  --run src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostAutomationStore.test.ts \
  --run src/vs/platform/agentHost/test/node/agentHostAutomationService.test.ts \
  --run src/vs/sessions/contrib/providers/copilotChatSessions/test/browser/cloudAutomationStore.test.ts \
  --run src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts

Also passed:

corepack pnpm run valid-layers-check
corepack pnpm run oxlint \
  src/vs/sessions/contrib/automations/browser/automationTools.ts \
  src/vs/sessions/contrib/automations/test/browser/automationTools.test.ts \
  src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.ts \
  src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts \
  src/vs/sessions/contrib/providers/copilotChatSessions/test/browser/cloudAutomationStore.test.ts \
  src/vs/workbench/contrib/sessions/browser/scheduledChatsService.ts \
  src/vs/workbench/contrib/sessions/providers/agentHost/browser/baseAgentHostSessionsProvider.ts \
  src/vs/workbench/contrib/sessions/test/browser/scheduledChatsService.test.ts
git diff --check

Live validation on macOS: a real agent discovered the tool, saved a one-time request, and the host delivered it into the original chat at the scheduled time. Peer-chat/new-session routing has unit coverage but was not live-tested. VoiceOver and full smoke/integration suites were not run.

Try it

  1. Enable chat.automations.enabled and sessions.sendLater.enabled in the Agents window with a supported local desktop Agent Host.
  2. Ask: In three minutes, send "Reply with SCHEDULE_OK. Do not use any tools." to this chat once.
  3. Use normal tool approval if prompted. Verify the scheduled message appears in that chat and is delivered there when due.
  4. On another pending request, try asking the agent to reschedule it, cancel it, or send it now. An explicit new-session request should create a separate conversation instead.

Expose one-time scheduling through configureAutomation while reusing Send Later's durable handoff and recovery. Default to the exact originating chat and preserve explicit new-session and recurring behavior.

Fixes #348172

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 15:07
@vs-code-engineering

vs-code-engineering Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

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

Ulugbek Abdullaev (@ulugbekna)

Matched files:

  • src/vs/workbench/contrib/chat/common/automations/automationRunner.ts

Sandeep Somavarapu (@sandy081)

Matched files:

  • src/vs/workbench/contrib/sessions/browser/scheduledChatsService.ts

Ladislau Szomoru (@lszomoru)

Matched files:

  • src/vs/workbench/contrib/sessions/browser/scheduledChatsService.ts

Format the scheduling availability expression to satisfy CI hygiene.

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Configuration snapshots omit effective chat-level approval settings, potentially giving scheduled sessions broader permissions than their source chats.

7 open issues
What changed in this PR

Extends the Agents window’s automation tools to schedule one-time chat requests through Send Later, defaulting to the exact calling conversation while preserving recurring automation behavior.

Changes:

  • Adds one-time scheduling discovery, creation, and guarded management.
  • Reuses durable handoffs and captures running-session configuration for explicit new-session requests.
  • Adds regression coverage and updates /automate guidance, accessibility help, and architecture documentation.
File Description
src/​vs/​workbench/​contrib/​sessions/​test/​browser/​scheduledChatsService.test.ts Tests durable tool submissions, retries, identities, and edits.
src/​vs/​workbench/​contrib/​sessions/​providers/​agentHost/​browser/​baseAgentHostSessionsProvider.ts Captures running-session configuration for new scheduled sessions.
src/​vs/​workbench/​contrib/​sessions/​browser/​scheduledChatsService.ts Adds tool-driven scheduling through the existing handoff journal.
src/​vs/​sessions/​skills/​automate/​SKILL.md Documents the one-time scheduling workflow and safeguards.
src/​vs/​sessions/​contrib/​providers/​copilotChatSessions/​test/​browser/​cloudAutomationStore.test.ts Updates tool fixtures for the scheduled-chat service dependency.
src/​vs/​sessions/​contrib/​providers/​agentHost/​test/​browser/​localAgentHostSessionsProvider.test.ts Tests running-session configuration capture.
src/​vs/​sessions/​contrib/​chat/​browser/​sessionsChatAccessibilityHelp.ts Explains agent-authored scheduling in accessibility help.
src/​vs/​sessions/​contrib/​automations/​test/​browser/​automationTools.test.ts Covers routing, discovery, validation, management, and confirmations.
src/​vs/​sessions/​contrib/​automations/​browser/​automationTools.ts Extends tool schemas, scheduling operations, and result reporting.
src/​vs/​sessions/​AUTOMATIONS.md Documents handoff persistence and exact-conversation targeting.

Review effort: Max

Capture effective chat settings, report queue-only dispatch, and reconcile durable scheduling handoffs without recapturing configuration or retaining completed payloads. Validate fresh send times before approval and cover replay normalization and catalogue acceptance.

Co-authored-by: Copilot <[email protected]>
@meganrogge
Megan Rogge (meganrogge) added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 4690908 Nov 13, 2026
37 of 38 checks passed
@meganrogge
Megan Rogge (meganrogge) deleted the agents/agent-scheduling-tool-investigation branch November 13, 2026 17:29
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.

Support agent-driven Send Later for chat requests

4 participants