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
13 changes: 12 additions & 1 deletion lib/msgfmt/agent_readiness.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package msgfmt

import "strings"

func IsAgentReadyForInitialPrompt(agentType AgentType, message string) bool {
switch agentType {
case AgentTypeClaude:
Expand All @@ -17,7 +19,7 @@ func IsAgentReadyForInitialPrompt(agentType AgentType, message string) bool {
case AgentTypeAmp:
return isAmpAgentReadyForInitialPrompt(message)
case AgentTypeCursor:
return isGenericAgentReadyForInitialPrompt(message)
return isCursorAgentReadyForInitialPrompt(message)
case AgentTypeAuggie:
return isGenericAgentReadyForInitialPrompt(message)
case AgentTypeAmazonQ:
Expand All @@ -37,6 +39,15 @@ func isGenericAgentReadyForInitialPrompt(message string) bool {
return len(messageWithoutInputBox) != len(message)
}

func isCursorAgentReadyForInitialPrompt(message string) bool {
if isGenericAgentReadyForInitialPrompt(message) {
return true
}
normalized, _, _ := normalizeAndGetRuneLineMapping(message)
return strings.Contains(message, "Cursor Agent") &&
strings.Contains(string(normalized), "Plan,search,buildanything")
}

func isOpencodeAgentReadyForInitialPrompt(message string) bool {
message = trimEmptyLines(message)
messageWithoutInputBox := removeOpencodeMessageBox(message)
Expand Down