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

Fetch failed with status 404 body {"message": "Not Found"... #24

Open
luccahuguet opened this issue Feb 15, 2024 · 8 comments
Open

Fetch failed with status 404 body {"message": "Not Found"... #24

luccahuguet opened this issue Feb 15, 2024 · 8 comments

Comments

@luccahuguet
Copy link

luccahuguet commented Feb 15, 2024

helix-editor version
helix 23.10 (83f09ecb)

helix-gpt version
0.27

Describe the bug
I can view the code actions successfully but when I pick one, I get the following error (I manually copied helix's diagnostic):

Fetch failed with status 404 body {"message": "Not Found", "documentation_url": "https://docs.github.com/rest"} {url: "/copilot_internal/v2/token"

helix-gpt logs
Helix GPT output logs. Pass --logFile /app/helix-gpt.log to save them.

helix logs

2024-02-15T20:27:59.618 helix_lsp::transport [INFO] pylsp <- {"jsonrpc":"2.0","id":1,"result":[]}
2024-02-15T20:27:59.618 helix_lsp::transport [INFO] pylsp <- []
2024-02-15T20:27:59.624 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","id":1,"result":[{"title":"Resolve diagnostics","kind":"quickfix","diagnostics":[],"command":{"title":"Resolve diagnostics","command":"resolveDiagnostics","arguments":[{"range":{"end":{"character":5,"line":18},"start":{"character":4,"line":18}},"query":"Resolve the diagnostics for this code.","diagnostics":[]}]}},{"title":"Generate documentation","kind":"quickfix","diagnostics":[],"command":{"title":"Generate documentation","command":"generateDocs","arguments":[{"range":{"end":{"character":5,"line":18},"start":{"character":4,"line":18}},"query":"Add documentation to this code.","diagnostics":[]}]}},{"title":"Improve code","kind":"quickfix","diagnostics":[],"command":{"title":"Improve code","command":"improveCode","arguments":[{"range":{"end":{"character":5,"line":18},"start":{"character":4,"line":18}},"query":"Improve this code.","diagnostics":[]}]}},{"title":"Refactor code from a comment","kind":"quickfix","diagnostics":[],"command":{"title":"Refactor code from a comment","command":"refactorFromComment","arguments":[{"range":{"end":{"character":5,"line":18},"start":{"character":4,"line":18}},"query":"Refactor this code based on the comment.","diagnostics":[]}]}},{"title":"Write a unit test","kind":"quickfix","diagnostics":[],"command":{"title":"Write a unit test","command":"writeTest","arguments":[{"range":{"end":{"character":5,"line":18},"start":{"character":4,"line":18}},"query":"Write a unit test for this code. Do not include any imports.","diagnostics":[]}]}}]}
2024-02-15T20:27:59.625 helix_lsp::transport [INFO] gpt <- [{"command":{"arguments":[{"diagnostics":[],"query":"Resolve the diagnostics for this code.","range":{"end":{"character":5,"line":18},"start":{"character":4,"line":18}}}],"command":"resolveDiagnostics","title":"Resolve diagnostics"},"diagnostics":[],"kind":"quickfix","title":"Resolve diagnostics"},{"command":{"arguments":[{"diagnostics":[],"query":"Add documentation to this code.","range":{"end":{"character":5,"line":18},"start":{"character":4,"line":18}}}],"command":"generateDocs","title":"Generate documentation"},"diagnostics":[],"kind":"quickfix","title":"Generate documentation"},{"command":{"arguments":[{"diagnostics":[],"query":"Improve this code.","range":{"end":{"character":5,"line":18},"start":{"character":4,"line":18}}}],"command":"improveCode","title":"Improve code"},"diagnostics":[],"kind":"quickfix","title":"Improve code"},{"command":{"arguments":[{"diagnostics":[],"query":"Refactor this code based on the comment.","range":{"end":{"character":5,"line":18},"start":{"character":4,"line":18}}}],"command":"refactorFromComment","title":"Refactor code from a comment"},"diagnostics":[],"kind":"quickfix","title":"Refactor code from a comment"},{"command":{"arguments":[{"diagnostics":[],"query":"Write a unit test for this code. Do not include any imports.","range":{"end":{"character":5,"line":18},"start":{"character":4,"line":18}}}],"command":"writeTest","title":"Write a unit test"},"diagnostics":[],"kind":"quickfix","title":"Write a unit test"}]
2024-02-15T20:28:00.089 helix_lsp::transport [INFO] gpt -> {"jsonrpc":"2.0","method":"workspace/executeCommand","params":{"arguments":[{"diagnostics":[],"query":"Resolve the diagnostics for this code.","range":{"end":{"character":5,"line":18},"start":{"character":4,"line":18}}}],"command":"resolveDiagnostics"},"id":2}
2024-02-15T20:28:00.099 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/lucca/api2/app.py","diagnostics":[{"message":"Executing resolveDiagnostics...","range":{"end":{"character":5,"line":18},"start":{"character":4,"line":18}},"severity":3,"source":"helix-gpt"}]}}
2024-02-15T20:28:00.396 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/lucca/api2/app.py","diagnostics":[{"message":"Fetch failed with status 404 body {\"message\":\"Not Found\",\"documentation_url\":\"https://docs.github.com/rest\"} url: /copilot_internal/v2/token","severity":1,"range":{"end":{"character":5,"line":18},"start":{"character":4,"line":18}},"source":"helix-gpt"}]}}

@luccahuguet luccahuguet changed the title [BUG] Fetch failed with status 404 body {"message": "Not Found", Feb 15, 2024
@luccahuguet luccahuguet changed the title Fetch failed with status 404 body {"message": "Not Found", Fetch failed with status 404 body {"message": "Not Found"... Feb 15, 2024
@luccahuguet
Copy link
Author

gh copilot is given to me via student pack, provided by my university. could this be the issue?

@luccahuguet
Copy link
Author

it works with the openAI key, but I still need to use copilot (specially since it says it's the recommended model in the readme)

@luccahuguet
Copy link
Author

thank you for this project. it works very well.

Although I have yet to figure how to get the copilot one working.

@leona
Copy link
Owner

leona commented Feb 17, 2024

gh copilot is given to me via student pack, provided by my university. could this be the issue?

It's strange that a university encourages use of Copilot. Do your credentials work with the VSCode plugin do you know?

@luccahuguet
Copy link
Author

It's strange that a university encourages use of Copilot.

It's called Github Student Developer Pack and it contains a lot of other things. I think some student's learning process will be enhanced with it while others will learn less, so a mixed bag

Do your credentials work with the VSCode plugin do you know?

Yes, I've been using copilot with all it's features, including copilot chat, and "fix with copilot" in vscode

My guess is that the api is closed for people that get copilot for free, so that they can't give it to others, maybe?

@leona
Copy link
Owner

leona commented Feb 18, 2024

It's strange that a university encourages use of Copilot.

It's called Github Student Developer Pack and it contains a lot of other things. I think some student's learning process will be enhanced with it while others will learn less, so a mixed bag

Do your credentials work with the VSCode plugin do you know?

Yes, I've been using copilot with all it's features, including copilot chat, and "fix with copilot" in vscode

My guess is that the api is closed for people that get copilot for free, so that they can't give it to others, maybe?

You said you can view the code actions successfully in the OP though. So are you getting the completions at first? The request that's failing is to do with refreshing the token so it might be that auth step which is done differently for your case.

@luccahuguet
Copy link
Author

luccahuguet commented Feb 19, 2024

It's strange that a university encourages use of Copilot.

It's called Github Student Developer Pack and it contains a lot of other things. I think some student's learning process will be enhanced with it while others will learn less, so a mixed bag

Do your credentials work with the VSCode plugin do you know?

Yes, I've been using copilot with all it's features, including copilot chat, and "fix with copilot" in vscode
My guess is that the api is closed for people that get copilot for free, so that they can't give it to others, maybe?

You said you can view the code actions successfully in the OP though. So are you getting the completions at first? The request that's failing is to do with refreshing the token so it might be that auth step which is done differently for your case.

I mean that I can see the code actions options (as in "improve code", "resolve diagnostics", etc) , but when I click any of them, I get the error described in OP.

and that error is the same whether it is a code action, or a completion on insert mode (like when you hit space bar)

@nrdxp
Copy link

nrdxp commented Feb 23, 2024

I am getting a very similar error when trying to use the openai handler with perplexities pplx api, which is openai compatible, so I figured it would work. Problem is the log is kinda not as helpful as I would like. Nowhere in the log does it show the full endpoint url, so I have no idea if it is simply misconfigured, or truly broken. Is there a way to increase the log verbosity?

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

No branches or pull requests

3 participants