Ver Fonte

test(sdk): mount session projections in loop fixtures

Turtle há 1 mês atrás
pai
commit
fddad3a236

+ 3 - 0
packages/sdk/server/tests/built-scope-carrier.e2e.ts

@@ -28,6 +28,7 @@ const [
   { Context },
   { default: AgentLoop },
   { mountAgentLoopTestDependencies },
+  { default: SessionProjectionRegistry },
   { default: SubagentRuntime },
   { default: JsonlSessionPersistence },
   { HarnessSdkJsonRpcServer },
@@ -36,6 +37,7 @@ const [
   load("vendor/cordis/lib/index.js"),
   load("packages/core/agent-loop/lib/index.js"),
   load("packages/test-support/agent-loop-testkit/lib/index.js"),
+  load("packages/session/session-projection/lib/index.js"),
   load("packages/subagent/subagent/lib/index.js"),
   load("packages/session/session-persistence-jsonl/lib/index.js"),
   load("packages/sdk/server/lib/index.js"),
@@ -46,6 +48,7 @@ const storageRoot = await mkdtemp(join(tmpdir(), "jsonrpc-built-scope-"));
 const ctx = new Context();
 try {
   await mountAgentLoopTestDependencies(ctx);
+  await ctx.plugin(SessionProjectionRegistry);
   await ctx.plugin(AgentLoop, { agents: [] });
   await ctx.plugin(SubagentRuntime);
   await ctx.plugin(JsonlSessionPersistence, { root: storageRoot });

+ 2 - 0
packages/sdk/server/tests/plugin-apply.spec.ts

@@ -11,6 +11,7 @@ import AgentLoop from '@deepseek-ai/dsh-agent-loop'
 import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
 import { LlmAdapter } from '@deepseek-ai/dsh-llm'
 import type { GenerateOptions, StreamChunk } from '@deepseek-ai/dsh-llm'
+import SessionProjectionRegistry from '@deepseek-ai/dsh-session-projection'
 import JsonlSessionPersistence from '@deepseek-ai/dsh-session-persistence-jsonl'
 import * as jsonrpc from '../src/index.ts'
 
@@ -76,6 +77,7 @@ async function mountPlugin(
 ): Promise<ApplyHarness> {
   const ctx = new Context()
   await mountAgentLoopTestDependencies(ctx)
+  await ctx.plugin(SessionProjectionRegistry)
   await ctx.plugin(AgentLoop, { agents: [] })
   await ctx.plugin(JsonlSessionPersistence, { root: storageDir })
   await new Promise(resolve => setTimeout(resolve, 50))