Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
ts 36 lines 876 Bytes
Raw
1 import { describe, expect, it } from 'vitest';
2
3 import { detectMaster } from 'src/services/master-detector';
4
5 describe('master-detector', () => {
6 it('detects codex when codex env markers are present', () => {
7 expect(
8 detectMaster({
9 codex: true,
10 claude: false,
11 })
12 ).toBe('codex');
13 });
14
15 it('detects claude when claude env markers are present without codex markers', () => {
16 expect(
17 detectMaster({
18 codex: false,
19 claude: true,
20 })
21 ).toBe('claude');
22 });
23
24 it('prefers codex when both codex and claude markers are present', () => {
25 expect(
26 detectMaster({
27 codex: true,
28 claude: true,
29 })
30 ).toBe('codex');
31 });
32
33 it('falls back to user when no known agent markers are present', () => {
34 expect(detectMaster({ codex: false, claude: false })).toBe('user');
35 });
36 });