Skip to content

fix(core): 调整代理配置项显隐与默认地址#829

Merged
dingyi222666 merged 2 commits intoChatLunaLab:v1-devfrom
CookSleep:fix/proxy-address-visibility
Apr 14, 2026
Merged

fix(core): 调整代理配置项显隐与默认地址#829
dingyi222666 merged 2 commits intoChatLunaLab:v1-devfrom
CookSleep:fix/proxy-address-visibility

Conversation

@CookSleep
Copy link
Copy Markdown
Member

Summary

  • 调整 ChatLuna 主插件与子插件的代理配置 schema,让 proxyAddress 仅在启用对应代理开关后显示,并直接跟在触发项下方。
  • 将主插件和子插件的自定义代理默认地址统一为 http://127.0.0.1:7897
  • 统一中英文 schema 文案,将“遵循全局代理设置”明确为“遵循 ChatLuna 主插件的全局代理设置”。

Verification

  • yarn fast-build core(仓库当前会额外打印 yakumo-mocha / mocha 缺失警告,但 core 构建产物已正常生成)

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 14, 2026

Warning

Rate limit exceeded

@CookSleep has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 38 minutes and 55 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 77ec8371-41f3-447b-99e2-43139e5194cf

📥 Commits

Reviewing files that changed from the base of the PR and between d71d1c5 and 01734ed.

⛔ Files ignored due to path filters (2)
  • packages/core/src/locales/en-US.schema.yml is excluded by !**/*.yml
  • packages/core/src/locales/zh-CN.schema.yml is excluded by !**/*.yml
📒 Files selected for processing (1)
  • packages/core/src/config.ts

概览

重构代理相关配置架构,调整了 isProxy 的处理方式并更新默认值。将 isProxy 从独立的 Schema 对象移至 Schema.intersect 中,同时将 proxyAddress 的默认值从空字符串改为 http://127.0.0.1:7897

变更

内聚块 / 文件(s) 摘要
代理配置架构重构
packages/core/src/config.ts
使用 Schema.intersect 重组代理配置,调整 isProxy 处理逻辑,将 proxyAddress 默认值从空字符串更新为 http://127.0.0.1:7897
Chat 插件配置默认值更新
packages/core/src/services/chat.ts
更新 ChatLunaPlugin.Config 中 proxyMode'on' 时的 proxyAddress 默认值,改为 http://127.0.0.1:7897

预估代码审查工作量

🎯 2 (Simple) | ⏱️ ~8 分钟

可能相关的 PR

建议审阅者

  • dingyi222666

诗歌

🐰 默认值兔兔来跳跃,
代理地址展新貌,
架构调整细致妙,
从空字符串到网址巧,
配置重组路更好!✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed 标题准确概括了主要变更:调整代理配置项的显隐逻辑和更新默认地址,与代码改动相符。
Description check ✅ Passed 描述详细说明了三个方面的改动:代理配置schema调整、默认地址统一、以及文案统一,与实际代码变更相符。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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 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.

Comment thread packages/core/src/locales/zh-CN.schema.yml Outdated
Comment thread packages/core/src/locales/en-US.schema.yml Outdated
Comment thread packages/core/src/locales/zh-CN.schema.plugin.yml
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between fe99839 and d71d1c5.

⛔ Files ignored due to path filters (4)
  • packages/core/src/locales/en-US.schema.plugin.yml is excluded by !**/*.yml
  • packages/core/src/locales/en-US.schema.yml is excluded by !**/*.yml
  • packages/core/src/locales/zh-CN.schema.plugin.yml is excluded by !**/*.yml
  • packages/core/src/locales/zh-CN.schema.yml is excluded by !**/*.yml
📒 Files selected for processing (2)
  • packages/core/src/config.ts
  • packages/core/src/services/chat.ts

Comment thread packages/core/src/config.ts
@dingyi222666 dingyi222666 merged commit 0cf39bb into ChatLunaLab:v1-dev Apr 14, 2026
4 of 5 checks passed
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.

2 participants