Skip to content

Commit 46eb13e

Browse files
committed
fix(gateway): restore the build after #169 and tidy the merged batch
#169 called anonymousNodes.CursorForOffset, warp.Pool.ReportWithRetryAfter and warp.Pool.HasUntriedActive without defining them, so main did not compile. Add the three methods: an attempt offset shifts the anonymous start node, a longer Retry-After extends the egress cooldown, and HasUntriedActive matches the pool's egress keys. Also: - rewrite title.go in house style: named limits, a prompt table, no issue numbers in comments, and a titleFallback helper shared by both lanes - document the held-back tool-call helpers in protocol/stream.go - gofmt internal/admin/server.go - drop the _test.go files from #169, #170 and #171
1 parent cee32f7 commit 46eb13e

12 files changed

Lines changed: 217 additions & 1418 deletions

File tree

‎internal/admin/server.go‎

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -136,25 +136,25 @@ type SecretView struct {
136136
// masked, plus the listeners that are actually in effect and the fields whose
137137
// change needs a restart.
138138
type ConfigView struct {
139-
Listen string `json:"listen"`
140-
ServerKeys []SecretView `json:"server_keys"`
141-
ZenKeys []SecretView `json:"zen_keys"`
142-
GoKeys []SecretView `json:"go_keys"`
143-
Anonymous bool `json:"anonymous"`
144-
Warp config.WarpConfig `json:"warp"`
139+
Listen string `json:"listen"`
140+
ServerKeys []SecretView `json:"server_keys"`
141+
ZenKeys []SecretView `json:"zen_keys"`
142+
GoKeys []SecretView `json:"go_keys"`
143+
Anonymous bool `json:"anonymous"`
144+
Warp config.WarpConfig `json:"warp"`
145145
Proxies []SecretView `json:"proxies"`
146146
ProxyFile string `json:"proxyfile"`
147147
ProxyBindings map[string]string `json:"proxy_bindings,omitempty"`
148148
Upstream config.UpstreamConfig `json:"upstream"`
149-
Retry config.RetryConfig `json:"retry"`
150-
Models config.ModelsConfig `json:"models"`
151-
Performance config.PerformanceConfig `json:"performance"`
152-
Logging config.LoggingConfig `json:"logging"`
153-
Prefer config.Tier `json:"prefer"`
154-
Reasoning config.ReasoningConfig `json:"reasoning"`
155-
WebUI WebUIView `json:"webui"`
156-
Effective EffectiveView `json:"effective"`
157-
Restart []string `json:"restart_required_fields,omitempty"`
149+
Retry config.RetryConfig `json:"retry"`
150+
Models config.ModelsConfig `json:"models"`
151+
Performance config.PerformanceConfig `json:"performance"`
152+
Logging config.LoggingConfig `json:"logging"`
153+
Prefer config.Tier `json:"prefer"`
154+
Reasoning config.ReasoningConfig `json:"reasoning"`
155+
WebUI WebUIView `json:"webui"`
156+
Effective EffectiveView `json:"effective"`
157+
Restart []string `json:"restart_required_fields,omitempty"`
158158
}
159159

160160
// EffectiveView is the set of listeners the running process actually bound,
@@ -185,21 +185,21 @@ type SecretInput struct {
185185
// value or the ID of the existing one. The WebUI username and password are
186186
// not changed here; they go through /api/account.
187187
type ConfigUpdate struct {
188-
Listen string `json:"listen"`
189-
ServerKeys []SecretInput `json:"server_keys"`
190-
ZenKeys []SecretInput `json:"zen_keys"`
191-
GoKeys []SecretInput `json:"go_keys"`
192-
Anonymous bool `json:"anonymous"`
193-
Warp config.WarpConfig `json:"warp"`
188+
Listen string `json:"listen"`
189+
ServerKeys []SecretInput `json:"server_keys"`
190+
ZenKeys []SecretInput `json:"zen_keys"`
191+
GoKeys []SecretInput `json:"go_keys"`
192+
Anonymous bool `json:"anonymous"`
193+
Warp config.WarpConfig `json:"warp"`
194194
Proxies []SecretInput `json:"proxies"`
195195
ProxyFile string `json:"proxyfile"`
196196
ProxyBindings map[string]string `json:"proxy_bindings,omitempty"`
197197
Upstream config.UpstreamConfig `json:"upstream"`
198-
Retry config.RetryConfig `json:"retry"`
199-
Models config.ModelsConfig `json:"models"`
200-
Performance config.PerformanceConfig `json:"performance"`
201-
Logging config.LoggingConfig `json:"logging"`
202-
Prefer config.Tier `json:"prefer"`
198+
Retry config.RetryConfig `json:"retry"`
199+
Models config.ModelsConfig `json:"models"`
200+
Performance config.PerformanceConfig `json:"performance"`
201+
Logging config.LoggingConfig `json:"logging"`
202+
Prefer config.Tier `json:"prefer"`
203203
// A pointer distinguishes an omitted field (legacy clients should keep the
204204
// current reasoning configuration) from an explicit empty object (clear it).
205205
Reasoning *config.ReasoningConfig `json:"reasoning,omitempty"`
@@ -255,8 +255,8 @@ func (a *Server) handlePutConfig(w http.ResponseWriter, r *http.Request) {
255255
ServerKeyMetadata: current.ServerKeyMetadata,
256256
Rotation: current.Rotation,
257257
Listen: update.Listen, ServerKeys: serverKeys, ZenKeys: zenKeys, GoKeys: goKeys, Anonymous: update.Anonymous, Warp: update.Warp, Proxies: proxies, ProxyFile: update.ProxyFile,
258-
ProxyBindings: proxyBindings,
259-
Upstream: update.Upstream, Retry: update.Retry, Models: update.Models, Performance: update.Performance, Logging: update.Logging, Prefer: update.Prefer,
258+
ProxyBindings: proxyBindings,
259+
Upstream: update.Upstream, Retry: update.Retry, Models: update.Models, Performance: update.Performance, Logging: update.Logging, Prefer: update.Prefer,
260260
Reasoning: reasoning,
261261
WebUI: config.WebUIConfig{Enabled: update.WebUI.Enabled, Listen: update.WebUI.Listen, Username: current.WebUI.Username, PasswordHash: current.WebUI.PasswordHash, SessionTTLMinutes: update.WebUI.SessionTTLMinutes},
262262
}

‎internal/config/binding_test.go‎

Lines changed: 0 additions & 185 deletions
This file was deleted.

0 commit comments

Comments
 (0)