revert: use session.append

This commit is contained in:
imccyu
2026-07-28 16:49:55 +08:00
parent 9ce201e490
commit 6c4e606e61
2 changed files with 23 additions and 42 deletions
+1 -5
View File
@@ -313,11 +313,7 @@ export class ReactLoopAgent implements Agent {
this.abort = controller
this.acceptsNextStep = true
const signal = controller.signal
// The log is the turn-number authority: out-of-band zero-step turns
// (command lifecycle on an idle log) advance it behind this cached
// counter, so re-derive the successor at open instead of trusting it.
const loggedLast = this.session.events.findLast(event => event.type === 'turn/start')?.data.turn ?? 0
const turn = Math.max(this.lastTurn, loggedLast) + 1
const turn = this.lastTurn + 1
let step = 0
let opened = false
let reason: TurnEndReason = { kind: 'completed' }