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]: Anthropic 403 (Connectable with Regular Request, but not with OCO) #411

Closed RazeBerry closed 1 week ago

RazeBerry commented 3 weeks ago

Opencommit Version

3.1.2

Node Version

v20.17.0

NPM Version

10.8.3

What OS are you seeing the problem on?

No response

What happened?

OCO fails with 403 Forbidden error when using Anthropic API

Description

When attempting to generate a commit message using OCO (open-commit) with the Anthropic API, I'm encountering a 403 Forbidden error with the message "Request not allowed". This appears to be specific to OCO, as I can successfully use other software to access the Anthropic API with the same credentials/IP address.

Steps to reproduce

  1. Set up OCO with Anthropic API credentials
  2. Stage files for commit (in this case, FrenchVocab.py and README.md)
  3. Attempt to generate a commit message using OCO

Expected behavior

OCO should successfully generate a commit message using the Anthropic API.

Actual behavior

OCO fails with a 403 Forbidden error:

✖ 403 {"error":{"type":"forbidden","message":"Request not allowed"}}

Additional information

Expected Behavior

Call Goes Through!

Current Behavior

Call returns 403!

Possible Solution

No response

Steps to Reproduce

No response

Relevant log output

No response

di-sukharev commented 3 weeks ago

👀

di-sukharev commented 3 weeks ago

@RazeBerry could you update the latest version just merged https://github.com/di-sukharev/opencommit/pull/412

run npm i -g opencommit@latest

and try again

di-sukharev commented 3 weeks ago

@RazeBerry could you confirm if its ok?

di-sukharev commented 2 weeks ago

if not — pls share your ~./opencommit file: cat ~./opencommit | pbcopy on mac

RazeBerry commented 1 week ago

Sorry was away! I think it was a problem with IP address that I was traveling in Asia and HK, and sometimes has to do with the fact Anthropic blocks access to certain VPN sites. I think all HK IP addresses were automatically blocked. Strangely enough, it was also not working when I was in Thailand.

di-sukharev commented 1 week ago

thank you 👍 HK is awesome btw