Skip to content

fix: slash command prompts not applied in edit mode#12122

Open
octo-patch wants to merge 3 commits intocontinuedev:mainfrom
octo-patch:fix/issue-12087-slash-commands-in-edit-mode
Open

fix: slash command prompts not applied in edit mode#12122
octo-patch wants to merge 3 commits intocontinuedev:mainfrom
octo-patch:fix/issue-12087-slash-commands-in-edit-mode

Conversation

@octo-patch
Copy link
Copy Markdown
Contributor

@octo-patch octo-patch commented Apr 13, 2026

Fixes #12087

Problem

When using edit mode (Ctrl+I), prompt files placed in .continue/prompts are silently ignored. The slash command dropdown in edit mode correctly shows the available prompts (filtered by ContinueInputBox), but selecting one and pressing Enter has no effect — the prompt content is not prepended to the request.

Root cause: streamEditThunk calls resolveEditorContent with availableSlashCommands: [] (an empty array). When renderSlashCommandPrompt looks up the selected command by name, it finds nothing in the empty list and returns early with no modifications to the message content.

Solution

Read slashCommands from the Redux state (same pattern as streamResponseThunk) and pass them to resolveEditorContent. This allows renderSlashCommandPrompt to find and render the prompt file content when a /prompt-name is selected in edit mode.

// Before
availableSlashCommands: [],

// After
availableSlashCommands: state.config.config.slashCommands ?? [],

Testing

  1. Create a prompt file in .continue/prompts/test.prompt with some content
  2. Select code in the editor and open edit mode (Ctrl+I)
  3. Type /test and select the prompt from the dropdown
  4. Press Enter — the prompt content is now correctly included in the edit request

Summary by cubic

Fixes slash-command prompts not being applied in edit mode (Ctrl+I) and prevents OpenAI Responses API 400s by stripping orphaned fc_ IDs after context compaction.

  • Bug Fixes
    • Edit mode: pass slashCommands from Redux to resolveEditorContent in streamEditThunk, and use slashCommandSource in selectSlashCommandComboBoxInputs so .continue/prompts are applied; fixes vscode continue code edit cant paste prompt #12087.
    • LLM: update sanitizeResponsesInput to strip fc_ IDs from function_call items when the preceding reasoning was pruned, avoiding “function_call without required reasoning” errors; adds tests in openaiTypeConverters.test.ts; fixes Error: GPT-5 - 400 #12056.

Written for commit d7a2159. Summary will update on new commits.

octo-patch added 3 commits April 11, 2026 11:40
…le prompt files in edit mode (fixes continuedev#12087)

The selector `selectSlashCommandComboBoxInputs` was returning the slash
command source as `source`, but `ContinueInputBox` filters slash commands
in edit mode by checking `cmd.slashCommandSource`. This property name
mismatch caused all slash commands (including prompt files) to be filtered
out in edit mode, since `cmd.slashCommandSource` was always `undefined`.

Rename `source` to `slashCommandSource` in the selector return value to
match the `ComboBoxItem` type definition and the edit-mode filter logic.
…ion (fixes continuedev#12056)

When compileChatMessages prunes a thinking message due to context overflow,
the associated assistant message still carries fc_* IDs that reference the
now-absent reasoning item (rs_*). The OpenAI Responses API then rejects the
request with a 400 error:

  "Item 'fc_...' of type 'function_call' was provided without its
   required 'reasoning' item: 'rs_...'"

Fix: add a second pass in sanitizeResponsesInput that scans backward from
each function_call with a fc_* ID to find whether a kept reasoning item
exists in the same turn block. If no reasoning is found, the fc_ ID is
stripped from the function_call so the API does not look for the missing
reasoning item.

Also adds test cases covering the pruned-reasoning scenario.
…ontinuedev#12087)

Previously, streamEditThunk passed an empty array for availableSlashCommands,
causing prompt files from .continue/prompts to be silently ignored when used
in edit mode (Ctrl+I). The slash command dropdown correctly showed prompts
(filtered by ContinueInputBox), but selecting one had no effect because
renderSlashCommandPrompt could not find the command in the empty list.

Fix: read slashCommands from Redux state and pass them to resolveEditorContent,
matching the pattern used in streamResponseThunk.
@octo-patch octo-patch requested a review from a team as a code owner April 13, 2026 03:17
@octo-patch octo-patch requested review from sestinj and removed request for a team April 13, 2026 03:17
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


octo-patch seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

vscode continue code edit cant paste prompt Error: GPT-5 - 400

1 participant