fix: clarify Prometheus file permission error message (fixes #2150)#2762
Merged
code-yeongyu merged 1 commit intodevfrom Mar 23, 2026
Merged
fix: clarify Prometheus file permission error message (fixes #2150)#2762code-yeongyu merged 1 commit intodevfrom
code-yeongyu merged 1 commit intodevfrom
Conversation
There was a problem hiding this comment.
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 usinggetAgentDisplayName("prometheus")can break Opencode agent display-name compatibility for configured environments. - The duplicate test description in
src/hooks/prometheus-md-only/index.test.tsis 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 () => { |
There was a problem hiding this comment.
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 () => { |
| }) | ||
| 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. ` + |
There was a problem hiding this comment.
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. ` + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/*.mdplan files, usetask()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/*.mdplan files, and to usetask()for implementation. Fixes #2150.PLANNING_CONSULT_WARNINGand thrown error text to remove “READ-ONLY” contradiction and clearly state.sisyphus/*.mdrestriction withtask()guidance.Written for commit a64e364. Summary will update on new commits.