askthecode / documentation

MIT License
86 stars 14 forks source link

Unable to access some paths in public repos #40

Open jbmln opened 1 month ago

jbmln commented 1 month ago

I'm having difficulty getting ask the code to access some paths/files in a public GitHub repo.

For example: https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/include/experimental/type_traits

This link is viewable and points towards a file but askthecode complains of being unable to access the file directly.

It's not the only header in the GCC mirror repo which askthecode cannot seem to query. Some work and some do not without any obvious reason.

dsomok commented 1 month ago

Hi @jbmln

Thank you for reporting the issue, and sorry for the delay with the response. I can confirm that the issue exists, and I was able to reproduce it.

I will work on the fix and will release it today or tomorrow. Will also ping you here once it is resolved.

jbmln commented 1 month ago

Thanks. Obviously you'll know your own codebase but the issue seemed to be triggered for files without extensions: could the plugin be parsing them as directories?

I also wondered whether "+" char in the libstdc++-v3 folder might be problematic given "+" is not URL safe.

It might also be due to the sheer size of the GCC repo.

I created my own public repo containing only the include folder from libstdc++-v3 and askthecode worked perfectly. I forget if I had to append a .h to the extension-less headers.

Thanks for being responsive - no need to apologise. Must be annoying having OpenAI presumably make breaking changes to their APIs

dsomok commented 1 month ago

Yes, that's exactly the root cause of the issue. The absence of the file extension made the plugin treat this file URL as the URL to the repository directory. This issue has been fixed; however, it has not yet been deployed to the production instance.

Apart from the issue with loading the content of the files without extensions, I've noticed that the plugin struggles to operate correctly with the repository you've shared due to the large size of the repo, which causes truncated responses from the GitHub API when the repository tree structure is queried.

I'm testing the fix for this issue on my development plugin instance, so hopefully, I will release both fixes tomorrow.

dsomok commented 1 month ago

hi @jbmln

I've released the fix to the production instance, could you please test it works for you now?

I've tested the changes on this sample conversation: https://chatgpt.com/share/ce79a709-91cf-41bc-a4a1-b6b129128f4a

jbmln commented 1 month ago

hi @dsomok,

What works

Able to read files without an extension. As per your chat link but also in my own tests.

What doesn't work

Interacting with some directories when prompted to directly - such as https://github.com/gcc-mirror/gcc/tree/master/libstdc%2B%2B-v3/include/bits

See my chat link

You'll see from the above linked chat, the plugin copes fine with ./gcc/tree/master/config but not with ./gcc/tree/master/libstdc++-v3/include/bits.

I tried replacing the URL encoded %2B representations of "+" with the "+" char in chat prompt window but it still didn't work. I'd hazard a guess it has something to do with either the "+" char or the size/depth of the structure so deep into the repo.

In summary

It seems to be able to interact with all files now (great!), but not necessarily all directories.

dsomok commented 1 month ago

hey @jbmln,

Thanks for sharing test results, I've found an issue and released a fix. I've verified with the bits directory, looks like it works now: https://chatgpt.com/share/d1d9e5ac-4995-485e-8637-b813eff7b906

Could you please test if the problem is solved for you?

jsbien commented 1 month ago

Today: "I currently don't have the capability to directly commit changes to your GitHub repository." which should be not true. Later: The current situation may be due to one of the following reasons:

Permission Changes: There might have been a change in permissions that now restricts my ability to directly interact with your repository.
Session or Token Expiry: The access token or session that enabled direct commits might have expired or been revoked.

Looks like the access token expired. What to do about it?

dsomok commented 1 month ago

hey @jsbien, could you please share some demo conversation via the Share chat button at the top-right corner? This would help me to spot the issue and check the logs for a potential issue.