fix(core): 调整代理配置项显隐与默认地址#829
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 38 minutes and 55 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (1)
概览重构代理相关配置架构,调整了 变更
预估代码审查工作量🎯 2 (Simple) | ⏱️ ~8 分钟 可能相关的 PR
建议审阅者
诗歌
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the proxy configuration schema and localization files, notably introducing a default proxy address of http://127.0.0.1:7897. Feedback focuses on aligning the localization descriptions with this change, as the existing 'if empty' fallback documentation is now potentially misleading given the new default value. Suggestions were also made to include example proxy formats in the Chinese localization to maintain consistency with the English version.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/core/src/config.ts`:
- Around line 178-188: The Config interface's proxyAddress should be optional to
match the schema: change the Config declaration for proxyAddress from a required
string to proxyAddress?: string. Then update locations in
packages/core/src/services/chat.ts where this.config.proxyAddress is used
(references in the Chat service methods that read this.config.proxyAddress) to
handle undefined safely—either guard before use, provide a sensible default
(e.g., the schema default 'http://127.0.0.1:7897'), or throw a clear error—so no
undefined is passed to functions expecting a string.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e319a86e-ad38-4ce2-a11a-9abe1dacc237
⛔ Files ignored due to path filters (4)
packages/core/src/locales/en-US.schema.plugin.ymlis excluded by!**/*.ymlpackages/core/src/locales/en-US.schema.ymlis excluded by!**/*.ymlpackages/core/src/locales/zh-CN.schema.plugin.ymlis excluded by!**/*.ymlpackages/core/src/locales/zh-CN.schema.ymlis excluded by!**/*.yml
📒 Files selected for processing (2)
packages/core/src/config.tspackages/core/src/services/chat.ts
Summary
proxyAddress仅在启用对应代理开关后显示,并直接跟在触发项下方。http://127.0.0.1:7897。Verification
yarn fast-build core(仓库当前会额外打印yakumo-mocha/mocha缺失警告,但core构建产物已正常生成)