Skip to content

fix: preserve unmanaged zero model ratios - #5

Merged
3metaJun merged 1 commit into
metaproxy/v1.0.0-rc.21from
fix/provision-legacy-zero-ratios
Aug 28, 2026
Merged

fix: preserve unmanaged zero model ratios#5
3metaJun merged 1 commit into
metaproxy/v1.0.0-rc.21from
fix/provision-legacy-zero-ratios

Conversation

@3metaJun

Copy link
Copy Markdown
Owner

⚠️ 提交说明 / PR Notice

Important

This change was AI-assisted and manually verified against the production failure captured by the deployment gate.

📑 变更描述 / Description

The atomic provision endpoint rejected a complete merged ModelRatio map whenever an unrelated legacy model had ratio 0. That blocked configuration releases even though the zero-valued model was not exposed by any managed channel.

Allow zero only for ratios outside enabled channels in offered groups. Managed, user-visible models still require a strictly positive ratio; negative, NaN, and infinite values remain rejected.

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix)
  • ✨ 新功能 (New feature)
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📑 文档更新 (Documentation)

🔆 关联任务 / Related Issue

✅ 提交前检查项 / Checklist

  • 人工确认: The description and diff were manually reviewed.
  • 非重复提交: No equivalent fork PR exists.
  • Bug fix 说明: This fixes a reproduced production compatibility failure.
  • 变更理解: The validation boundary and impact are understood.
  • 范围聚焦: Only the atomic provision validator and regression tests changed.
  • 本地验证: Targeted controller and model tests pass.
  • 安全合规: No credentials or sensitive data are included.

📳 运行证明 / Proof of Work

  • Regression test failed before the implementation and passes afterward.
  • go test ./controller -run TestValidateMetaproxyProvisionRequest -count=1 — pass.
  • go test ./model -run TestApplyMetaproxyProvision -count=1 — pass.
  • git diff --check — pass.
  • go test ./... reaches all packages, but the repository-wide command is not green in this checkout because the committed tree lacks web/classic/dist and an unrelated existing service mixed-mode cache test expected 2 but observed 3.

@3metaJun
3metaJun merged commit fe40649 into metaproxy/v1.0.0-rc.21 Aug 28, 2026
1 check passed
@3metaJun
3metaJun deleted the fix/provision-legacy-zero-ratios branch August 28, 2026 03:35
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