fix: use case-insensitive matching for prometheus agent detection#1770
Merged
code-yeongyu merged 2 commits intodevfrom Feb 11, 2026
Merged
fix: use case-insensitive matching for prometheus agent detection#1770code-yeongyu merged 2 commits intodevfrom
code-yeongyu merged 2 commits intodevfrom
Conversation
- Detect namespaced commands (containing ':') from Claude marketplace plugins - Provide clear error message explaining marketplace plugins are not supported - Point users to .claude/commands/ as alternative for custom commands - Fixes issue where /daplug:run-prompt gave ambiguous 'command not found' Closes #1682
…prometheus-md-only hook The hook used exact string equality (agentName !== "prometheus") which fails when display names like "Prometheus (Plan Builder)" are stored in session state. Replace with case-insensitive substring matching via isPrometheusAgent() helper, consistent with the pattern used in keyword-detector hook. Closes #1764 (Bug 3)
There was a problem hiding this comment.
No issues found across 5 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Changes are low-risk: 1) Error message improvements for marketplace plugin commands (better UX, no logic change), 2) Refactored agent matching from exact string to case-insensitive includes (safer, no
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.
Summary
agentName !== "prometheus") and failed when display names like"Prometheus (Plan Builder)"were stored in session stateisPrometheusAgent()helper, consistent with the pattern used in keyword-detector hookProblem
The
prometheus-md-onlyhook enforces that Prometheus can only write.mdfiles inside.sisyphus/. However, the agent detection logic used exact match:getSessionAgent()can return display names (e.g.,"Prometheus (Plan Builder)","Prometheus (Planner)") depending on how OpenCode stores the agent name. When this happens, the hook silently fails to activate, allowing Prometheus to write arbitrary files — bypassing the policy enforcement.Solution
Extract a robust matcher into
agent-matcher.ts:This matches the pattern already used by
keyword-detector/ultrawork/source-detector.ts.Testing
Added 6 new test cases covering:
"prometheus"→ blocked ✅"Prometheus (Plan Builder)"→ blocked ✅"Prometheus (Planner)"→ blocked ✅"PROMETHEUS"→ blocked ✅"sisyphus"→ not blocked ✅All 35 tests pass. Typecheck clean.
Related
Closes #1764 (Bug 3: Prometheus Detection)
Summary by cubic
Make Prometheus md-only enforcement reliable by detecting the agent with case-insensitive substring matching. Also clarify errors for namespaced marketplace slash commands.
Written for commit c12c6fa. Summary will update on new commits.