From c5381de8b26b16c796f5c5582a48bff0969a5059 Mon Sep 17 00:00:00 2001 From: Hypatia May Date: Thu, 16 Jul 2026 17:57:45 +0800 Subject: [PATCH] time-context: cover missing baselines (round 2) --- .../time-context/tests/time-context.spec.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/context/time-context/tests/time-context.spec.ts b/packages/context/time-context/tests/time-context.spec.ts index 6df7957fb7..fdcce39912 100644 --- a/packages/context/time-context/tests/time-context.spec.ts +++ b/packages/context/time-context/tests/time-context.spec.ts @@ -184,6 +184,29 @@ describe('durable step context', () => { ) }) + it('reports an unavailable later-step baseline at the matching turn boundary', async () => { + const { ctx } = await mount() + const session = new Session(SessionId('later-step-boundary')) + openMessageTurn(session, 4) + + await fire(ctx, sessionAgent(session), 4, 2) + + expect(contextTexts(session)[0]).toContain( + 'Elapsed since the preceding step context: unavailable.', + ) + }) + + it('reports an unavailable later-step baseline when event lookup is exhausted', async () => { + const { ctx } = await mount() + const session = new Session(SessionId('later-step-exhausted')) + + await fire(ctx, sessionAgent(session), 1, 2) + + expect(contextTexts(session)[0]).toContain( + 'Elapsed since the preceding step context: unavailable.', + ) + }) + it('clamps backward wall-clock movement against the preceding context to zero', async () => { const { ctx } = await mount() const session = new Session(SessionId('backward'))