Conversation
|
用ai用魔怔了? |
@Pluviophile714 |
2026-07-02 最新核验结论:暂不关闭。当前 upstream 只已有 load-balance 侧的 strategy 选项;尚未覆盖 Smart 核验基准:OpenClash dev = c460dcf(0.47.113,2026-07-01 05:54 +0800);OIX Alpha/Pre-Alpha = 2b1742db8a2e38dc49329133a11576804b468a6b。mihomo-oix 当前没有 GitHub Release 对象。 证据:
收益差异:upstream 当前收益是保留已有 load-balance strategy 和 Smart 基础开关;本 PR 额外把 Smart 组的 因此本 PR 仍有独立收益,保留开放,并继续依赖 OIX #6 / 非 OIX core 等价实现。 |
2026-07-04 Code Review 修复说明本轮重新基于当前
修复内容:
验证:
|
2026-07-08 最新核验与范围更新结论:不关闭。本 PR 的 Smart sticky-sessions 目标只被最新 核验结果:
执行计划与本次更新:
已推送:
验证: bash tests/openclash_smart_strategy_test.sh
bash -n luci-app-openclash/root/usr/share/openclash/*.sh
bash -n tests/*.sh
sh -n luci-app-openclash/root/etc/init.d/openclash
git diff --check
rg -n '^(<<<<<<<|=======|>>>>>>>)'以上均已通过。另做了一轮只读复核,确认最终 diff 未重新引入 upstream 已覆盖的 |
10715a4 to
d8751c4
Compare
c70c2af to
8f1b8a2
Compare
Dependency chain
This PR is part of a three-PR change set for Smart
strategy: sticky-sessionssupport:This OpenClash PR depends on compatible core support. It only exposes and writes
strategy: sticky-sessions; the actual affinity behavior must be implemented by the selected core.Compatibility dependency by selected core:
Recommended merge/release order:
strategy: sticky-sessions.On older cores, generated YAML containing Smart
strategymay fail config parsing. That is why this PR keeps the option opt-in, leaves defaults unchanged, and includes LuCI wording that calls out the core dependency.Summary
Expose Smart
strategy: sticky-sessionsin OpenClash without changing existing defaults.This PR only wires configuration and LuCI. The actual sticky behavior must be provided by a compatible Smart-capable core.
Root cause
Router-side investigation found that OpenClash had partial Smart strategy plumbing but no working end-to-end path:
yml_groups_get.shcould import a Smart YAMLstrategyinto UCI asstrategy_smart.yml_groups_set.shdid not read or writestrategy_smart, so exporting/regenerating YAML dropped it.strategyonly forload-balance, not Smart.url-test/load-balancegroups tosmartand added LightGBM/collect/prefer-ASN fields, but never wrote a Smart strategy.strategy, so OpenClash must not present this as an OpenClash-only fix.Design
strategy_smartLuCI option for Smart groups.sticky-sessionsfor Smart groups; do not offerround-robinorconsistent-hashingbecause those remain load-balance strategies.strategy_smartinyml_groups_set.shand writestrategy: sticky-sessionsonly when explicitly set.smart_strategy, defaulting to0, for Smart auto-switch/overwrite flows.smart_strategyintoyml_rules_change.shand only writegroup['strategy'] = 'sticky-sessions'when the user explicitly selects it.strategyunless explicitly configured.smart_strategyto groups newly converted by Smart auto-switch; existing Smart groups continue to use their per-groupstrategy_smartsetting.Validation
bash -n luci-app-openclash/root/usr/share/openclash/*.sh luci-app-openclash/root/etc/init.d/openclash tests/openclash_smart_strategy_test.shtests/openclash_smart_strategy_test.shgit diff --check HEAD^ HEAD