di-sukharev / opencommit

Generate conventional git commit messages with AI in 1 second 🤯🔫
https://www.npmjs.com/package/opencommit
MIT License
5.98k stars 318 forks source link

[Bug]: Request failed with status code 404 #317

Closed noisy closed 3 weeks ago

noisy commented 6 months ago

Opencommit Version

3.0.12

Node Version

18.15.0

NPM Version

9.5.0

What OS are you seeing the problem on?

Mac

What happened?

opencommit cannot generate a commit message.

Expected Behavior

This should work.

Current Behavior

opencommit
┌  open-commit
│
◇  1 staged files:
  .vscode/settings.json
│
◓  Generating the commit message
│
└  ✖ {"model":"gpt-4","messages":[{"role":"system","content":"You are to act as the author of a commit message in git. Your mission is to create clean and comprehensive commit messages as per the conventional commit convention and explain WHAT were the changes and mainly WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you are to convert it into a commit message.\n  Do not preface the commit with anything. Conventional commit keywords:fix, feat, build, chore, ci, docs, style, refactor, perf, test.  \n    Don't add any descriptions to the commit, only commit message.\n    \n    Use the present tense. Lines must not be longer than 74 characters. Use english for the commit message."},{"role":"user","content":"diff --git a/src/server.ts b/src/server.ts\n    index ad4db42..f3b18a9 100644\n    --- a/src/server.ts\n    +++ b/src/server.ts\n    @@ -10,7 +10,7 @@\n    import {\n        initWinstonLogger();\n        \n        const app = express();\n        -const port = 7799;\n        +const PORT = 7799;\n        \n        app.use(express.json());\n        \n        @@ -34,6 +34,6 @@\n        app.use((_, res, next) => {\n            // ROUTES\n            app.use(PROTECTED_ROUTER_URL, protectedRouter);\n            \n            -app.listen(port, () => {\n                -  console.log(`Server listening on port ${port}`);\n                +app.listen(process.env.PORT || PORT, () => {\n                    +  console.log(`Server listening on port ${PORT}`);\n                });"},{"role":"assistant","content":"fix(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics\nfeat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port\n"},{"role":"user","content":"diff --git a/.vscode/settings.json b/.vscode/settings.json\nindex 49c6312..4c89195 100644\n--- a/.vscode/settings.json\n+++ b/.vscode/settings.json\n@@ -29,5 +29,6 @@\n         \"**/__pycache__\": true,\n         \"**/.pytest_cache\": true,\n         \"dist/**\": true,\n+        \".ruff_cache/**\": true,\n     },\n }"}],"temperature":0,"top_p":0.1,"max_tokens":500}

│
│
◇  📝 Commit message generated
│
└  ✖ Request failed with status code 404

image

Possible Solution

No response

Steps to Reproduce

No response

Relevant log output

No response

noisy commented 6 months ago

btw, it works with a different account and different api-key. There is some problem with my openai account, and this is how it behaves in that case.

di-sukharev commented 3 weeks ago

lets close then