Skip to content

修复 plg 热重载并新增源配置命令#213

Open
q3cc wants to merge 3 commits into
ToolDelta-Basic:mainfrom
q3cc:codex/fix-plg-command-after-reload
Open

修复 plg 热重载并新增源配置命令#213
q3cc wants to merge 3 commits into
ToolDelta-Basic:mainfrom
q3cc:codex/fix-plg-command-after-reload

Conversation

@q3cc

@q3cc q3cc commented Jul 16, 2026

Copy link
Copy Markdown

问题

执行 reload 或 deepreload 后,控制台命令表会被重置,但内置扩展注册的 plg 命令不会恢复。同时,插件市场源和全局 GitHub 镜像只能通过配置文件修改,缺少快捷的控制台配置方式。

修改

  • 为内置扩展增加控制台命令恢复钩子
  • 重载后恢复 plg add 及 plg config 命令,避免重复激活其他扩展监听器
  • 新增 plg config set、unset、list 三条子命令
  • 支持 plugin_market 和 github_mirror 两个配置键
  • 配置持久化成功后立即应用,并保留基本配置中的其他字段
  • 插件市场换源时清理已有缓存,空配置自动回退到官方源
  • 校验参数数量及 HTTP/HTTPS URL,非法输入不会修改配置

命令

  • plg config set <plugin_market|github_mirror>
  • plg config unset <plugin_market|github_mirror>
  • plg config list

验证

  • Python 编译检查通过
  • Ruff 检查通过,本次差异未新增静态分析问题
  • set、unset、list、URL 校验、写入失败保护及配置字段保留测试通过
  • 普通重载和深重载后的命令生命周期测试通过

@deepsource-io

deepsource-io Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

DeepSource Code Review

We reviewed changes in f182114...ab65cf7 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Python Jul 17, 2026 2:50a.m. Review ↗
Shell Jul 17, 2026 2:50a.m. Review ↗
Docker Jul 17, 2026 2:50a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@q3cc q3cc changed the title 修复热重载后 plg 命令失效的问题 修复 plg 热重载并新增源配置命令 Jul 17, 2026
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