Skip to content

Comments

Add BanditURLOverrides to ConfigResponse#19

Open
myleshorton wants to merge 1 commit intomainfrom
bandit-url-overrides
Open

Add BanditURLOverrides to ConfigResponse#19
myleshorton wants to merge 1 commit intomainfrom
bandit-url-overrides

Conversation

@myleshorton
Copy link
Contributor

Summary

  • Adds BanditURLOverrides map[string]string field to ConfigResponse in types.go
  • Carries per-proxy callback URLs from the server-side bandit assignment system to sing-box clients
  • Part of the per-ISP Thompson sampling proxy assignment feature (see getlantern/lantern-cloud and getlantern/radiance companion PRs)

Test plan

  • Verify existing config serialization/deserialization is unaffected (field is omitempty)
  • Confirm lantern-cloud and radiance build against this branch

🤖 Generated with Claude Code

Add BanditURLOverrides field to ConfigResponse to support per-proxy
callback URLs for the bandit Thompson sampling proxy assignment system.
Also add Version field to ConfigRequest.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds API fields to the common package’s config request/response types to support per-proxy bandit (Thompson sampling) URL-test callback overrides and additional client version reporting.

Changes:

  • Add BanditURLOverrides map[string]string to ConfigResponse (JSON bandit_url_overrides, omitempty).
  • Add Version string to ConfigRequest (JSON version, omitempty).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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 +72 to +76
// 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"`
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.
Comment on lines 89 to +92
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.

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