-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix: Missing context files #535
Conversation
69839ec
to
8f8e060
Compare
if (extensionMessage.chatID != null) { | ||
if (prevLastMessage != null) { | ||
if (lastMessage?.contextFiles != messages.lastOrNull()?.contextFiles) { | ||
val index = restoredMessagesCount + extensionMessage.messages.count() - 2 |
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 was always confused by that - 2
but I finally get it.
Won't it be the same (but IMHO more easier to understand) if instead you will use messages.count() - 1
?
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.
extensionMessage.messages
always contains the full transcript of a given session.
Hence,
messages.count() - 1
is always the index of the last element
and
messages.count() - 2
is always the index of the element before the last element
That's all 😃
commandId.displayName, | ||
), | ||
chatSession.messages.count()) | ||
chatSession.addMessageAtIndex( |
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.
Can we force shouldAddBlinkingCursor = true
there?
It will guarantee that cursor started blinking even if there is no response from the agent yet, it will be more responsive in some scenarios (e.g restart of the agent, slow LLM, bad connectivity)
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.
ok, but I tested it with no interent connection and it does not show the cursor (removes it immedietaly).
cancellationToken.onFinished {
ApplicationManager.getApplication().invokeLater {
removeBlinkingCursor()
getLastMessage()?.onPartFinished()
}
}
cancellationToken
removes it when there is not internet
@@ -28,6 +28,8 @@ class AccordionSection(title: String) : JPanel() { | |||
contentPanel.isVisible = true | |||
toggleButton.text = createToggleButtonHTML(sectionTitle, false) | |||
} | |||
revalidate() |
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.
What scenario was broken without that?
8f8e060
to
81333cd
Compare
@@ -28,6 +28,7 @@ private constructor( | |||
private val project: Project, | |||
newSessionId: CompletableFuture<SessionId>, | |||
private val internalId: String = UUID.randomUUID().toString(), | |||
private val restoredMessagesCount: Int = 0 |
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.
It seems to be never updated, I guess it's not needed at all now?
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.
LGTM except one comment I left.
81333cd
to
41563ec
Compare
project, | ||
sessionId, | ||
state.internalId!!, | ||
restoredMessagesCount = state.messages.count()) |
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.
@pkukielka, pls take a look - the value is not updated, it's initialized here
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.
Looks good! 👍 I tested this on different repositories. It also works well with @.
19269dc
to
b15e831
Compare
77af739
to
00da372
Compare
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.
LGTM
Reattempt of #520.
Fixes https://github.com/sourcegraph/sourcegraph/issues/57378.
Fixes #328.
Test plan