Conversation
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>
There was a problem hiding this comment.
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]stringtoConfigResponse(JSONbandit_url_overrides,omitempty). - Add
Version stringtoConfigRequest(JSONversion,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"` |
There was a problem hiding this comment.
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".
| Version string `json:"version,omitempty"` | |
| // AppVersion is the version of the Lantern client application making this request. | |
| AppVersion string `json:"app_version,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"` |
There was a problem hiding this comment.
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).
| Locale string `json:"locale,omitempty"` | ||
| Protocols []string `json:"protocols,omitempty"` | ||
| MetricsOptedIn bool `json:"metrics_opted_in,omitempty"` | ||
| Version string `json:"version,omitempty"` |
There was a problem hiding this comment.
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.
Summary
BanditURLOverrides map[string]stringfield toConfigResponseintypes.goTest plan
omitempty)🤖 Generated with Claude Code