/ tests / agent-runtime-codex-args.test.ts
agent-runtime-codex-args.test.ts
 1  import { describe, expect, it } from 'vitest'
 2  
 3  import { buildCodexExecArgs } from '@/server/agents/runtime/backends/codex'
 4  
 5  describe('codex runtime exec args', () => {
 6    it('omits --all for new-session codex exec runs', () => {
 7      const args = buildCodexExecArgs({
 8        sessionId: null,
 9        prompt: 'investigate regression',
10        cwd: '/home/helper/projects/helper',
11      })
12  
13      expect(args).toEqual([
14        'exec',
15        '--full-auto',
16        '--json',
17        '--skip-git-repo-check',
18        '-C',
19        '/home/helper/projects/helper',
20        'investigate regression',
21      ])
22      expect(args).not.toContain('--all')
23    })
24  
25    it('keeps --all for resume runs', () => {
26      const args = buildCodexExecArgs({
27        sessionId: '11111111-2222-3333-4444-555555555555',
28        prompt: 'continue from prior context',
29        cwd: null,
30      })
31  
32      expect(args).toEqual([
33        'exec',
34        'resume',
35        '--full-auto',
36        '--json',
37        '--all',
38        '--skip-git-repo-check',
39        '11111111-2222-3333-4444-555555555555',
40        'continue from prior context',
41      ])
42    })
43  })