runtime: suppress stale owner progress flush

This commit is contained in:
ejclaw
2026-04-12 14:18:22 +09:00
parent 4275f4f984
commit 1f4cd861af
2 changed files with 66 additions and 0 deletions

View File

@@ -517,6 +517,24 @@ export class MessageTurnController {
* pending text differs from the final text.
*/
private async flushPendingProgress(finalText: string): Promise<void> {
if (
this.options.canDeliverFinalText &&
!this.options.canDeliverFinalText()
) {
this.log.info(
{
runId: this.options.runId,
deliveryRole: this.options.deliveryRole ?? null,
turnId: this.options.pairedTurnIdentity?.turnId ?? null,
pendingLength: this.pendingProgressText?.length ?? 0,
finalLength: finalText.length,
},
'Skipped flushing pending progress because this run no longer owns the active paired turn attempt',
);
this.pendingProgressText = null;
return;
}
if (
this.pendingProgressText &&
(this.options.pairedTurnIdentity?.role === 'reviewer' ||