Merge pull request #3749 from code-yeongyu/fix/readonly-agent-delegation
fix(agents): allow Momus and Metis delegation
This commit is contained in:
@@ -296,7 +296,6 @@ const metisRestrictions = createAgentToolRestrictions([
|
|||||||
"write",
|
"write",
|
||||||
"edit",
|
"edit",
|
||||||
"apply_patch",
|
"apply_patch",
|
||||||
"task",
|
|
||||||
])
|
])
|
||||||
|
|
||||||
export function createMetisAgent(model: string): AgentConfig {
|
export function createMetisAgent(model: string): AgentConfig {
|
||||||
|
|||||||
@@ -286,7 +286,6 @@ export function createMomusAgent(model: string): AgentConfig {
|
|||||||
"write",
|
"write",
|
||||||
"edit",
|
"edit",
|
||||||
"apply_patch",
|
"apply_patch",
|
||||||
"task",
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const base = {
|
const base = {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { createMetisAgent } from "./metis"
|
|||||||
import { createAtlasAgent } from "./atlas"
|
import { createAtlasAgent } from "./atlas"
|
||||||
import { createSisyphusAgent } from "./sisyphus"
|
import { createSisyphusAgent } from "./sisyphus"
|
||||||
import { createHephaestusAgent } from "./hephaestus"
|
import { createHephaestusAgent } from "./hephaestus"
|
||||||
|
import { getAgentToolRestrictions } from "../shared/agent-tool-restrictions"
|
||||||
|
|
||||||
const TEST_MODEL = "anthropic/claude-sonnet-4-5"
|
const TEST_MODEL = "anthropic/claude-sonnet-4-5"
|
||||||
|
|
||||||
@@ -85,6 +86,19 @@ describe("read-only agent tool restrictions", () => {
|
|||||||
expect(permission[tool]).toBe("deny")
|
expect(permission[tool]).toBe("deny")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("allows task delegation while remaining ineligible for team membership", () => {
|
||||||
|
// given
|
||||||
|
const agent = createMomusAgent(TEST_MODEL)
|
||||||
|
|
||||||
|
// when
|
||||||
|
const permission = agent.permission as Record<string, string>
|
||||||
|
const sessionRestrictions = getAgentToolRestrictions("momus")
|
||||||
|
|
||||||
|
// then
|
||||||
|
expect(permission["task"]).toBeUndefined()
|
||||||
|
expect(sessionRestrictions["task"]).toBeUndefined()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("Metis", () => {
|
describe("Metis", () => {
|
||||||
@@ -100,6 +114,19 @@ describe("read-only agent tool restrictions", () => {
|
|||||||
expect(permission[tool]).toBe("deny")
|
expect(permission[tool]).toBe("deny")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("allows task delegation while remaining ineligible for team membership", () => {
|
||||||
|
// given
|
||||||
|
const agent = createMetisAgent(TEST_MODEL)
|
||||||
|
|
||||||
|
// when
|
||||||
|
const permission = agent.permission as Record<string, string>
|
||||||
|
const sessionRestrictions = getAgentToolRestrictions("metis")
|
||||||
|
|
||||||
|
// then
|
||||||
|
expect(permission["task"]).toBeUndefined()
|
||||||
|
expect(sessionRestrictions["task"]).toBeUndefined()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("Atlas", () => {
|
describe("Atlas", () => {
|
||||||
|
|||||||
@@ -28,13 +28,11 @@ const AGENT_RESTRICTIONS: Record<string, Record<string, boolean>> = {
|
|||||||
metis: {
|
metis: {
|
||||||
write: false,
|
write: false,
|
||||||
edit: false,
|
edit: false,
|
||||||
task: false,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
momus: {
|
momus: {
|
||||||
write: false,
|
write: false,
|
||||||
edit: false,
|
edit: false,
|
||||||
task: false,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"multimodal-looker": {
|
"multimodal-looker": {
|
||||||
|
|||||||
Reference in New Issue
Block a user