fix: clarify Prometheus file permission error message (fixes #2150)

This commit is contained in:
YeonGyu-Kim
2026-03-23 18:07:59 +09:00
parent d886ac701f
commit a64e364fa6
3 changed files with 19 additions and 20 deletions
+15 -15
View File
@@ -66,7 +66,7 @@ describe("prometheus-md-only", () => {
//#when //#then
await expect(
hook["tool.execute.before"](input, output)
).rejects.toThrow("can only write/edit .md files")
).rejects.toThrow("File operations restricted to .sisyphus/*.md plan files only")
})
test("should enforce md-only restriction for Prometheus display name Plan Builder", async () => {
@@ -85,7 +85,7 @@ describe("prometheus-md-only", () => {
//#when //#then
await expect(
hook["tool.execute.before"](input, output)
).rejects.toThrow("can only write/edit .md files")
).rejects.toThrow("File operations restricted to .sisyphus/*.md plan files only")
})
test("should enforce md-only restriction for Prometheus display name Planner", async () => {
@@ -104,7 +104,7 @@ describe("prometheus-md-only", () => {
//#when //#then
await expect(
hook["tool.execute.before"](input, output)
).rejects.toThrow("can only write/edit .md files")
).rejects.toThrow("File operations restricted to .sisyphus/*.md plan files only")
})
test("should enforce md-only restriction for uppercase PROMETHEUS", async () => {
@@ -123,7 +123,7 @@ describe("prometheus-md-only", () => {
//#when //#then
await expect(
hook["tool.execute.before"](input, output)
).rejects.toThrow("can only write/edit .md files")
).rejects.toThrow("File operations restricted to .sisyphus/*.md plan files only")
})
test("should not enforce restriction for non-Prometheus agent", async () => {
@@ -185,7 +185,7 @@ describe("prometheus-md-only", () => {
// when / #then
await expect(
hook["tool.execute.before"](input, output)
).rejects.toThrow("can only write/edit .md files")
).rejects.toThrow("File operations restricted to .sisyphus/*.md plan files only")
})
test("should allow Prometheus to write .md files inside .sisyphus/", async () => {
@@ -262,7 +262,7 @@ describe("prometheus-md-only", () => {
// when / #then
await expect(
hook["tool.execute.before"](input, output)
).rejects.toThrow("can only write/edit .md files inside .sisyphus/")
).rejects.toThrow("File operations restricted to .sisyphus/*.md plan files only")
})
test("should block Edit tool for non-.md files", async () => {
@@ -280,7 +280,7 @@ describe("prometheus-md-only", () => {
// when / #then
await expect(
hook["tool.execute.before"](input, output)
).rejects.toThrow("can only write/edit .md files")
).rejects.toThrow("File operations restricted to .sisyphus/*.md plan files only")
})
test("should allow bash commands from Prometheus", async () => {
@@ -337,7 +337,7 @@ describe("prometheus-md-only", () => {
).resolves.toBeUndefined()
})
test("should inject read-only warning when Prometheus calls task", async () => {
test("should inject planning warning when Prometheus calls task", async () => {
// given
const hook = createPrometheusMdOnlyHook(createMockPluginInput())
const input = {
@@ -357,7 +357,7 @@ describe("prometheus-md-only", () => {
expect(output.args.prompt).toContain("DO NOT modify any files")
})
test("should inject read-only warning when Prometheus calls task", async () => {
test("should inject planning warning when Prometheus calls task", async () => {
// given
const hook = createPrometheusMdOnlyHook(createMockPluginInput())
const input = {
@@ -376,7 +376,7 @@ describe("prometheus-md-only", () => {
expect(output.args.prompt).toContain(SYSTEM_DIRECTIVE_PREFIX)
})
test("should inject read-only warning when Prometheus calls call_omo_agent", async () => {
test("should inject planning warning when Prometheus calls call_omo_agent", async () => {
// given
const hook = createPrometheusMdOnlyHook(createMockPluginInput())
const input = {
@@ -540,7 +540,7 @@ describe("prometheus-md-only", () => {
// when / then - should block because boulder says prometheus
await expect(
hook["tool.execute.before"](input, output)
).rejects.toThrow("can only write/edit .md files")
).rejects.toThrow("File operations restricted to .sisyphus/*.md plan files only")
})
test("should fall back to message files when session not in boulder", async () => {
@@ -573,7 +573,7 @@ describe("prometheus-md-only", () => {
// when / then - should block because falls back to message files (prometheus)
await expect(
hook["tool.execute.before"](input, output)
).rejects.toThrow("can only write/edit .md files")
).rejects.toThrow("File operations restricted to .sisyphus/*.md plan files only")
})
})
@@ -675,7 +675,7 @@ describe("prometheus-md-only", () => {
// when / #then
await expect(
hook["tool.execute.before"](input, output)
).rejects.toThrow("can only write/edit .md files inside .sisyphus/")
).rejects.toThrow("File operations restricted to .sisyphus/*.md plan files only")
})
test("should allow nested .sisyphus directories (ctx.directory may be parent)", async () => {
@@ -713,7 +713,7 @@ describe("prometheus-md-only", () => {
// when / #then
await expect(
hook["tool.execute.before"](input, output)
).rejects.toThrow("can only write/edit .md files inside .sisyphus/")
).rejects.toThrow("File operations restricted to .sisyphus/*.md plan files only")
})
test("should allow case-insensitive .SISYPHUS directory", async () => {
@@ -790,7 +790,7 @@ describe("prometheus-md-only", () => {
// when / #then
await expect(
hook["tool.execute.before"](input, output)
).rejects.toThrow("can only write/edit .md files")
).rejects.toThrow("File operations restricted to .sisyphus/*.md plan files only")
})
})
})