loader-composition.e2e.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 and foreground tool 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'],
  45. required: ['description', 'prompt'],
  46. },
  47. starts: 0,
  48. })
  49. }, LOADER_SMOKE_TEST_TIMEOUT_MS)
  50. })