Merge pull request #3659 from code-yeongyu/fix/dotted-opus-frontier-tools

fix(agents): cover dotted opus frontier model
This commit is contained in:
YeonGyu-Kim
2026-04-27 14:48:32 +09:00
committed by GitHub
4 changed files with 72 additions and 1 deletions
@@ -109,6 +109,40 @@ describe("maybeCreateSisyphusConfig", () => {
});
});
describe("#given dotted 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 = {
sisyphus: {
model: "anthropic/claude-opus-4.7",
permission: {
grep: "allow",
glob: "allow",
} as Record<string, "allow">,
},
};
const mergedCategories: Record<string, CategoryConfig> = {};
// when
const config = maybeCreateSisyphusConfig({
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
+2 -1
View File
@@ -7,7 +7,8 @@ type MutablePermission = Record<string, PermissionValue | Record<string, Permiss
function isOpus47Model(model: string): boolean {
const modelName = model.includes("/") ? (model.split("/").pop() ?? model) : model
return modelName.toLowerCase().includes("claude-opus-4-7")
const normalizedModelName = modelName.toLowerCase().replaceAll(".", "-")
return normalizedModelName.includes("claude-opus-4-7")
}
export function getFrontierToolSchemaPermission(model: string): Record<string, "deny"> {
+34
View File
@@ -451,6 +451,40 @@ describe("maybeCreateHephaestusConfig GPT apply_patch guard", () => {
});
});
describe("#given dotted 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
+2
View File
@@ -140,8 +140,10 @@ describe("read-only agent tool restrictions", () => {
// given
const frontierAgents = [
createSisyphusAgent("anthropic/claude-opus-4-7"),
createSisyphusAgent("anthropic/claude-opus-4.7"),
createSisyphusAgent("openai/gpt-5.5"),
createHephaestusAgent("anthropic/claude-opus-4-7"),
createHephaestusAgent("anthropic/claude-opus-4.7"),
createHephaestusAgent("openai/gpt-5.5"),
]