Skip to content

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

Merged
code-yeongyu merged 1 commit intodevfrom
fix/issue-2150
Mar 23, 2026
Merged

fix: clarify Prometheus file permission error message (fixes #2150)#2762
code-yeongyu merged 1 commit intodevfrom
fix/issue-2150

Conversation

@code-yeongyu
Copy link
Copy Markdown
Owner

@code-yeongyu code-yeongyu commented Mar 23, 2026

Problem

Prometheus error message contradicts itself — says both "can only write .md files inside .sisyphus/" AND "is a READ-ONLY planner".

Fix

Clarify the error message to accurately describe Prometheus permissions: planning agent restricted to .sisyphus/*.md plan files, use task() for implementation.

Fixes #2150

Automated fix by Sisyphus (oh-my-opencode)


Summary by cubic

Clarified Prometheus permission messaging to state it’s a planning-only agent restricted to writing .sisyphus/*.md plan files, and to use task() for implementation. Fixes #2150.

  • Bug Fixes
    • Updated PLANNING_CONSULT_WARNING and thrown error text to remove “READ-ONLY” contradiction and clearly state .sisyphus/*.md restriction with task() guidance.
    • Aligned hook comments/logs with the new copy and updated tests to assert the new error message.

Written for commit a64e364. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files

Confidence score: 3/5

  • There is a concrete regression risk in src/hooks/prometheus-md-only/hook.ts: hardcoding "Prometheus" instead of using getAgentDisplayName("prometheus") can break Opencode agent display-name compatibility for configured environments.
  • The duplicate test description in src/hooks/prometheus-md-only/index.test.ts is lower severity, but it can reduce test clarity and make failures harder to interpret.
  • Given the medium-severity, high-confidence compatibility issue, this carries some user-facing risk until addressed, though the fixes appear straightforward.
  • Pay close attention to src/hooks/prometheus-md-only/hook.ts, src/hooks/prometheus-md-only/index.test.ts - restore dynamic agent naming and ensure test names are unique.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/hooks/prometheus-md-only/index.test.ts">

<violation number="1" location="src/hooks/prometheus-md-only/index.test.ts:340">
P2: This renaming creates a duplicate test name, as the test immediately following it has the exact same description.</violation>
</file>

<file name="src/hooks/prometheus-md-only/hook.ts">

<violation number="1" location="src/hooks/prometheus-md-only/hook.ts:57">
P2: Custom agent: **Opencode Compatibility**

Do not hardcode 'Prometheus'. Restore the use of `getAgentDisplayName("prometheus")` to maintain compatibility with Opencode's agent display name configurations.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

})

test("should inject read-only warning when Prometheus calls task", async () => {
test("should inject planning warning when Prometheus calls task", async () => {
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This renaming creates a duplicate test name, as the test immediately following it has the exact same description.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/hooks/prometheus-md-only/index.test.ts, line 340:

<comment>This renaming creates a duplicate test name, as the test immediately following it has the exact same description.</comment>

<file context>
@@ -337,7 +337,7 @@ describe("prometheus-md-only", () => {
     })
 
-    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())
</file context>
Suggested change
test("should inject planning warning when Prometheus calls task", async () => {
test("should inject planning warning and file constraints when Prometheus calls task", async () => {
Fix with Cubic

})
throw new Error(
`[${HOOK_NAME}] ${getAgentDisplayName("prometheus")} can only write/edit .md files inside .sisyphus/ directory. ` +
`[${HOOK_NAME}] Prometheus is a planning agent. File operations restricted to .sisyphus/*.md plan files only. Use task() to delegate implementation. ` +
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Custom agent: Opencode Compatibility

Do not hardcode 'Prometheus'. Restore the use of getAgentDisplayName("prometheus") to maintain compatibility with Opencode's agent display name configurations.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/hooks/prometheus-md-only/hook.ts, line 57:

<comment>Do not hardcode 'Prometheus'. Restore the use of `getAgentDisplayName("prometheus")` to maintain compatibility with Opencode's agent display name configurations.</comment>

<file context>
@@ -54,9 +54,8 @@ export function createPrometheusMdOnlyHook(ctx: PluginInput) {
          })
          throw new Error(
-           `[${HOOK_NAME}] ${getAgentDisplayName("prometheus")} can only write/edit .md files inside .sisyphus/ directory. ` +
+           `[${HOOK_NAME}] Prometheus is a planning agent. File operations restricted to .sisyphus/*.md plan files only. Use task() to delegate implementation. ` +
            `Attempted to modify: ${filePath}. ` +
-           `${getAgentDisplayName("prometheus")} is a READ-ONLY planner. Use /start-work to execute the plan. ` +
</file context>
Suggested change
`[${HOOK_NAME}] Prometheus is a planning agent. File operations restricted to .sisyphus/*.md plan files only. Use task() to delegate implementation. ` +
`[${HOOK_NAME}] ${getAgentDisplayName("prometheus")} is a planning agent. File operations restricted to .sisyphus/*.md plan files only. Use task() to delegate implementation. ` +
Fix with Cubic

@code-yeongyu code-yeongyu merged commit 67b5f46 into dev Mar 23, 2026
7 of 8 checks passed
@code-yeongyu code-yeongyu deleted the fix/issue-2150 branch March 23, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Models misinterpret "READ ONLY" mode in Prometheus

1 participant