Skip to content

refactor: 重构配置系统使用Pydantic Settings#179

Merged
Steinwaysj merged 4 commits intomainfrom
feat/config-system-refactor
Nov 23, 2025
Merged

refactor: 重构配置系统使用Pydantic Settings#179
Steinwaysj merged 4 commits intomainfrom
feat/config-system-refactor

Conversation

@TommrraraSnow
Copy link
Member

Summary

  • 使用pydantic-settings替换传统JSON配置管理,提供类型安全的配置处理
  • 添加完整的配置模型类,支持数据验证和类型检查
  • 支持环境变量覆盖配置,提供ZSIM_前缀的环境变量支持
  • 统一配置路径引用,将CONFIG_PATH重命名为config_path保持一致性

主要改进

  1. 类型安全: 所有配置项都有明确的类型定义和验证
  2. 环境变量支持: 支持通过环境变量覆盖配置文件设置
  3. 更好的错误处理: Pydantic提供详细的配置验证错误信息
  4. 代码质量: 添加完整的类型注解,提升代码可维护性

Test plan

  • 验证配置文件正确加载
  • 测试环境变量覆盖功能
  • 运行现有功能确保无回归问题
  • 检查WebUI配置界面正常工作

🤖 Generated with Claude Code

- 使用pydantic-settings替换传统JSON配置管理
- 添加类型安全的配置模型类
- 支持环境变量和配置文件的双重重载
- 改进配置文件的初始化和验证逻辑
- 添加详细的类型注解提升代码质量
- 统一配置路径引用(config_path vs CONFIG_PATH)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link

🤖 Hi @TommrraraSnow, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Steinwaysj Steinwaysj merged commit 581631b into main Nov 23, 2025
4 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