Skip to content

fix: binary file check#377

Closed
ix-56h wants to merge 13 commits into
coderamp-labs:mainfrom
ix-56h:fix_binary_files_handle
Closed

fix: binary file check#377
ix-56h wants to merge 13 commits into
coderamp-labs:mainfrom
ix-56h:fix_binary_files_handle

Conversation

@ix-56h

@ix-56h ix-56h commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

Closes #375

Topic

tiktoken crash sometimes with binary files, after diging i've found that we did some check to ignore binary files but not strong enough.

@ix-56h ix-56h self-assigned this Jul 3, 2025
@ix-56h

ix-56h commented Jul 3, 2025

Copy link
Copy Markdown
Contributor Author

@NicolasIRAGNE i've fix encoding issue on windows, we now use utf-16 le instead of utf-16.

I let you decide what we need to do from now.

@NicolasIRAGNE

Copy link
Copy Markdown
Contributor

I'll take a look whenever I have a bit of time, I'm not sure what this does but it seems better than initial check

But I am curious as to what the actual error is. Do we read too many characters? What happens if the file is just a huge numbers of ascii chars?

Also, #375 did this fix the problem as well?

@ix-56h

ix-56h commented Jul 4, 2025

Copy link
Copy Markdown
Contributor Author

But I am curious as to what the actual error is. Do we read too many characters? What happens if the file is just a huge numbers of ascii chars?

The current problem:

  1. we read a chunk of a file
  2. we wrongly determine binaries using a too much simple method
  3. this leads to include bytes within the final output context
  4. the tiktoken package, which uses rust, panic when unwrapping parsing result

Also, #375 did this fix the problem as well?

Yes. This is the main purpose of this with another one : The context should now ignore a lot more (if it's not all) binaries, so the context should be a lot more usable for LLMs on various repositories.

@ix-56h ix-56h changed the title fix binary file check fix: fix binary file check Jul 16, 2025
@ix-56h ix-56h changed the title fix: fix binary file check fix: binary file check Jul 16, 2025
@github-actions

github-actions Bot commented Sep 8, 2025

Copy link
Copy Markdown

Hi there! We haven’t seen activity on this pull request for 45 days, so I’m marking it as stale.
If you’d like to keep it open, please leave a comment within 10 days. Thanks!

@github-actions github-actions Bot added the stale label Sep 8, 2025
@github-actions

Copy link
Copy Markdown

Hi there! We haven’t heard anything for 10 days, so I’m closing this pull request. Feel free to reopen if you’d like to continue working on it. Thanks!

@github-actions github-actions Bot closed this Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: stackoverflow error with some repos

5 participants