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

Edit Code action returns NULL #737

Closed
davidgilbertson opened this issue Oct 15, 2024 · 3 comments
Closed

Edit Code action returns NULL #737

davidgilbertson opened this issue Oct 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@davidgilbertson
Copy link

What happened?

I select a function, and perform the "Edit code" option and type "Make this code better".

It just puts NULL where the code was.

image

If I use the chat instead it works, using the same model, so I know it's picking up my API key correctly.
image

I believe my settings are correct:
image

All the OpenAI > GPT-* models do the same thing, insert NULL where the code was. The o1-preview model raises an error, which I think was reported elsewhere.

If I change the model to GPT-4o-mini - FREE it works (although it puts the changed code BEHIND the popup, so now I need to grab the mouse to move it to see if I want to accept it or not).
image

Relevant log output or stack trace

2024-10-16 10:32:04,311 [ 839614]   INFO - STDERR - [OkHttp https://api.openai.com/...] INFO ee.carlrobert.llm.completion.CompletionEventSourceListener - Request opened.
2024-10-16 10:32:04,312 [ 839615]   INFO - STDERR - [OkHttp https://api.openai.com/...] INFO ee.carlrobert.llm.completion.CompletionEventSourceListener - Request closed.
2024-10-16 10:32:07,876 [ 843179]   INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.SdkEntity to files
2024-10-16 10:32:07,877 [ 843180]   INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.LibraryEntity to files

Steps to reproduce

Not sure, I just just installed the extension, tried it, and it gave this error.
I tried it in another project and got the same error.
Note that the Request closed is firing about 1 ms after the Request opened, is that a clue?

CodeGPT version

2.11.6-241.1

Operating System

Windows

@davidgilbertson davidgilbertson added the bug Something isn't working label Oct 15, 2024
@davidgilbertson
Copy link
Author

I just tested with llama3.2 running locally via Ollama and that works, although it puts a full markdown codeblock in my code, with the backticks.
image

And it works with Claude too:
image

So the issue is somewhere at the intersection of

  • the "Edit code" feature (not chat)
  • OpenAI API with my own API key (not the CodeGPT models)

@carlrobertoh
Copy link
Owner

Thank you for reporting! I will have a look at it soon.

@davidgilbertson
Copy link
Author

You work fast, nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants