-
Notifications
You must be signed in to change notification settings - Fork 62
feat: add support for cursor cli #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@hugodutka @matifali PR ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
@hugodutka are we good to merge here? |
Co-authored-by: Cian Johnston <public@cianjohnston.ie>
Co-authored-by: Cian Johnston <public@cianjohnston.ie>
@johnstcn thanks for the review, made the changes. |
if !strings.Contains(line, m) { | ||
return currentIdx, false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also relatively new to this codebase, so please let me know if I'm way off --
my understanding is that we want to match a "bottom line" of box-drawing characters.
This approach could potentially incorrectly match a line similar to:
Hello (╯▽╰) this is my custom agent
Would a better approach be to check that the string trimmed of leading and trailing whitespace starts or and ends with the given characters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check that the string trimmed of leading and trailing whitespace starts or and ends with the given characters?
makes sense, will add that.
Anyhow the logic above it
msg, msgLines, msgRuneLineLocations := normalizeAndGetRuneLineMapping(msgRaw)
userInput, _, userInputLineLocations := normalizeAndGetRuneLineMapping(userInputRaw)
userInputStartIdx := findUserInputStartIdx(msg, msgRuneLineLocations, userInput, userInputLineLocations)
if userInputStartIdx == -1 {
// The user input prefix was not found in the message prefix
// Return the original message
return msgRaw
}
userInputEndIdx := findUserInputEndIdx(userInputStartIdx, msg, userInput)
// Return the original message starting with the first line
// that doesn't contain the echoed user input.
lastUserInputLineIdx := msgRuneLineLocations[userInputEndIdx]
to get the lastUserInputLineIdx
tries it's best to make sure we are getting the line that is right after the user input message ends. Can't think of a case where the next line to the user input (in case of gemini and codex in which the behaviour is known) is going to be anything other than the end line.
PS: This got me thinking, the matching logic was initially there because I didn't have access to the agent type in the RemoveUserInput
, since I do that now, I think we can just skip the next line (since the behaviour is known ?), wdyt ?
ref: coder/registry#309