fix(agents): hide grep glob for frontier agents

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-27 12:49:20 +09:00
parent f74d03ca90
commit c46b712997
8 changed files with 222 additions and 6 deletions
+73 -3
View File
@@ -1,3 +1,5 @@
/// <reference types="bun-types" />
import { describe, expect, test } from "bun:test";
import {
getHephaestusPromptSource,
@@ -321,7 +323,7 @@ describe("maybeCreateHephaestusConfig GPT apply_patch guard", () => {
model: "openai/gpt-5.4",
permission: {
apply_patch: "allow",
},
} as Record<string, "allow">,
},
};
const mergedCategories: Record<string, CategoryConfig> = {};
@@ -355,7 +357,7 @@ describe("maybeCreateHephaestusConfig GPT apply_patch guard", () => {
model: "anthropic/claude-opus-4-7",
permission: {
apply_patch: "allow",
},
} as Record<string, "allow">,
},
};
const mergedCategories: Record<string, CategoryConfig> = {};
@@ -389,7 +391,7 @@ describe("maybeCreateHephaestusConfig GPT apply_patch guard", () => {
model: "openai/gpt-4o",
permission: {
apply_patch: "allow",
},
} as Record<string, "allow">,
},
};
const mergedCategories: Record<string, CategoryConfig> = {};
@@ -414,4 +416,72 @@ describe("maybeCreateHephaestusConfig GPT apply_patch guard", () => {
expect(config?.permission).toHaveProperty("apply_patch", "deny");
});
});
describe("#given Opus 4.7 model with user override allowing grep and glob", () => {
test("#when config is created #then grep and glob are still denied", () => {
// given
const agentOverrides: AgentOverrides = {
hephaestus: {
model: "anthropic/claude-opus-4-7",
permission: {
grep: "allow",
glob: "allow",
} as Record<string, "allow">,
},
};
const mergedCategories: Record<string, CategoryConfig> = {};
// when
const config = maybeCreateHephaestusConfig({
disabledAgents: [],
agentOverrides,
availableModels: new Set(["anthropic/claude-opus-4-7"]),
systemDefaultModel: "anthropic/claude-opus-4-7",
isFirstRunNoCache: false,
availableAgents: [],
availableSkills: [],
availableCategories: [],
mergedCategories,
useTaskSystem: false,
});
// then
expect(config?.permission).toHaveProperty("grep", "deny");
expect(config?.permission).toHaveProperty("glob", "deny");
});
});
describe("#given GPT 5.5 model with user override allowing grep and glob", () => {
test("#when config is created #then grep and glob are still denied", () => {
// given
const agentOverrides: AgentOverrides = {
hephaestus: {
model: "openai/gpt-5.5",
permission: {
grep: "allow",
glob: "allow",
} as Record<string, "allow">,
},
};
const mergedCategories: Record<string, CategoryConfig> = {};
// when
const config = maybeCreateHephaestusConfig({
disabledAgents: [],
agentOverrides,
availableModels: new Set(["openai/gpt-5.5"]),
systemDefaultModel: "openai/gpt-5.5",
isFirstRunNoCache: false,
availableAgents: [],
availableSkills: [],
availableCategories: [],
mergedCategories,
useTaskSystem: false,
});
// then
expect(config?.permission).toHaveProperty("grep", "deny");
expect(config?.permission).toHaveProperty("glob", "deny");
});
});
});
+2
View File
@@ -9,6 +9,7 @@ import type {
} from "../dynamic-agent-prompt-builder";
import { categorizeTools, buildAgentIdentitySection } from "../dynamic-agent-prompt-builder";
import { getGptApplyPatchPermission } from "../gpt-apply-patch-guard";
import { getFrontierToolSchemaPermission } from "../frontier-tool-schema-guard";
import { buildHephaestusPrompt as buildGptPrompt } from "./gpt";
import { buildHephaestusPrompt as buildGpt53CodexPrompt } from "./gpt-5-3-codex";
@@ -139,6 +140,7 @@ export function createHephaestusAgent(
permission: {
question: "allow",
call_omo_agent: "deny",
...getFrontierToolSchemaPermission(model),
...getGptApplyPatchPermission(model),
} as AgentConfig["permission"],
reasoningEffort: "medium",