Open
Conversation
Introduces a new agent that provides competitive intelligence analysis, comparing Sentry against other error monitoring and observability products (Datadog, New Relic, Bugsnag, Rollbar, etc.) with structured feature comparisons, pricing analysis, and developer experience insights. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sentry.metrics.increment is not available as a function in the client-side bundle of @sentry/nextjs v10. Use optional chaining on all client-side metrics calls so they gracefully no-op instead of throwing a TypeError. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Same issue as the client-side fix — Sentry.metrics.increment and Sentry.metrics.distribution are not available as functions in @sentry/nextjs v10. Apply optional chaining to both API routes so the SDK query() call can actually execute. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines
+73
to
+81
| prompt: fullPrompt, | ||
| options: { | ||
| maxTurns: 10, | ||
| tools: { type: 'preset', preset: 'claude_code' }, | ||
| permissionMode: 'bypassPermissions', | ||
| allowDangerouslySkipPermissions: true, | ||
| includePartialMessages: true, | ||
| cwd: process.cwd(), | ||
| } |
There was a problem hiding this comment.
Bug: The system prompt is concatenated into the prompt string instead of being passed to the dedicated systemPrompt option in the query() call, leading to wasted tokens.
Severity: MEDIUM
Suggested Fix
Refactor the query() call to separate the system prompt from the user prompt. Pass the SYSTEM_PROMPT constant to the systemPrompt property within the options object. The prompt parameter should only contain the user's message and conversation context.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/app/api/competitive-research/route.ts#L73-L81
Potential issue: The `query()` function for the Claude Agent SDK is called with the
system prompt concatenated directly into the `prompt` parameter. The SDK provides a
dedicated `systemPrompt` option for this purpose. By combining them, the system prompt
is resent with every turn in a multi-turn conversation, which wastes tokens and
increases costs. This also risks the model misinterpreting system-level directives as
part of the user's query, potentially leading to incorrect or inconsistent behavior. The
new `competitive-research` route introduces this incorrect pattern.
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
.agents/skills/competitive-research/with structured research methodologyWhat's included
.agents/skills/competitive-research/SKILL.md) — defines research methodology, competitor catalog, and output formatsrc/app/api/competitive-research/route.ts) — streaming SSE endpoint using Claude Agent SDK with full Sentry instrumentationsrc/components/desktop/apps/CompetitiveResearch.tsx) — chat UI with quick-prompt buttons for common comparisonssrc/components/desktop/Desktop.tsx) — agent appears in the Agents folder and launches as a windowed appTest plan
competitive_research.*namespace)🤖 Generated with Claude Code