From d2aa66c4d6777237a986d569162342efe3068950 Mon Sep 17 00:00:00 2001 From: Yichen Jiang Date: Sun, 9 Aug 2026 23:42:26 +0800 Subject: [PATCH] fix(agent-presets): unify the session event entrypoint and re-address the hermetic skills probe The persistence catalog recognizes SessionEventMap augmentations of '@deepseek-ai/dsh-session/types' alone, so the selected event's old root-specifier declaration compiled but silently vanished from the generated catalog. The hermetic scaffold e2e still addressed the skill registry as a preset-realm service; under the layered host registry the composed agent's view is a scope read, and the ambient-root isolation it proves is unchanged. --- apps/web/tests/scaffold-hermetic.e2e.ts | 15 +++++++-------- packages/preset/agent-presets/src/session.ts | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/apps/web/tests/scaffold-hermetic.e2e.ts b/apps/web/tests/scaffold-hermetic.e2e.ts index 8b7c2ccea3..c504913b9b 100644 --- a/apps/web/tests/scaffold-hermetic.e2e.ts +++ b/apps/web/tests/scaffold-hermetic.e2e.ts @@ -40,19 +40,18 @@ it('isolates replay skill discovery from every ambient host root', async () => { try { scaffold = await launchWebScaffold() const ctx = scaffold.ctx - // The skill registry belongs to one agent's preset, behind an `isolate` - // realm the host cannot resolve by name — so the roots under test are only - // reachable through a composed agent, which is also the only shape that - // ever asks. `serviceFor` is the same addressing the gateway's `skill.list` - // uses for a browser request about a session. + // Local skill discovery belongs to the agent's preset LAYER of the host + // registry, so the roots under test are only reachable through a composed + // agent's view — the same scope the gateway's `skill.list` resolves for a + // browser request about a session. const handle = await ctx.agents.create({ sessionId: SessionId('hermetic-skills'), setup: agentCtx => ctx.agentPresets.mount(agentCtx).then(() => undefined), }) try { - const skills = ctx.agentPresets.serviceFor(handle.agent, 'skills') - if (skills === undefined) throw new Error('composed agent mounts no skill registry') - const names = (await skills.list({ cwd: scaffold.workspaceCwd })).map(skill => skill.name) + const skills = ctx.get('skills') + if (skills === undefined) throw new Error('the composition mounts no skill registry') + const names = (await skills.list({ cwd: scaffold.workspaceCwd, scope: handle.agent })).map(skill => skill.name) expect(names).not.toContain('ambient-dsh') expect(names).not.toContain('ambient-agents') expect(names).not.toContain('ambient-bundled') diff --git a/packages/preset/agent-presets/src/session.ts b/packages/preset/agent-presets/src/session.ts index dcb866b5dc..ae3edada27 100644 --- a/packages/preset/agent-presets/src/session.ts +++ b/packages/preset/agent-presets/src/session.ts @@ -15,7 +15,7 @@ import type { SessionEvent, SessionHeader } from '@deepseek-ai/dsh-session' -declare module '@deepseek-ai/dsh-session' { +declare module '@deepseek-ai/dsh-session/types' { interface SessionEventMap { /** * The session's agent preset was chosen after creation, while the session