I start to sound like a Jujutsu fanboy but...
Jujutsu already does this. I had agent screwing up changeset over couple hour long session and it took one shell command to split on pieces with longer pause.
The only downside is that because of Jujutsu snapshots it can't be used inside sandbox (since all jj commands are mutating)
Jujutsu is great, but it does not do this. It has no knowledge of agent sessions.