Skip to content

fix(service): check trial app feature flag before fetching info#33555

Open
BillionClaw wants to merge 1 commit intolanggenius:mainfrom
BillionClaw:clawoss/fix/explore-detail-modal-403-trial-disabled
Open

fix(service): check trial app feature flag before fetching info#33555
BillionClaw wants to merge 1 commit intolanggenius:mainfrom
BillionClaw:clawoss/fix/explore-detail-modal-403-trial-disabled

Conversation

@BillionClaw
Copy link
Copy Markdown

Fixes #33549

The Explore Detail modal was returning 403 when trial apps are disabled because useGetTryAppInfo unconditionally called the trial app endpoint whenever appId was truthy.

When ENABLE_TRIAL_APP=false, the backend trial_feature_enable decorator returns 403 "Trial app feature is not enabled." This caused the Explore Detail modal to fail loading in self-hosted environments.

Add systemFeatures.enable_trial_app check to the enabled option so the query only runs when the feature is enabled. This follows the same pattern used elsewhere in the codebase for conditional trial app features.

Changes

  • Modified web/service/use-try-app.ts to check systemFeatures.enable_trial_app before enabling the query

Verification

  • Type-check passes
  • All related tests pass (17 tests in try-app, 33 tests in embedded-chatbot)

The useGetTryAppInfo hook was unconditionally calling the trial app
endpoint whenever appId was truthy. When ENABLE_TRIAL_APP is false,
the backend returns 403, causing the Explore Detail modal to fail.

Add systemFeatures.enable_trial_app check to the enabled option so
the query only runs when the feature is enabled.

Fixes langgenius#33549
@BillionClaw BillionClaw requested a review from iamjoel as a code owner March 17, 2026 02:07
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 17, 2026
@github-actions github-actions bot added the web This relates to changes on the web. label Mar 17, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where the application attempted to fetch trial app information even when the trial app feature was disabled, leading to a 403 error in the Explore Detail modal. By integrating a system-level feature flag check into the data fetching logic, the application now intelligently prevents unnecessary API calls, ensuring a smoother user experience and preventing errors in environments where trial features are not active.

Highlights

  • Conditional Data Fetching: Introduced a conditional check for the enable_trial_app feature flag before fetching trial application information.
  • Error Resolution: Resolved a 403 error in the Explore Detail modal that occurred when trial apps were disabled in self-hosted environments.
  • Feature Flag Alignment: Ensured the useGetTryAppInfo query only runs when the trial app feature is enabled, aligning with existing patterns for conditional feature usage.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • web/service/use-try-app.ts
    • Imported useGlobalPublicStore to access system feature flags.
    • Modified the enabled option of the useQuery hook to include a check for systemFeatures.enable_trial_app.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly addresses a bug where an API for trial apps was called even when the feature was disabled, leading to an error. The fix involves adding a feature flag check within the useGetTryAppInfo hook. My review includes a suggestion to apply this same fix to other related hooks in the same file for consistency and to prevent similar issues.

return fetchTryAppInfo(appId)
},
enabled: !!appId,
enabled: !!appId && systemFeatures.enable_trial_app,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This conditional logic correctly prevents the query from running when trial apps are disabled. It appears that other hooks in this file (useGetTryAppParams, useGetTryAppDataSets, useGetTryAppFlowPreview) also interact with trial app endpoints but lack this check. To ensure consistency and prevent potential 403 errors, it would be beneficial to apply the same logic to them.

@lgx0319
Copy link
Copy Markdown

lgx0319 commented Apr 15, 2026

Friendly bump -- this PR has been open for a while. Happy to make any changes if needed, or close it if no longer relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explore Detail modal returns 403 when trial apps are disabled

2 participants