runtime: suppress stale owner progress updates

This commit is contained in:
ejclaw
2026-04-12 14:59:52 +09:00
parent 1f4cd861af
commit 721f0f65f0
2 changed files with 153 additions and 1 deletions

View File

@@ -561,6 +561,23 @@ export class MessageTurnController {
}
private async syncTrackedProgressMessage(): 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,
progressMessageId: this.progressMessageId,
latestProgressLength: this.latestProgressText?.length ?? 0,
},
'Skipped editing tracked progress because this run no longer owns the active paired turn attempt',
);
return;
}
if (
!this.progressMessageId ||
!this.options.channel.editMessage ||
@@ -713,6 +730,24 @@ export class MessageTurnController {
}
private async sendProgressMessage(text: 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,
progressMessageId: this.progressMessageId,
textLength: text.length,
},
'Skipped progress delivery because this run no longer owns the active paired turn attempt',
);
this.pendingProgressText = null;
return;
}
if (!text || (text === this.latestProgressText && this.progressMessageId)) {
return;
}