fix(agents): clear stale frontier tool denies

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 13:51:16 +09:00
parent 8a49a03100
commit 467248535e
5 changed files with 177 additions and 10 deletions
+69
View File
@@ -484,4 +484,73 @@ describe("maybeCreateHephaestusConfig GPT apply_patch guard", () => {
expect(config?.permission).toHaveProperty("glob", "deny");
});
});
describe("#given frontier default model with category override to non-frontier model", () => {
test("#when config is created #then stale grep and glob denies are cleared", () => {
// given
const agentOverrides: AgentOverrides = {
hephaestus: {
category: "non-frontier",
},
};
const mergedCategories: Record<string, CategoryConfig> = {
"non-frontier": {
model: "openai/gpt-5.4",
},
};
// when
const config = maybeCreateHephaestusConfig({
disabledAgents: [],
agentOverrides,
availableModels: new Set(["openai/gpt-5.5", "openai/gpt-5.4"]),
systemDefaultModel: "openai/gpt-5.5",
isFirstRunNoCache: false,
availableAgents: [],
availableSkills: [],
availableCategories: [],
mergedCategories,
useTaskSystem: false,
});
// then
expect(config?.model).toBe("openai/gpt-5.4");
expect(config?.permission).not.toHaveProperty("grep");
expect(config?.permission).not.toHaveProperty("glob");
});
});
describe("#given non-frontier model with user override denying grep and glob", () => {
test("#when config is created #then explicit user denies are preserved", () => {
// given
const agentOverrides: AgentOverrides = {
hephaestus: {
model: "openai/gpt-5.4",
permission: {
grep: "deny",
glob: "deny",
} as Record<string, "deny">,
},
};
const mergedCategories: Record<string, CategoryConfig> = {};
// when
const config = maybeCreateHephaestusConfig({
disabledAgents: [],
agentOverrides,
availableModels: new Set(["openai/gpt-5.4"]),
systemDefaultModel: "openai/gpt-5.4",
isFirstRunNoCache: false,
availableAgents: [],
availableSkills: [],
availableCategories: [],
mergedCategories,
useTaskSystem: false,
});
// then
expect(config?.permission).toHaveProperty("grep", "deny");
expect(config?.permission).toHaveProperty("glob", "deny");
});
});
});