sourcegraph / cody

AI that knows your entire codebase
https://cody.dev
Apache License 2.0
2.24k stars 213 forks source link

Enable completion persistence loging in agent #4672

Closed pkukielka closed 6 days ago

pkukielka commented 1 week ago

Fixes CODY-2571

Changes

Enable completions persistence tracking for agent. Looks like it was disabled from the start, but I do not see a good reason why it should be. @valerybugakov you asked a good question but @philipp-spiess answer does not really explain the rationale of the decision to skip the agent. Do you maybe remember any additional context of that decision?

Test plan

  1. Build and run JetBrains with this Cody branch
  2. Initiate any completion and accept it
  3. Add some code before and after the completion
  4. Wait 30 seconds
  5. Remove suggested line
  6. Wait 1min 30sec

You should see something like that in the log:

2024-06-25 15:46:21,885 [  21579]   WARN - #c.s.c.a.CodyAgentClient - Cody by Sourcegraph: █ telemetry-v2: recordEvent: cody.completion/suggested 
2024-06-25 15:46:21,885 [  21579]   WARN - #c.s.c.a.CodyAgentClient - Cody by Sourcegraph: █ telemetry-v2: recordEvent: cody.completion/accepted 
2024-06-25 15:46:31,361 [  31055]   WARN - #c.s.c.a.CodyAgentClient - Cody by Sourcegraph: █ telemetry-v2: recordEvent: cody.completion/noResponse 
2024-06-25 15:46:51,946 [  51640]   WARN - #c.s.c.a.CodyAgentClient - Cody by Sourcegraph: █ telemetry-v2: recordEvent: cody.completion.persistence/present 
2024-06-25 15:47:08,009 [  67703]   WARN - #c.s.c.a.CodyAgentClient - Cody by Sourcegraph: █ telemetry-v2: recordEvent: cody.completion/suggested 
2024-06-25 15:47:16,260 [  75954]   WARN - #c.s.c.a.CodyAgentClient - Cody by Sourcegraph: █ telemetry-v2: recordEvent: cody.completion/suggested 
2024-06-25 15:48:21,950 [ 141644]   WARN - #c.s.c.a.CodyAgentClient - Cody by Sourcegraph: █ telemetry-v2: recordEvent: cody.completion.persistence/removed 

Additionally I verified in the debugger that partial edition of the line changes difference ratio.

pkukielka commented 6 days ago

LGTM. I do not remember any additional context that blocks this.

One thing I noticed in the linked PR that might be relevant to this change: https://github.com/sourcegraph/cody/pull/1463/files#r1653762071

Thank you @valerybugakov! I replied in the comment. Tl;Dr: I think code you linked it not a problem for us.