I think I found the basic cause for this to be much deeper in the code.
When the printer is paused for user the line is echo:busy: paused for user
src/octoprint/util/comm.py has a line if line.startswith("echo:busy:") or line.startswith("busy:")
which filters out lines like this and handles the busy protocol but also prevents them from being further computed.
Am I right about this?
If yes: My Plan would be to implement the handling of echo:busy: paused for user
This might include also some test based refactoring of at least this pretty large function that contains the code mentioned above ( def _monitor(self): )
I'm well aware that changes in other modules are also necessary.
I don't think this can be done with a plugin.
Would you support my plan?
Should I consider other solutions?
If I remember right, the 'paused for user' thing is Prusa-specific? I can't remember it being a thing in the mainline Marlin firmware. It would be nice if printers all worked the same way with their responses. If it used action commands/prompts correctly then there would be no issue.
There are a couple of other plugins that handle this message.
To answer some of the more technical code questions, I am not sure what further computation you are wanting to do - but handling it as 'busy' works ok, perhaps a notification or something, but then these are doable with a plugin. The message shows up when user interaction is needed on the LCD screen.
I would avoid changing too much of the serial code. The current communication protocol has grown up over more than 10 years, and is due to be completely rewritten. Personally I would rather leave it as it is, as it doesn't really deserve lots of time put into the existing code. I know Gina had a fairly far along version of a new comm layer, but lots has happened and it's taking a long time to progress.
Thank you for the hints to other plugins.
I think I now figured out how this all works and where probably my problem is.
But this will take me some more investigation to clarify.