feat: add custom AI Studio app URL configuration - #267
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The critical logging issue must be fixed, and the environment-file documentation should be clarified.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds configurable custom AI Studio App URLs with validation, fallback behavior, startup logging, and bilingual documentation.
Changes:
- Adds
AI_STUDIO_APP_URLconfiguration and validation. - Uses the configured URL in
BrowserManager. - Updates environment examples, READMEs, and setup guides.
File summaries
| File | Summary |
|---|---|
src/utils/ConfigLoader.js |
Critical (1 vote): rejected environment values may expose credentials or inject log lines; log only a generic or sanitized validation failure. |
src/core/BrowserManager.js |
Uses the configured AI Studio App URL for navigation. |
README.md |
Documents the custom URL configuration in Chinese. |
README_EN.md |
Documents the custom URL configuration in English. |
docs/zh/create-ai-studio-app.md |
Nit (1 vote): document both .env and .env.development for development usage and restart instructions. |
docs/en/create-ai-studio-app.md |
Nit (1 vote): document both .env and .env.development for development usage and restart instructions. |
.env.example |
Adds the AI_STUDIO_APP_URL example configuration. |
Review details
Suppressed comments (2)
docs/en/create-ai-studio-app.md:65
- This guide only tells users to write
.env, butmain.jsloads.env.developmentfor non-production runs (including the documentednpm run devpath). Following this guide in development therefore leavesAI_STUDIO_APP_URLunset and silently uses the built-in app; document both environment files here and in the restart instruction.
Add the complete link to the `.env` file in the project root:
```env
AI_STUDIO_APP_URL=https://ai.studio/apps/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
docs/zh/create-ai-studio-app.md:65
- 本教程只要求写入
.env,但main.js在非生产环境(包括文档中的npm run dev)会读取.env.development。用户按此步骤在开发环境配置时,AI_STUDIO_APP_URL会被忽略并静默使用内置应用;这里以及后面的重启说明应同时写明两个环境文件。
将完整链接写入项目根目录的 `.env`:
```env
AI_STUDIO_APP_URL=https://ai.studio/apps/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- Files reviewed: 7/12 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+83
to
+84
| `[Config] Invalid AI_STUDIO_APP_URL "${process.env.AI_STUDIO_APP_URL}". ` + | ||
| `Expected https://ai.studio/apps/<app-id>; using the default app.` |
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.
This pull request introduces support for configuring a custom AI Studio App URL, allowing users to specify their own app instead of the built-in default. It adds environment variable and documentation support for this feature, validates the provided URL, and updates the startup log to display the active app URL. Additionally, new guides (in both English and Chinese) are included to help users create and configure their own AI Studio App.
此拉取请求引入了对配置自定义 AI Studio 应用 URL 的支持,允许用户指定自己的应用,而非使用内置的默认应用。该功能增加了对环境变量和文档的支持,验证了所提供的 URL,并更新了启动日志以显示当前生效的应用 URL。此外,还包含了新的指南(中英文版本),旨在帮助用户创建并配置其专属的 AI Studio 应用。