Skip to content

Comments

Add UnboundedConfig for widget proxy#20

Merged
myleshorton merged 2 commits intomainfrom
adam/unbounded-widget-proxy
Feb 23, 2026
Merged

Add UnboundedConfig for widget proxy#20
myleshorton merged 2 commits intomainfrom
adam/unbounded-widget-proxy

Conversation

@myleshorton
Copy link
Contributor

Summary

  • Adds UnboundedConfig struct with discovery/egress URLs and table sizes
  • Adds Unbounded *UnboundedConfig field to ConfigResponse
  • Adds UNBOUNDED feature flag constant

Part of the unbounded widget proxy feature — allows the API to tell clients when to run as a broflake widget proxy to help censored users.

🤖 Generated with Claude Code

myleshorton and others added 2 commits February 20, 2026 09:49
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>
Adds the UnboundedConfig struct with discovery/egress URLs and table sizes,
an Unbounded pointer field on ConfigResponse, and the UNBOUNDED feature
flag constant. This allows the API to tell clients when to run as a
broflake widget proxy to help censored users.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@myleshorton myleshorton marked this pull request as ready for review February 23, 2026 19:23
@myleshorton myleshorton requested a review from Copilot February 23, 2026 19:23
@myleshorton myleshorton merged commit cc00002 into main Feb 23, 2026
1 check passed
@myleshorton myleshorton deleted the adam/unbounded-widget-proxy branch February 23, 2026 19:24
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

This PR adds configuration support for the unbounded widget proxy feature, which allows the API to tell clients when to run as a "broflake widget proxy" to help censored users. The changes introduce a new configuration struct and feature flag, along with additional fields to the existing configuration types.

Changes:

  • Adds UNBOUNDED feature flag constant for enabling the unbounded widget proxy
  • Adds UnboundedConfig struct with discovery/egress URLs and table size configuration
  • Adds Unbounded field to ConfigResponse to deliver widget proxy configuration to clients
  • Adds BanditURLOverrides field to ConfigResponse for Thompson sampling system
  • Adds Version field to ConfigRequest for client version tracking

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

// server to detect which proxies successfully connected.
BanditURLOverrides map[string]string `json:"bandit_url_overrides,omitempty"`

Unbounded *UnboundedConfig `json:"unbounded,omitempty"`
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

The newly added Unbounded field in ConfigResponse lacks test coverage. The existing tests (TestConfigResponseSerialization) cover serialization of ConfigResponse fields, but don't include the new Unbounded field. Consider adding a test case that includes an UnboundedConfig instance to ensure proper JSON serialization and deserialization of all fields including DiscoverySrv, DiscoveryEndpoint, EgressAddr, EgressEndpoint, CTableSize, and PTableSize.

Copilot uses AI. Check for mistakes.
Comment on lines +84 to +88
// 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 23, 2026

Choose a reason for hiding this comment

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

The BanditURLOverrides field is not mentioned in the PR description. The PR description states it "Adds UnboundedConfig struct" and "Adds Unbounded field to ConfigResponse", but does not mention this bandit-related field. If this field is intentional and part of this PR, please update the PR description to include it. If it was added unintentionally, it should be removed.

Copilot uses AI. Check for mistakes.
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 23, 2026

Choose a reason for hiding this comment

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

The Version field added to ConfigRequest is not mentioned in the PR description. The PR description only mentions additions related to UnboundedConfig. If this field is intentional and part of this PR, please update the PR description to include it. If it was added unintentionally, it should be removed.

Copilot uses AI. Check for mistakes.
Comment on lines +64 to +70
type UnboundedConfig struct {
DiscoverySrv string `json:"discovery_srv,omitempty"`
DiscoveryEndpoint string `json:"discovery_endpoint,omitempty"`
EgressAddr string `json:"egress_addr,omitempty"`
EgressEndpoint string `json:"egress_endpoint,omitempty"`
CTableSize int `json:"ctable_size,omitempty"`
PTableSize int `json:"ptable_size,omitempty"`
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

The UnboundedConfig struct lacks documentation. Following the pattern established in the codebase (e.g., RuleSet at lines 54-62), the struct fields should have inline comments explaining their purpose, especially for fields that may not be self-explanatory like CTableSize and PTableSize. Consider adding comments that explain what "discovery", "egress", and the table sizes represent in the context of the unbounded widget proxy.

Suggested change
type UnboundedConfig struct {
DiscoverySrv string `json:"discovery_srv,omitempty"`
DiscoveryEndpoint string `json:"discovery_endpoint,omitempty"`
EgressAddr string `json:"egress_addr,omitempty"`
EgressEndpoint string `json:"egress_endpoint,omitempty"`
CTableSize int `json:"ctable_size,omitempty"`
PTableSize int `json:"ptable_size,omitempty"`
// UnboundedConfig configures the client-side unbounded widget proxy.
type UnboundedConfig struct {
// DiscoverySrv is the DNS SRV record used to discover unbounded widget proxy
// backends when SRV-based service discovery is enabled.
DiscoverySrv string `json:"discovery_srv,omitempty"`
// DiscoveryEndpoint is the HTTP(S) endpoint used to discover unbounded widget
// proxy backends when not relying on SRV records.
DiscoveryEndpoint string `json:"discovery_endpoint,omitempty"`
// EgressAddr is the local or remote address that the unbounded widget proxy
// should use for sending egress traffic (for example, a bound IP/port).
EgressAddr string `json:"egress_addr,omitempty"`
// EgressEndpoint is the HTTP(S) endpoint through which the unbounded widget
// proxy sends its egress traffic once a backend has been selected.
EgressEndpoint string `json:"egress_endpoint,omitempty"`
// CTableSize controls the size of the connection table used by the unbounded
// widget proxy to track active or recently active connections.
CTableSize int `json:"ctable_size,omitempty"`
// PTableSize controls the size of the path/table used by the unbounded widget
// proxy to maintain per-path or per-peer state.
PTableSize int `json:"ptable_size,omitempty"`

Copilot uses AI. Check for mistakes.
}

type UnboundedConfig struct {
DiscoverySrv string `json:"discovery_srv,omitempty"`
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

The field name DiscoverySrv uses the abbreviation "Srv" which is inconsistent with the rest of the codebase. Other fields use full words rather than abbreviations (e.g., ServerLocation, Servers, StunServers in config/types.pb.go). Consider renaming this to DiscoveryServer for consistency, unless "Srv" has a specific technical meaning in the unbounded widget proxy context.

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