Skip to content

fix: 修复 失败后不重试 配置项写到内存被覆盖 - #4142

Merged
Calcium-Ion merged 2 commits into
QuantumNous:mainfrom
seefs001:fix/skip_failure_option
Apr 8, 2026
Merged

fix: 修复 失败后不重试 配置项写到内存被覆盖#4142
Calcium-Ion merged 2 commits into
QuantumNous:mainfrom
seefs001:fix/skip_failure_option

Conversation

@seefs001

@seefs001 seefs001 commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Chores
    • Refactored channel affinity settings handling to improve code maintainability and consistency.
    • Updated serialization behavior for channel affinity rule configuration to ensure consistent data representation in API responses.

@coderabbitai

coderabbitai Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bea1827d-b56f-4b86-ab0c-33c6986b040b

📥 Commits

Reviewing files that changed from the base of the PR and between a057edd and c3b8fa2.

📒 Files selected for processing (2)
  • setting/operation_setting/channel_affinity_setting.go
  • web/src/pages/Setting/Operation/SettingsChannelAffinity.jsx

Walkthrough

Modified JSON serialization behavior for the SkipRetryOnFailure field by removing the omitempty tag, ensuring it always appears in serialized output. Concurrently, refactored frontend payload construction into a dedicated helper function to centralize rule data transformation logic.

Changes

Cohort / File(s) Summary
Backend JSON Serialization
setting/operation_setting/channel_affinity_setting.go
Removed omitempty from SkipRetryOnFailure JSON tag, changing the field to always serialize even when false.
Frontend Payload Refactoring
web/src/pages/Setting/Operation/SettingsChannelAffinity.jsx
Extracted channel affinity rule payload construction into buildChannelAffinityRulePayload(...) helper function; refactored handleModalSave to use the helper, including updated id source handling and simplified template logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A helper function hops into view,
Consolidating payload work, clean and true,
JSON tags now always show the way,
No more silent falses to betray!
Refactored and serialized, hooray, hooray! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is written in Chinese and describes fixing a configuration issue related to 'skip retry on failure' being overwritten in memory, which directly aligns with the main change: removing 'omitempty' from the SkipRetryOnFailure JSON tag to ensure the field is always serialized.

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

@Calcium-Ion
Calcium-Ion merged commit 9b4ffb0 into QuantumNous:main Apr 8, 2026
1 check passed
Jinxuans referenced this pull request in TokFlux-Org/TokFlux May 9, 2026
fix: 修复 失败后不重试 配置项写到内存被覆盖
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.

Codex/Claude 的 stale channel affinity 指向失效渠道时会阻断正常 fallback

2 participants