5
.changeset/patient-ibex-gather.md
Normal file
5
.changeset/patient-ibex-gather.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
type: Fixed
|
||||||
|
pr: 278
|
||||||
|
---
|
||||||
|
Fixed Codex agent detection to include .toml role files so install checks do not false-report missing agents.
|
||||||
@@ -1130,10 +1130,14 @@ function checkAgentsInstalled() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const agent of expectedAgents) {
|
for (const agent of expectedAgents) {
|
||||||
// Check both .md (standard) and .agent.md (Copilot) file formats.
|
// Check all runtime agent file formats:
|
||||||
|
// - .md (Claude/OpenCode/Gemini/etc.)
|
||||||
|
// - .agent.md (Copilot)
|
||||||
|
// - .toml (Codex)
|
||||||
const agentFile = path.join(agentsDir, `${agent}.md`);
|
const agentFile = path.join(agentsDir, `${agent}.md`);
|
||||||
const agentFileCopilot = path.join(agentsDir, `${agent}.agent.md`);
|
const agentFileCopilot = path.join(agentsDir, `${agent}.agent.md`);
|
||||||
if (fs.existsSync(agentFile) || fs.existsSync(agentFileCopilot)) {
|
const agentFileCodex = path.join(agentsDir, `${agent}.toml`);
|
||||||
|
if (fs.existsSync(agentFile) || fs.existsSync(agentFileCopilot) || fs.existsSync(agentFileCodex)) {
|
||||||
installed.push(agent);
|
installed.push(agent);
|
||||||
} else {
|
} else {
|
||||||
missing.push(agent);
|
missing.push(agent);
|
||||||
|
|||||||
@@ -236,6 +236,26 @@ describe('checkAgentsInstalled: Copilot .agent.md format (#1512)', () => {
|
|||||||
'missing_agents must be empty when all .agent.md files are present');
|
'missing_agents must be empty when all .agent.md files are present');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('agents_installed=true when agents exist as .toml (Codex format) (#278)', () => {
|
||||||
|
const agentsDir = path.join(tmpDir, 'codex-agents');
|
||||||
|
fs.mkdirSync(agentsDir, { recursive: true });
|
||||||
|
for (const name of EXPECTED_AGENTS) {
|
||||||
|
fs.writeFileSync(
|
||||||
|
path.join(agentsDir, `${name}.toml`),
|
||||||
|
`name = "${name}"\ndescription = "Test agent"\n`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = runGsdTools('validate agents --raw', tmpDir, { GSD_AGENTS_DIR: agentsDir });
|
||||||
|
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||||
|
|
||||||
|
const output = JSON.parse(result.output);
|
||||||
|
assert.strictEqual(output.agents_found, true,
|
||||||
|
'agents_found must be true when agents exist as .toml (Codex format)');
|
||||||
|
assert.deepStrictEqual(output.missing, [],
|
||||||
|
'missing must be empty when all agents exist as .toml');
|
||||||
|
});
|
||||||
|
|
||||||
test('GSD_AGENTS_DIR env var overrides default agents directory', () => {
|
test('GSD_AGENTS_DIR env var overrides default agents directory', () => {
|
||||||
// Create a custom agents dir in a subdirectory
|
// Create a custom agents dir in a subdirectory
|
||||||
const customAgentsDir = path.join(tmpDir, 'custom-agents');
|
const customAgentsDir = path.join(tmpDir, 'custom-agents');
|
||||||
|
|||||||
Reference in New Issue
Block a user