fix(transport): align WebSocket read limits with agent protocol

This commit is contained in:
cabbage committed 2026-11-09 07:53:18 +00:00
1 parent ef6e65e6f1
commit 6984a09486
11 files changed
+376 -4

No files matched your search

+1 -1
View File
@@ -168,7 +168,7 @@ func run(configPath string) error {
}
agent := &session.AgentServer{
Store: persistence, Registry: registry, Path: configured.Server.AgentPath,
Metrics: health,
Metrics: health, Logf: logger.Printf,
Limits: agentproto.Limits{
MaxEnvelopeBytes: configured.Protocol.MaxAgentEnvelopeBytes,
MaxExecutionSpecBytes: configured.Protocol.MaxExecutionSpecBytes,
+2 -2
View File
@@ -249,7 +249,7 @@ func runClientDaemon(ctx context.Context, configPath string, diagnostics io.Writ
if runErr := agent.Run(ctx, agent.RunnerOptions{
Store: state,
Dial: func(dialContext context.Context) (agent.Transport, error) {
return agent.DialWebSocket(dialContext, configured.Client.ServerURL, httpClient)
return agent.DialWebSocketWithLimits(dialContext, configured.Client.ServerURL, httpClient, limits)
},
Hello: hello, Limits: limits,
Backoff: agent.BackoffOptions{Initial: configured.Network.ReconnectInitial, Maximum: configured.Network.ReconnectMax, StableReset: configured.Network.StableSessionReset},
@@ -389,7 +389,7 @@ func clientHello(configured *config.Client, instance domain.UUID) *rvboxv1.Clien
}
return &rvboxv1.ClientHello{
ClientId: clientID, SupportedProtocol: &rvboxv1.ProtocolRange{Major: 1, MinMinor: 0, MaxMinor: 0},
DaemonVersion: "v1", Platform: platform, Architecture: runtime.GOARCH, DaemonCwd: configured.Client.DaemonCWD,
DaemonVersion: buildVersion, Platform: platform, Architecture: runtime.GOARCH, DaemonCwd: configured.Client.DaemonCWD,
SupportedShells: shells, ClientInstanceId: instance.String(), MaxRunningCommands: configured.Client.MaxRunningCommands,
MaxQueuedCommands: configured.Client.MaxQueuedCommands, SentAt: timestamppb.New(time.Now().UTC()),
}