From 1f2c85c854985384febdf6829cc3d9eb2181b3ed Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Tue, 14 Jul 2026 13:47:44 +0800 Subject: [PATCH] test: await fresh stdio agent publication --- packages/ui/stdio-agent/tests/stdio-agent.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/ui/stdio-agent/tests/stdio-agent.spec.ts b/packages/ui/stdio-agent/tests/stdio-agent.spec.ts index a14848a549..4d555f5965 100644 --- a/packages/ui/stdio-agent/tests/stdio-agent.spec.ts +++ b/packages/ui/stdio-agent/tests/stdio-agent.spec.ts @@ -85,6 +85,7 @@ describe('dsh-stdio-agent app', () => { expect(ctx.get('tools')?.get('ask_user_question')).toBeDefined() // The sole pre-created agent the UI drives. `main` is its stable config // label; each fresh process mints a durable combined agent/session id. + await expect.poll(() => ctx.get('agents')?.list()).toHaveLength(1) const agent = ctx.get('agents')?.list()[0] expect(agent).toBeDefined() expect(agent?.id).toBe(agent?.session.id) @@ -100,6 +101,7 @@ describe('dsh-stdio-agent app', () => { persistenceRoot: '/tmp/dsh-stdio-agent-spec-empty-resume', skills: await isolatedSkillsConfig(), }) + await expect.poll(() => ctx.get('agents')?.list()).toHaveLength(1) const agent = ctx.get('agents')?.list()[0] expect(agent?.id).toMatch(/^main-session-[0-9a-f-]{36}$/) expect(agent?.id).toBe(agent?.session.id)