Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ type ConfigResponse struct {
Options O.Options `json:"options,omitempty"`
SmartRouting SmartRoutingRules `json:"smart_routing,omitempty"`
AdBlock AdBlockRules `json:"ad_block,omitempty"`

// BanditURLOverrides maps outbound tags to per-proxy callback URLs for
// the bandit Thompson sampling system. When set, these override the
// default MutableURLTest URL for each specific outbound, allowing the
// server to detect which proxies successfully connected.
BanditURLOverrides map[string]string `json:"bandit_url_overrides,omitempty"`
Comment on lines +72 to +76
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

There are serialization tests for ConfigResponse/ConfigRequest (see types_test.go), but they don’t exercise the newly added fields. Please extend the existing tests to cover JSON round-tripping for BanditURLOverrides and ConfigRequest.Version, and verify omitempty behavior (field absent when empty/nil).

Copilot uses AI. Check for mistakes.
}

type ConfigRequest struct {
Expand All @@ -83,4 +89,5 @@ type ConfigRequest struct {
Locale string `json:"locale,omitempty"`
Protocols []string `json:"protocols,omitempty"`
MetricsOptedIn bool `json:"metrics_opted_in,omitempty"`
Version string `json:"version,omitempty"`
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

ConfigRequest already has SingboxVersion, so introducing a second, generic Version field is ambiguous for API consumers (is it app version, API schema version, backend version, etc.?). Consider renaming to a more specific name (e.g., AppVersion/ClientVersion/APIVersion) and/or adding a brief comment clarifying its intent so it’s unambiguous when serialized as "version".

Suggested change
Version string `json:"version,omitempty"`
// AppVersion is the version of the Lantern client application making this request.
AppVersion string `json:"app_version,omitempty"`

Copilot uses AI. Check for mistakes.
Comment on lines 89 to +92
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The PR description only mentions adding BanditURLOverrides to ConfigResponse, but this diff also adds Version to ConfigRequest. If Version is intentional, please update the PR description (and any companion PR references) to reflect this additional API surface change; otherwise, consider dropping it from this PR to keep scope aligned.

Copilot uses AI. Check for mistakes.
}