mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
Add mistake tracking to prevent indefinitely running loops
This commit is contained in:
@@ -64,6 +64,13 @@ const ChatRow: React.FC<ChatRowProps> = ({
|
||||
style={{ color: errorColor, marginBottom: "-1.5px" }}></span>,
|
||||
<span style={{ color: errorColor, fontWeight: "bold" }}>Error</span>,
|
||||
]
|
||||
case "mistake_limit_reached":
|
||||
return [
|
||||
<span
|
||||
className="codicon codicon-error"
|
||||
style={{ color: errorColor, marginBottom: "-1.5px" }}></span>,
|
||||
<span style={{ color: errorColor, fontWeight: "bold" }}>Claude is having trouble...</span>,
|
||||
]
|
||||
case "command":
|
||||
return [
|
||||
isCommandExecuting ? (
|
||||
@@ -403,6 +410,16 @@ const ChatRow: React.FC<ChatRowProps> = ({
|
||||
switch (message.ask) {
|
||||
case "tool":
|
||||
return renderTool(message, headerStyle)
|
||||
case "mistake_limit_reached":
|
||||
return (
|
||||
<>
|
||||
<div style={headerStyle}>
|
||||
{icon}
|
||||
{title}
|
||||
</div>
|
||||
<p style={{ ...pStyle, color: "var(--vscode-errorForeground)" }}>{message.text}</p>
|
||||
</>
|
||||
)
|
||||
case "command":
|
||||
const splitMessage = (text: string) => {
|
||||
const outputIndex = text.indexOf(COMMAND_OUTPUT_STRING)
|
||||
|
||||
@@ -102,6 +102,13 @@ const ChatView = ({
|
||||
setPrimaryButtonText("Retry")
|
||||
setSecondaryButtonText("Start New Task")
|
||||
break
|
||||
case "mistake_limit_reached":
|
||||
setTextAreaDisabled(false)
|
||||
setClaudeAsk("mistake_limit_reached")
|
||||
setEnableButtons(true)
|
||||
setPrimaryButtonText("Proceed Anyways")
|
||||
setSecondaryButtonText("Start New Task")
|
||||
break
|
||||
case "followup":
|
||||
setTextAreaDisabled(false)
|
||||
setClaudeAsk("followup")
|
||||
@@ -225,6 +232,7 @@ const ChatView = ({
|
||||
case "completion_result": // if this happens then the user has feedback for the completion result
|
||||
case "resume_task":
|
||||
case "resume_completed_task":
|
||||
case "mistake_limit_reached":
|
||||
vscode.postMessage({
|
||||
type: "askResponse",
|
||||
askResponse: "messageResponse",
|
||||
@@ -269,6 +277,7 @@ const ChatView = ({
|
||||
case "command_output":
|
||||
case "tool":
|
||||
case "resume_task":
|
||||
case "mistake_limit_reached":
|
||||
vscode.postMessage({ type: "askResponse", askResponse: "yesButtonTapped" })
|
||||
break
|
||||
case "completion_result":
|
||||
@@ -287,6 +296,7 @@ const ChatView = ({
|
||||
const handleSecondaryButtonClick = () => {
|
||||
switch (claudeAsk) {
|
||||
case "api_req_failed":
|
||||
case "mistake_limit_reached":
|
||||
startNewTask()
|
||||
break
|
||||
case "command":
|
||||
|
||||
Reference in New Issue
Block a user