Skip to content

fix(react-dogfood): only render VisionAgent button in demo environment#2227

Merged
oliverlaz merged 1 commit intomainfrom
gifted-williams-b54923
May 5, 2026
Merged

fix(react-dogfood): only render VisionAgent button in demo environment#2227
oliverlaz merged 1 commit intomainfrom
gifted-williams-b54923

Conversation

@oliverlaz
Copy link
Copy Markdown
Member

@oliverlaz oliverlaz commented May 5, 2026

💡 Overview

Gates the Ask AI Agent button (and its accompanying AIAgentStatusPanel) in ActiveCall behind isDemoEnvironment, so the Vision Agents flow is only surfaced in the demo environment and no longer appears in pronto or restricted builds.

📝 Implementation notes

  • The useIsDemoEnvironment() hook was already being called in ActiveCall.tsx, so no new imports were needed.
  • Wrapped the entire rd__ai-agent-anchor div (button + panel) rather than just the button, because the status panel is positionally anchored to the button. Outside demo there is no way to invite an agent anyway, so the panel has nothing to surface.

🎫 Ticket: https://linear.app/stream/issue/AI-557/add-a-button-to-invite-an-agent-to-a-demo-call

📑 Docs: n/a (sample app only, no public API change)

Summary by CodeRabbit

  • Bug Fixes
    • AI agent interface now displays conditionally based on deployment environment, appearing only in demo environments to prevent unintended feature exposure across different deployment contexts.

Gates the Ask AI Agent button and its status panel on
isDemoEnvironment so the Vision Agents flow is no longer surfaced
in pronto/restricted builds.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 5, 2026

⚠️ No Changeset found

Latest commit: 89ade16

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6228eccc-3f39-42e1-9841-187ddd6f34ba

📥 Commits

Reviewing files that changed from the base of the PR and between 29de74d and 89ade16.

📒 Files selected for processing (1)
  • sample-apps/react/react-dogfood/components/ActiveCall.tsx

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Walkthrough

The AI agent UI section in ActiveCall.tsx is now conditionally rendered only when isDemoEnvironment is true, replacing unconditional rendering. Existing state handlers and surrounding controls remain unchanged.

Changes

Demo Environment Feature Flag

Layer / File(s) Summary
Conditional Rendering
sample-apps/react/react-dogfood/components/ActiveCall.tsx
AI agent container with AskAIAgentButton and AIAgentStatusPanel is wrapped in {isDemoEnvironment && ...} conditional, rendering only in demo environments.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes


🐰 A demo flag hops into place,
The AI agent shows its face,
Only when the test stage glows,
Production stays pristine as it goes! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gifted-williams-b54923

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@oliverlaz oliverlaz merged commit 1348df1 into main May 5, 2026
11 of 12 checks passed
@oliverlaz oliverlaz deleted the gifted-williams-b54923 branch May 5, 2026 14:57
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.

1 participant