loader-composition.e2e.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { join } from 'node:path'
  2. import { fileURLToPath } from 'node:url'
  3. import { describe, expect, it } from 'vitest'
  4. import {
  5. LOADER_SMOKE_TEST_TIMEOUT_MS,
  6. runLoaderSmoke,
  7. } from '@deepseek-ai/dsh-loader-smoke'
  8. const fixtureDir = fileURLToPath(new URL(
  9. '../../../../examples/acp-agent/tests/fixtures/subagent/subagent-codex/',
  10. import.meta.url,
  11. ))
  12. const driver = join(fixtureDir, 'driver.ts')
  13. const configPath = join(fixtureDir, 'cordis.yml')
  14. const repoTsconfig = fileURLToPath(new URL('../../../../tsconfig.json', import.meta.url))
  15. describe('Codex provider public Loader composition', () => {
  16. it('loads the opt-in package, one-shot task tool, and job controls without starting Codex', async () => {
  17. const { stdout, stderr } = await runLoaderSmoke({
  18. label: 'subagent-codex Loader composition',
  19. tempDirPrefix: 'dsh-subagent-codex-loader-',
  20. binScript: driver,
  21. libBinScript: driver,
  22. configPath,
  23. tsconfigPath: repoTsconfig,
  24. env: {
  25. // Loading the optional package must not probe or start a Codex binary.
  26. PATH: '',
  27. },
  28. })
  29. expect(stderr).toBe('')
  30. expect(JSON.parse(stdout)).toEqual({
  31. providers: ['codex'],
  32. provider: {
  33. name: 'codex',
  34. capabilities: {
  35. outputSchema: false,
  36. depthLimit: false,
  37. toolFilter: false,
  38. persona: false,
  39. },
  40. inheritsParentContext: false,
  41. },
  42. tool: {
  43. name: 'subagent_codex',
  44. parameterNames: ['description', 'prompt', 'run_in_background'],
  45. required: ['description', 'prompt'],
  46. },
  47. jobTools: ['job_kill', 'job_list', 'job_output'],
  48. starts: 0,
  49. })
  50. }, LOADER_SMOKE_TEST_TIMEOUT_MS)
  51. })