Browse Source

test(web): isolate direct smoke skill homes

Build-review integration round 2.
Hypatia May 2 months ago
parent
commit
2e68e08644
1 changed files with 9 additions and 2 deletions
  1. 9 2
      apps/web/tests/smoke-real.e2e.ts

+ 9 - 2
apps/web/tests/smoke-real.e2e.ts

@@ -163,6 +163,8 @@ describe('dsh web keyless CLI smoke', () => {
         env: {
         env: {
           ...process.env,
           ...process.env,
           DEEPSEEK_API_KEY: 'keyless-web-no-call',
           DEEPSEEK_API_KEY: 'keyless-web-no-call',
+          DSH_HOME: join(sessionsDir, '.dsh'),
+          DSH_AGENTS_HOME: join(sessionsDir, '.agents'),
           TSX_TSCONFIG_PATH: join(REPO_ROOT, 'tsconfig.json'),
           TSX_TSCONFIG_PATH: join(REPO_ROOT, 'tsconfig.json'),
         },
         },
         stdio: ['ignore', 'pipe', 'pipe'],
         stdio: ['ignore', 'pipe', 'pipe'],
@@ -222,6 +224,7 @@ describe('dsh web keyless CLI smoke', () => {
           DEEPSEEK_API_KEY: 'keyless-web-workspace',
           DEEPSEEK_API_KEY: 'keyless-web-workspace',
           DEEPSEEK_BASE_URL: `http://127.0.0.1:${address.port}`,
           DEEPSEEK_BASE_URL: `http://127.0.0.1:${address.port}`,
           DSH_HOME: join(workspace, '.dsh'),
           DSH_HOME: join(workspace, '.dsh'),
+          DSH_AGENTS_HOME: join(workspace, '.agents'),
           TSX_TSCONFIG_PATH: join(REPO_ROOT, 'tsconfig.json'),
           TSX_TSCONFIG_PATH: join(REPO_ROOT, 'tsconfig.json'),
         },
         },
         stdio: ['ignore', 'pipe', 'pipe'],
         stdio: ['ignore', 'pipe', 'pipe'],
@@ -241,6 +244,8 @@ describe('dsh web keyless CLI smoke', () => {
           setTimeout(() => { reject(new Error('provider request not received in 10s')) }, 10_000).unref()
           setTimeout(() => { reject(new Error('provider request not received in 10s')) }, 10_000).unref()
         }),
         }),
       ])
       ])
+      expect(captured.messages?.some(message =>
+        message.role === 'user' && message.content?.includes('<available_skills>'))).toBe(false)
       const workspaceMessage = captured.messages?.find(message =>
       const workspaceMessage = captured.messages?.find(message =>
         message.role === 'user' && message.content?.includes('web-workspace-context-probe'))
         message.role === 'user' && message.content?.includes('web-workspace-context-probe'))
       expect(workspaceMessage).toMatchInlineSnapshot(`
       expect(workspaceMessage).toMatchInlineSnapshot(`
@@ -310,6 +315,7 @@ describe('dsh web keyless CLI smoke', () => {
           DEEPSEEK_BASE_URL: `http://127.0.0.1:${address.port}`,
           DEEPSEEK_BASE_URL: `http://127.0.0.1:${address.port}`,
           DSH_TOOLS_MODE: 'code',
           DSH_TOOLS_MODE: 'code',
           DSH_HOME: join(workspace, '.dsh'),
           DSH_HOME: join(workspace, '.dsh'),
+          DSH_AGENTS_HOME: join(workspace, '.agents'),
           TSX_TSCONFIG_PATH: join(REPO_ROOT, 'tsconfig.json'),
           TSX_TSCONFIG_PATH: join(REPO_ROOT, 'tsconfig.json'),
         },
         },
         stdio: ['ignore', 'pipe', 'pipe'],
         stdio: ['ignore', 'pipe', 'pipe'],
@@ -358,8 +364,8 @@ describe.skipIf(!process.env.DEEPSEEK_API_KEY || notReady.length > 0)('web smoke
     sessionsDir = mkdtempSync(join(tmpdir(), 'dsh-web-w5-'))
     sessionsDir = mkdtempSync(join(tmpdir(), 'dsh-web-w5-'))
     const port = await probeFreePort()
     const port = await probeFreePort()
     // tsx boot mirrors demo:web — lib/ may be unbuilt in this worktree. Isolate
     // tsx boot mirrors demo:web — lib/ may be unbuilt in this worktree. Isolate
-    // the global Harness home inside the temp world; tsx also needs the repo's
-    // loader and tsconfig paths pointed at explicitly.
+    // the host-level Harness and shared-agent homes inside the temp world; tsx
+    // also needs the repo's loader and tsconfig paths pointed at explicitly.
     const tsxLoader = pathToFileURL(createRequire(join(REPO_ROOT, 'package.json')).resolve('tsx')).href
     const tsxLoader = pathToFileURL(createRequire(join(REPO_ROOT, 'package.json')).resolve('tsx')).href
     child = spawn(
     child = spawn(
       process.execPath,
       process.execPath,
@@ -369,6 +375,7 @@ describe.skipIf(!process.env.DEEPSEEK_API_KEY || notReady.length > 0)('web smoke
         env: {
         env: {
           ...process.env,
           ...process.env,
           DSH_HOME: join(sessionsDir, '.dsh'),
           DSH_HOME: join(sessionsDir, '.dsh'),
+          DSH_AGENTS_HOME: join(sessionsDir, '.agents'),
           TSX_TSCONFIG_PATH: join(REPO_ROOT, 'tsconfig.json'),
           TSX_TSCONFIG_PATH: join(REPO_ROOT, 'tsconfig.json'),
         },
         },
         stdio: ['ignore', 'pipe', 'pipe'],
         stdio: ['ignore', 'pipe', 'pipe'],