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
5 changes: 2 additions & 3 deletions packages/gittensory-mcp/bin/gittensory-mcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2004,9 +2004,8 @@ function initClient(options) {
function resolveAgentProfile(profileId) {
if (!profileId) return null;
const id = String(profileId).trim().toLowerCase();
const profile = AGENT_PROFILES[id];
if (!profile) throw new Error(`Unsupported agent profile: ${profileId}. Use ${AGENT_PROFILE_IDS.join(", ")}.`);
return profile;
if (!Object.hasOwn(AGENT_PROFILES, id)) throw new Error(`Unsupported agent profile: ${profileId}. Use ${AGENT_PROFILE_IDS.join(", ")}.`);
return AGENT_PROFILES[id];
}

function formatAgentProfile(profile) {
Expand Down
5 changes: 4 additions & 1 deletion test/unit/mcp-cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,10 @@ describe("gittensory-mcp CLI", () => {
});

it("rejects unsupported agent profiles", () => {
expect(() => run(["init-client", "--print", "codex", "--agent-profile", "autopilot"])).toThrow(/Unsupported agent profile/);
for (const profile of ["autopilot", "__proto__", "constructor"]) {
expect(() => run(["init-client", "--print", "codex", "--agent-profile", profile])).toThrow(/Unsupported agent profile/);
expect(() => run(["init-client", "--print", "codex", "--agent-profile", profile, "--json"])).toThrow(/Unsupported agent profile/);
}
});

it("reports the package version via version, --version, and -v", () => {
Expand Down