yaroslavyaroslav / OpenAI-sublime-text

First class Sublime Text AI assistant with GPT-o1 and ollama support!
MIT License
198 stars 15 forks source link

Update README with workaround for error caused by length requirement on token property even if not required by server #63

Closed knutle closed 1 month ago

knutle commented 1 month ago

Add a quick note to explain a workaround for incorrect token error even when using local provider with no auth required.

Root cause seems to be the string length check on token at plugins/openai_worker.py:471 Should be a fairly quick fix depending on how you prefer to handle it, but I'd probably suggest something like disabling the length check if token value is explicitly set to Null rather that empty string just for simplicity.

Anyways, I figured a little heads up added to the readme would have saved me a bit of head-scratching, while still being fairly low-effort in case you already have plans for a long term fix, so here it is :)

yaroslavyaroslav commented 1 month ago

Hey, thank you for participating with this. It's really quite painfully missed info within the docs. But could you also please add kinda same note into openAI.sublime-settings right above the "token" field, to make it even more eye catchy?

knutle commented 1 month ago

Sure, no problem! How about adding a new "Known Issues" section right before "Disclaimers"? Explain how to implement the workaround there, and link it up to an actual repo issue which actually details the underlying cause.

Then just briefly mention the issue where relevant and reference the full explanation. Allows the fix to be more prominent without adding too much extra noise.

I'll tinker with it a little and add some suggestions :)

knutle commented 1 month ago

See issue #64 for a detailed description of problem cause, current workaround, and other relevant info

knutle commented 1 month ago

let me know if i missed something ✌️ also, if my suggested solution sounds good I can probably take a stab at it around the end of the week if you'd like👌

yaroslavyaroslav commented 1 month ago

Thank you for such thorough PR.

The only thing that catches my eye here is that I consider as no go to ask a user to go to GitHub issues to get the answer of how to fix the error they're got, so I'd add this very comment in the settings after all // Token can be anything so long as it is at least 10 characters long.

But if you're gonna to fix the issue completely soon, I'm ok with how it's going as well.

knutle commented 1 month ago

Updated the comment in the config file as suggested since I might not have time to fix the issue for a little while after all, sorry 😅

yaroslavyaroslav commented 1 month ago

No worries, there is no rush here. Thank you for the participation with docs.