toeverything / AFFiNE

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
https://affine.pro
Other
41.33k stars 2.69k forks source link

Copilot Plugins in affine.js: "You have reached the limit of actions" error after a few interactions, despite having token balance. #8427

Open NuerSir opened 1 week ago

NuerSir commented 1 week ago

What happened?

Issue Body:

I've successfully integrated Copilot Plugins into affine.js and configured it with OpenAI. The "Ask AI" feature works initially, but after approximately 10 interactions, I consistently receive the error message: "You have reached the limit of actions in this workspace, please upgrade your plan."

This occurs despite having a sufficient token balance in my OpenAI account. I've verified that making direct requests to OpenAI using curl works without any issues.

Steps to reproduce:

  1. Integrate Copilot Plugins into affine.js and configure with OpenAI.
  2. Use the "Ask AI" feature to interact with Copilot.
  3. After approximately 10 interactions, the error message will appear. image

Expected behavior:

The "Ask AI" feature should continue to function as long as there is a sufficient token balance in the OpenAI account.

Actual behavior:

The "Ask AI" feature stops working after a limited number of interactions, regardless of token balance.

Additional information:

Possible causes:

Request:

Please investigate this issue and provide a solution.

Distribution version

Linux

What browsers are you seeing the problem on if you're using web version?

No response

Are you self-hosting?

Relevant log output

{
    "errors": [
        {
            "message": "You have reached the limit of actions in this workspace, please upgrade your plan.",
            "locations": [
                {
                    "line": 3,
                    "column": 3
                }
            ],
            "path": [
                "createCopilotSession"
            ],
            "extensions": {
                "status": 402,
                "code": "Payment Required",
                "type": "QUOTA_EXCEEDED",
                "name": "COPILOT_QUOTA_EXCEEDED",
                "message": "You have reached the limit of actions in this workspace, please upgrade your plan.",
                "stacktrace": "copilot_quota_exceeded: You have reached the limit of actions in this workspace, please upgrade your plan.\n    at ChatSessionService.checkQuota (file:///app/dist/plugins/copilot/session.js:430:19)\n    at async CopilotResolver.createCopilotSession (file:///app/dist/plugins/copilot/resolver.js:414:13)"
            }
        }
    ],
    "data": null
}

Anything else?

No response

affine-issue-bot[bot] commented 1 week ago

Issue Status: 🆕 *Untriaged

*🆕 Untriaged**

The team has not yet reviewed the issue. We usually do it within one business day. Docs: https://github.com/toeverything/AFFiNE/blob/canary/docs/issue-triaging.md

This is an automatic reply by the bot.

forehalo commented 1 week ago

we are pushing the adaptation of ai for selfhost instances, but we haven't make it 100% ready. please be patient.

NuerSir commented 1 week ago

we are pushing the adaptation of ai for selfhost instances, but we haven't make it 100% ready. please be patient.

@forehalo After modifying Copilot, it works and the output results meet my expectations. However, AFFINE should have usage restrictions. I hope you can tell me where to modify to remove this restriction. Thank you very much.

NuerSir commented 6 days ago

we are pushing the adaptation of ai for selfhost instances, but we haven't make it 100% ready. please be patient.

@forehalo After modifying Copilot, it works and the output results meet my expectations. However, AFFINE should have usage restrictions. I hope you can tell me where to modify to remove this restriction. Thank you very much.

Please forgive my carelessness. I read the code and found the limitation in the features table. It can be used normally now. I hope AFFINE itself can have a more friendly and open way to access more LLM. I will look forward to it.