Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 36 additions & 14 deletions src/core/assistant-message/presentAssistantMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,24 @@ export async function presentAssistantMessage(cline: Task) {

if (response !== "yesButtonClicked") {
if (text) {
await cline.say("user_feedback", text, images)
pushToolResult(
formatResponse.toolResult(
formatResponse.toolDeniedWithFeedback(text, toolProtocol),
images,
),
)
// Check if the text is a slash command (starts with /)
// Slash commands should not be treated as feedback to the model
const isSlashCommand = text.trimStart().startsWith("/")

if (isSlashCommand) {
// Treat slash commands as simple denial without feedback
// This prevents commands from being captured as denial feedback
pushToolResult(formatResponse.toolDenied(toolProtocol))
} else {
// Normal text feedback
await cline.say("user_feedback", text, images)
pushToolResult(
formatResponse.toolResult(
formatResponse.toolDeniedWithFeedback(text, toolProtocol),
images,
),
)
}
} else {
pushToolResult(formatResponse.toolDenied(toolProtocol))
}
Expand Down Expand Up @@ -589,13 +600,24 @@ export async function presentAssistantMessage(cline: Task) {
if (response !== "yesButtonClicked") {
// Handle both messageResponse and noButtonClicked with text.
if (text) {
await cline.say("user_feedback", text, images)
pushToolResult(
formatResponse.toolResult(
formatResponse.toolDeniedWithFeedback(text, toolProtocol),
images,
),
)
// Check if the text is a slash command (starts with /)
// Slash commands should not be treated as feedback to the model
const isSlashCommand = text.trimStart().startsWith("/")

if (isSlashCommand) {
// Treat slash commands as simple denial without feedback
// This prevents commands from being captured as denial feedback
pushToolResult(formatResponse.toolDenied(toolProtocol))
} else {
// Normal text feedback
await cline.say("user_feedback", text, images)
pushToolResult(
formatResponse.toolResult(
formatResponse.toolDeniedWithFeedback(text, toolProtocol),
images,
),
)
}
} else {
pushToolResult(formatResponse.toolDenied(toolProtocol))
}
Expand Down
Loading