Jelajahi Sumber

fix(bench): rely on testkit session projection mounting

mountAgentLoopTestDependencies registers SessionProjectionRegistry, so benchmark workers must not mount it again before resuming agents.
_Kerman 3 minggu lalu
induk
melakukan
753effe602

+ 0 - 2
benchmarks/agent-continuation/agent-continuation.worker.ts

@@ -10,7 +10,6 @@ import { createUserMessage, LlmAdapter } from '@deepseek-ai/dsh-llm'
 import type { GenerateOptions, LlmResolvedModelInfo, StreamChunk } from '@deepseek-ai/dsh-llm'
 import { SESSION_FORMAT_VERSION } from '@deepseek-ai/dsh-session'
 import JsonlSessionPersistence from '@deepseek-ai/dsh-session-persistence-jsonl'
-import SessionProjectionRegistry from '@deepseek-ai/dsh-session-projection'
 import { defineContentToolFixture } from '@deepseek-ai/dsh-tools'
 import { assertBuiltBenchmarkRuntime } from '../support/built-worker.ts'
 import { PARENT_ID, response, resultText, syntheticHistory, TIME_ZERO, WORKLOAD } from './workload.ts'
@@ -82,7 +81,6 @@ async function measure(root: string, scenario: string): Promise<ContinuationRepo
   const adapter = new SyntheticAdapter(toolHeavy ? WORKLOAD.toolsPerLiveTurn : 0)
   let toolCalls = 0
   try {
-    await ctx.plugin(SessionProjectionRegistry)
     await mountAgentLoopTestDependencies(ctx)
     await ctx.plugin(JsonlSessionPersistence, { root, compression: 'zstd' })
     await ctx.plugin(AgentLoop, { agents: [] })

+ 4 - 2
benchmarks/session-open/session-open.worker.ts

@@ -159,10 +159,12 @@ class SessionBenchmarkHost {
 
   static async create(root: string, scenario: SessionOpenBenchmarkScenario): Promise<SessionBenchmarkHost> {
     const ctx = new Context()
-    await ctx.plugin(SessionProjectionRegistry)
     const agentScenario = scenario === 'agent-resume'
     if (agentScenario) await mountAgentLoopTestDependencies(ctx)
-    else await ctx.plugin(SessionStore)
+    else {
+      await ctx.plugin(SessionProjectionRegistry)
+      await ctx.plugin(SessionStore)
+    }
     await installProjectionSet(ctx, agentScenario)
     await ctx.plugin(JsonlSessionPersistence, { root, compression: 'zstd' })
     let history: SessionHistoryController | undefined