Skip to content
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

Improve Cody logging agent protocol #6069

Merged
merged 3 commits into from
Nov 6, 2024
Merged

Conversation

pkukielka
Copy link
Contributor

Changes

Fixes logging capability in agent.
Previously messages logged to output channel were visible only if added using append or appendLine.
Now trace / debug / info / warn / error functions are also logged properly.

Test plan

As in sourcegraph/jetbrains#2583

@@ -530,32 +530,27 @@ export namespace UriString {
}

function outputChannel(name: string): vscode.LogOutputChannel {
function notifyAgent(level: DebugMessageLogLevel, message: string, ...args: any[]): void {
if (agent) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some contradiction in this method. It is called notifyAgent but we seem to check if we use agent inside of it.

maybe s/notifyAgent/notifyAgentIfApplicable/g?

no hard feelings about it tho. feel free to leave it as it is if it makes sense to you

Copy link
Contributor Author

@pkukielka pkukielka Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check does not verify if we are in the 'agent' mode, it just check if agent object is already initialized.
vscode-shim.ts is used only for agent-related workflows.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, makes sense.

Copy link
Contributor

@mkondratek mkondratek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we need to regenerate the recordings?

@pkukielka
Copy link
Contributor Author

pkukielka commented Nov 6, 2024

don't we need to regenerate the recordings?

We need, and they are regenerated :)

/edit you are right, I missed to add one new class, fixed now.

@pkukielka pkukielka merged commit 836693e into main Nov 6, 2024
20 checks passed
@pkukielka pkukielka deleted the pkukielka/improve-cody-logging branch November 6, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants