Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Pre-commit hooks (husky) run lint-staged (Prettier) and `npm test` automatically
- Preserve existing formatting in touched files unless a formatting change is required for correctness.
- Never run project-wide formatting as part of a feature/fix unless the user explicitly requests it.
- If formatting is required, scope it to the smallest possible set of changed lines/files.
- Preserve each file's existing line ending style (LF vs CRLF) and never introduce EOL-only churn.

## Release & Versioning

Expand Down
22 changes: 7 additions & 15 deletions src/main/agents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,30 +124,22 @@ mode: gpt-4.5
expect(result.agents).toEqual([]);
});

it('should find gemini and codex agent files', async () => {
it('should find gemini agent file', async () => {
mocks.existsSync.mockImplementation((path: string) => {
const normalized = normalizePath(path);
return (
normalized === '/tmp/test-home/.gemini/GEMINI.md' ||
normalized === '/tmp/test-home/.codex/AGENTS.md'
);
return normalized === '/tmp/test-home/.gemini/GEMINI.md';
});
mocks.stat.mockResolvedValue({ isFile: () => true });
mocks.readFile.mockImplementation((path: string) => {
if (normalizePath(path).includes('/.gemini/')) {
return Promise.resolve(`---
name: gemini-agent
---`);
}
mocks.readFile.mockImplementation(() => {
return Promise.resolve(`---
name: codex-agent
name: gemini-agent
---`);
});

const result = await getAllAgents();

expect(result.agents.length).toBe(2);
const sources = result.agents.map((agent) => agent.source).sort();
expect(sources).toEqual(['codex', 'gemini']);
expect(result.agents.length).toBe(1);
const sources = result.agents.map((agent) => agent.source);
expect(sources).toEqual(['gemini']);
});
});
5 changes: 0 additions & 5 deletions src/main/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ export async function getAllAgents(projectRoot?: string, cwd?: string): Promise<

const personalFiles = [
{ path: join(homePath, '.gemini', 'GEMINI.md'), source: 'gemini' as const },
{ path: join(homePath, '.codex', 'AGENTS.md'), source: 'codex' as const },
];

for (const { path, source } of personalFiles) {
Expand All @@ -295,8 +294,6 @@ export async function getAllAgents(projectRoot?: string, cwd?: string): Promise<
for (const { path, source } of projectDirs) {
addResults(await scanAgentsDirectory(path, 'project', source));
}

addResults(await scanAgentFile(join(projectRoot, 'AGENTS.md'), 'project', 'codex'));
}

if (cwd && cwd !== projectRoot) {
Expand All @@ -309,8 +306,6 @@ export async function getAllAgents(projectRoot?: string, cwd?: string): Promise<
for (const { path, source } of cwdDirs) {
addResults(await scanAgentsDirectory(path, 'project', source));
}

addResults(await scanAgentFile(join(cwd, 'AGENTS.md'), 'project', 'codex'));
}

return { agents, errors };
Expand Down
Loading