Add progress callback#74
Conversation
|
If you look at the changes you'll see that the AI removed English comments in some places and added Chinese ones in others. This is of course not acceptable for an international Open Source project. Please instruct your agent never to remove any comments and always use English for its own comments. Also, it should add only comments which are necessary for understanding the code. Also instruct it to touch nothing else except what needs to be changed for the purpose of the new feature. |
henon
left a comment
There was a problem hiding this comment.
Highlighted only two examples, there are many more places where changes need to be undone.
… restore the parts of comments that were previously removed by AI.
henon
left a comment
There was a problem hiding this comment.
I think some original comments are still missing and there is a question about the new parameter filename. The rest looks good.
|
Line 305 in Installer.cs |
|
OK, so I made changes to keep RunCommand clean. It was intended to run shell commands only. By adding python command parsing to it the AI poisoned that method's clean and simple purpose. Instead I split off a separate RunPipCommand which is specialized for running PIP and parsing its progress. Please test if this still works for you then we can merge this PR. |


Purpose: When calling functions like await Installer.TryInstallPip(); and await Installer.PipInstallModule("torch", progress: progress); sometimes, due to network issues or very large packages, the program has to wait a long time without any progress feedback. Simply showing a loading spinner isn’t ideal, so here we add a progress callback parameter to make it easier to display the current progress in real time.
PS: The code was implemented using AI, and self-testing shows no issues so far. Here's my test code—you can also try it out to see if it works. If there are no problems, it can be merged and published to NuGet (pre-release is fine too). I'm a bit pressed to use it. Thanks a lot!