Skip to content

feat: prompt users to enable Insights on first MCP server enable#1660

Open
simplesagar wants to merge 4 commits intomainfrom
claude/slack-add-onboarding-options-lQE6Z
Open

feat: prompt users to enable Insights on first MCP server enable#1660
simplesagar wants to merge 4 commits intomainfrom
claude/slack-add-onboarding-options-lQE6Z

Conversation

@simplesagar
Copy link
Member

@simplesagar simplesagar commented Feb 20, 2026

When a user enables their first MCP server, the ServerEnableDialog now shows an "Enable Insights" toggle (defaulting to ON) that opts the org into log capture. This helps users discover observability features earlier rather than finding the prompt only when visiting the Logs page.

Closes AGE-1383

https://speakeasyapi.slack.com/archives/C08H55TP4HZ/p1771605667549619?thread_ts=1771605435.984869&cid=C08H55TP4HZ https://claude.ai/code/session_01XPgEFhNdNSfSV4YQ7qGHDk


Open with Devin

When a user enables their first MCP server, the ServerEnableDialog now
shows an "Enable Insights" toggle (defaulting to ON) that opts the org
into log capture. This helps users discover observability features
earlier rather than finding the prompt only when visiting the Logs page.

Closes AGE-1383

https://speakeasyapi.slack.com/archives/C08H55TP4HZ/p1771605667549619?thread_ts=1771605435.984869&cid=C08H55TP4HZ
https://claude.ai/code/session_01XPgEFhNdNSfSV4YQ7qGHDk
@simplesagar simplesagar requested a review from a team as a code owner February 20, 2026 19:13
@linear
Copy link

linear bot commented Feb 20, 2026

@vercel
Copy link

vercel bot commented Feb 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment Feb 20, 2026 7:37pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 20, 2026

🦋 Changeset detected

Latest commit: 563ec9c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
dashboard Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

devin-ai-integration[bot]

This comment was marked as resolved.

@simplesagar simplesagar added the preview Spawn a preview environment label Feb 20, 2026
@speakeasybot
Copy link
Collaborator

speakeasybot commented Feb 20, 2026

🚀 Preview Environment (PR #1660)

Preview URL: https://pr-1660.dev.getgram.ai

Component Status Details Updated (UTC)
✅ Database Ready Existing database reused 2026-03-03 17:17:12.
✅ Images Available Container images ready 2026-03-03 17:16:54.

Gram Preview Bot

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

Comment on lines +37 to 48
if (isFirstServerEnable && enableInsights) {
setLogsFeature({
request: {
setProductFeatureRequestBody: {
featureName: FeatureName.Logs,
enabled: true,
},
},
});
}
onConfirm();
onClose();
Copy link
Contributor

Choose a reason for hiding this comment

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

🟡 setLogsFeature mutation fires without error handling, silently failing

The setLogsFeature mutation at server-enable-dialog.tsx:38-45 is called in a fire-and-forget manner with no onError or onSuccess callbacks. If the mutation fails (e.g., network error, permission issue), the user receives no feedback and believes Insights was enabled when it wasn't.

Comparison with existing pattern and impact

The existing EnableLoggingOverlay component at client/dashboard/src/components/EnableLoggingOverlay.tsx:16-27 properly handles both success and error states for the same useFeaturesSetMutation:

const { mutate: setLogsFeature, status: mutationStatus } =
  useFeaturesSetMutation({
    onSuccess: () => {
      setMutationError(null);
      onEnabled();
    },
    onError: (err) => {
      const message =
        err instanceof Error ? err.message : "Failed to enable logging";
      setMutationError(message);
    },
  });

In the new code, onConfirm() and onClose() are called immediately after setLogsFeature() at lines 47-48, regardless of whether the mutation succeeds. The dialog closes and the server enable proceeds, but if the logs feature mutation fails, the user has no way to know. They would only discover the issue later when visiting the Logs/Insights page and finding it disabled.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Address Devin review feedback - the enableInsights state was persisting
across dialog open/close cycles. If a user toggled it OFF and cancelled,
reopening would show OFF instead of resetting to the default ON state.

Added useEffect to reset the toggle to true whenever isOpen becomes true.

https://claude.ai/code/session_01XPgEFhNdNSfSV4YQ7qGHDk
The catalog path bypasses ServerEnableDialog since it creates MCP
servers already enabled. Add the Insights toggle to AddServerDialog
and AddServersDialog so users on the catalog path also get prompted
to enable logs on their first server add.

https://claude.ai/code/session_01XPgEFhNdNSfSV4YQ7qGHDk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Spawn a preview environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants