Skip to content

sessions: Generate New Action...#301604

Merged
joshspicer merged 14 commits intomainfrom
copilot/gothic-orangutan
Mar 13, 2026
Merged

sessions: Generate New Action...#301604
joshspicer merged 14 commits intomainfrom
copilot/gothic-orangutan

Conversation

@joshspicer
Copy link
Member

No description provided.

joshspicer and others added 12 commits March 12, 2026 14:00
On the new session page, chatService.sendRequest() cannot be used because
the chat session hasn't been initialized yet. Detect isUntitled sessions and
route through NewChatViewPane.sendQuery() instead, which sets the editor
value and triggers the normal _send() flow (including slash command expansion).

Also adds prefillInput/sendQuery public methods to NewChatWidget and
NewChatViewPane, and injects IViewsService into RunScriptContribution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rename add-run-action.prompt.md → generate-run-commands.prompt.md
- Update runScriptAction.ts to send /generate-run-commands
- Rewrite prompt with:
  - Two task schema fields: inSessions (required) and
    runOptions.runOn: worktreeCreated (optional, for setup commands)
  - Smart inference: reads project files to determine commands;
    only asks the user if ambiguous
  - Modify mode: if run commands already exist, treat as an update
  - Merge-safe: always preserves existing tasks.json entries

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
After sendRequestForNewSession completes successfully, clear the editor
value so it doesn't persist when the user navigates back to a new session.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ssions

chatService.sendRequest() bypasses the chat widget's prompt file resolution
logic (_applyPromptFileIfSet). Use IChatWidgetService.getWidgetBySessionResource()
and call acceptInput('/generate-run-commands') instead, which goes through
the full input pipeline including slash command parsing and prompt file
attachment.

Also removes now-unused IChatService and ChatAgentLocation imports.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 13, 2026 21:23
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 13, 2026
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

Adds a “Generate New Action…” entry to the Agent Sessions Run dropdown, intended to invoke a new built-in prompt (/generate-run-commands) that helps create/modify session run commands (tasks with inSessions: true) in .vscode/tasks.json.

Changes:

  • Add a new built-in prompt: generate-run-commands.prompt.md describing how to infer/merge inSessions tasks into .vscode/tasks.json.
  • Add a “Generate New Action…” menu item to the sessions Run dropdown that submits /generate-run-commands to chat.
  • Extend NewChatViewPane with helpers to prefill/send input programmatically.

Reviewed changes

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

File Description
src/vs/sessions/prompts/generate-run-commands.prompt.md New built-in prompt content for generating/modifying sessions run commands.
src/vs/sessions/prompts/add-run-action.prompt.md New/modified prompt file (currently empty).
src/vs/sessions/contrib/chat/browser/runScriptAction.ts Adds “Generate New Action…” command to Run dropdown and routes to chat.
src/vs/sessions/contrib/chat/browser/newChatViewPane.ts Adds prefillInput / sendQuery helpers; clears editor after sending.

You can also share your feedback on Copilot code review. Take the survey.

joshspicer and others added 2 commits March 13, 2026 14:28
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@joshspicer joshspicer merged commit 13f5fab into main Mar 13, 2026
21 checks passed
@joshspicer joshspicer deleted the copilot/gothic-orangutan branch March 13, 2026 23:03
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.

3 participants