review fix: distinguish checkpoint settlement

This commit is contained in:
pku-xht
2026-07-17 17:38:39 +08:00
parent 0b720942df
commit 915c727e14
6 changed files with 13 additions and 13 deletions

View File

@@ -114,7 +114,7 @@ describe('agent loop scheduling properties', () => {
// No message lost: every send appears as a user/message, in order.
expect(userMessageTexts(agent)).toEqual(texts)
// Every successful send owns an independent turn even before the driver wakes.
// This failure-free fixture claims every item into an independent turn.
expect(turnNumbers(agent)).toEqual(texts.map((_, i) => i + 1))
expect(turnEndNumbers(agent)).toEqual(texts.map((_, i) => i + 1))
expect(userMessageCountsByTurn(agent)).toEqual(texts.map(() => 1))
@@ -172,7 +172,7 @@ describe('agent loop scheduling properties', () => {
// No message is lost or reordered, regardless of driver timing.
expect(userMessageTexts(agent)).toEqual(steps.map(s => s.text))
// Every send owns exactly one turn, numbered in FIFO order.
// Every item is claimed and therefore owns one FIFO-ordered turn.
const turns = turnNumbers(agent)
expect(turns).toEqual(steps.map((_, i) => i + 1))
expect(turnEndNumbers(agent)).toEqual(turns)

View File

@@ -221,8 +221,8 @@ export interface SessionEventMap {
'turn/start': { turn: number; trigger: TurnTrigger }
/**
* Closes turn `turn` with the {@link TurnEndReason} that ended it. The loop
* fires the awaited `session/flush` checkpoint at every turn end, so the turn
* boundary is also the durable-commit boundary.
* fires the awaited `session/flush` checkpoint at every turn end; the next turn waits for settlement.
* Success commits the closed turn; rejection is reported live and does not prevent later work.
*/
'turn/end': { turn: number; reason: TurnEndReason }
/** Opens step `step` of turn `turn` — one model call plus the tool executions it requested. */