sourcegraph / cody

Type less, code more: Cody is an AI code assistant that uses advanced search and codebase context to help you write and fix code.
https://cody.dev
Apache License 2.0
2.53k stars 261 forks source link

Agent: Revert breaking protocol change #5128

Closed RXminuS closed 1 month ago

RXminuS commented 1 month ago

There was a unintentional protocol change to a legacy getUserContext message where it didn't trigger the associated userContextFiles message. This message was still being used by Jetbrains causing CODY-3196

This reverts the change and ensures that the correct messages are triggered. As a follow up CODY-3172 will ensure that these class of issues are properly (type-)checked and tested.

Test plan

RXminuS commented 1 month ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @RXminuS and the rest of your teammates on Graphite Graphite

RXminuS commented 1 month ago

@pkukielka I think it was only this specific message that was causing issues, but did you notice any others? Otherwise I can go through the full diff and just double check that all the same messages are sent but I'm hoping we can skip that

pkukielka commented 1 month ago

@pkukielka I think it was only this specific message that was causing issues, but did you notice any others? Otherwise I can go through the full diff and just double check that all the same messages are sent but I'm hoping we can skip that

LGTM.

We are only expecting two messages in jetbrains:

ExtensionMessage.Type.USER_CONTEXT_FILES -> {
  if (message.userContextFiles is List<*>) {
    this.chatPanel.promptPanel.setContextFilesSelector(message.userContextFiles)
  }
}
ExtensionMessage.Type.ENHANCED_CONTEXT_STATUS -> {
  if (message.enhancedContextStatus != null) {
    this.chatPanel.contextView.updateFromAgent(message.enhancedContextStatus)
  }
}

And looks like both are properly sent from Cody now.