Skip to content

Comments

fix: set Role on agentsdk.Client to skip connection monitoring#168

Merged
kacpersaw merged 1 commit intomainfrom
kacpersaw/set-logstream-role
Feb 20, 2026
Merged

fix: set Role on agentsdk.Client to skip connection monitoring#168
kacpersaw merged 1 commit intomainfrom
kacpersaw/set-logstream-role

Conversation

@kacpersaw
Copy link
Contributor

@kacpersaw kacpersaw commented Feb 13, 2026

Summary

coder-logstream-kube connects to the agent RPC endpoint using the agent token, which triggers connection monitoring in coderd and causes false connectivity state changes (disconnected_at/first_connected_at updates). This leads to VSCode/JetBrains disconnections and incorrect dashboard status.

Changes

  • Check the server version via the /api/v2/buildinfo endpoint to determine capabilities
  • If the server is v2.31.0+ (includes role support from fix(coderd): add role param to agent RPC to prevent false connectivity coder#22052), use ConnectRPC28WithRole("logstream-kube") to skip connection monitoring
  • For older servers, fall back to ConnectRPC20 (no role sent)
  • Update github.com/coder/coder/v2 to include the WithRole API
  • Migrate cdr.dev/slogcdr.dev/slog/v3 (required by updated SDK)
  • Add ReportBoundaryLogs stub to test fake for updated proto interface
  • Bump CI to Go 1.25 and golangci-lint v2.9.0

Backward-compatible: older coderd versions that don't support the role parameter will use ConnectRPC20 as before.

Fixes coder/coder#21625

@kacpersaw kacpersaw force-pushed the kacpersaw/set-logstream-role branch 2 times, most recently from 230bf5f to a784d6c Compare February 18, 2026 14:03
@kacpersaw kacpersaw marked this pull request as ready for review February 19, 2026 13:06
coder-logstream-kube connects to the agent RPC endpoint using the agent
token, which triggers connection monitoring in coderd and causes false
connectivity state changes (disconnected_at/first_connected_at updates).
This leads to VSCode/JetBrains disconnections and incorrect dashboard status.

coder/coder PR #22052 added a role query parameter to the RPC endpoint.
We now check the server version via the buildinfo endpoint: if the server
is v2.31.0 or newer (which includes the role support), we use
ConnectRPC28WithRole("logstream-kube") to skip connection monitoring.
For older servers, we fall back to ConnectRPC20.

Also migrates cdr.dev/slog to cdr.dev/slog/v3 as required by the updated
coder SDK, and adds the ReportBoundaryLogs stub to the test fake.

Fixes coder/coder#21625
@kacpersaw kacpersaw force-pushed the kacpersaw/set-logstream-role branch from a784d6c to 43f81cd Compare February 20, 2026 09:18
@kacpersaw kacpersaw merged commit 96c0e45 into main Feb 20, 2026
6 of 8 checks passed
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.

bug: coder-logstream-kube connections interfere with agent connectivity status

2 participants