From 90ea3a329713c8c83d72e9eee6e123f2e3d03bd6 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Tue, 26 May 2026 12:08:18 -0400 Subject: [PATCH] fix(#278): detect codex .toml agent role files (#284) --- .changeset/patient-ibex-gather.md | 5 +++++ get-shit-done/bin/lib/core.cjs | 8 ++++++-- tests/agent-install-validation.test.cjs | 20 ++++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .changeset/patient-ibex-gather.md diff --git a/.changeset/patient-ibex-gather.md b/.changeset/patient-ibex-gather.md new file mode 100644 index 000000000..507f86080 --- /dev/null +++ b/.changeset/patient-ibex-gather.md @@ -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. diff --git a/get-shit-done/bin/lib/core.cjs b/get-shit-done/bin/lib/core.cjs index 4a71f2014..9fd362d98 100644 --- a/get-shit-done/bin/lib/core.cjs +++ b/get-shit-done/bin/lib/core.cjs @@ -1130,10 +1130,14 @@ function checkAgentsInstalled() { } 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 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); } else { missing.push(agent); diff --git a/tests/agent-install-validation.test.cjs b/tests/agent-install-validation.test.cjs index 64be5a6d4..efe0cc594 100644 --- a/tests/agent-install-validation.test.cjs +++ b/tests/agent-install-validation.test.cjs @@ -236,6 +236,26 @@ describe('checkAgentsInstalled: Copilot .agent.md format (#1512)', () => { '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', () => { // Create a custom agents dir in a subdirectory const customAgentsDir = path.join(tmpDir, 'custom-agents');