feat: add Smart sticky sessions#10
Open
eyaeya wants to merge 1 commit into
Open
Conversation
This was referenced Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dependency chain
This PR is part of a three-PR change set for Smart
strategy: sticky-sessionssupport:This non-OIX core PR does not depend on the OpenClash PR to build or test. It is, however, a required core-side dependency for OpenClash users who select a non-OIX Smart-capable core and enable Smart sticky sessions. vernesong/OpenClash#5198 should only be considered functionally complete for non-OIX users after this PR, or an equivalent non-OIX core implementation, is merged and released.
The OIX core PR vernesong/mihomo-oix#6 should stay behaviorally aligned with this PR so OpenClash exposes one consistent Smart strategy option across OIX and non-OIX cores.
Recommended merge/release order:
strategy: sticky-sessions.Summary
Add explicit
strategy: sticky-sessionssupport for Smart proxy groups.This keeps the non-OIX Smart implementation aligned with the OIX core patch. OpenClash can only expose and generate YAML after the core accepts and enforces the option.
Root cause
Investigation showed Smart groups can route the same service/domain through multiple nodes. This also happens on non-OIX Smart cores, which indicates the issue is Smart group semantics rather than an OIX-specific TLS failure. In current core code,
strategyis parsed forload-balanceonly; Smart does not acceptstrategyand instead relies on SmartTarget/ASN/cache/weight selection.Design
Strategy stringtoSmartOption.sticky-sessions; reject unsupported Smart strategies.sticky-sessions.SmartTargetlabels.Validation
go test ./adapter/outboundgroup -run 'TestNewSmartRejectsUnsupportedStrategy|TestNewSmartKeepsEmptyStrategyNonSticky|TestSmartSticky' -count=1go test ./adapter/outboundgroup ./component/smart/... -count=1