Repository navigation
RSDK-14617 surface the machine's active WiFi SSID in agent logs - #298
Merged
Merged
Conversation
backgroundLoop already refreshes activeSSID every ~15s via checkConnections, but the value was never surfaced. Log it on every change and at least every 5 minutes otherwise, through the existing viam-agent.networking sublogger so it stays with the rest of the diagnostic networking logs.
10zingpd
requested review from
a team and
Cheuk (cheukt)
and removed request for
a team
September 23, 2026 20:36
Dev release artifactsBuilt from
Remove the |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cheuk (cheukt)
approved these changes
Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Surfaces the machine's active WiFi SSID in the agent logs: logged immediately when it changes, and at least every 5 minutes otherwise.
Why
viam-agentalready tracks the active SSID live —backgroundLoopcallscheckConnections()every ~15s and updatesactiveSSID— but the value was never written to the logs, so there was no way to reconstruct which network a machine was on from its log history.How
Subsystem.logActiveSSID()readsnetState.ActiveSSID()for the managed wifi interface (HotspotInterface, the only device the agent actively manages) and logsactiveSSID+interface. It skips the log only when the SSID is unchanged and the last log was less thanactiveSSIDLogInterval(5 minutes) ago, so changes are reported on the next background tick and steady state is reported every 5 minutes.backgroundLoopright aftercheckConnections(), so it observes the freshly refreshed state. The two tracking fields are written exclusively from that goroutine, matching the existingbleLoopfield convention, so no extra locking is needed.n.logger, which is already theviam-agent.networkingsublogger, so these lines stay hidden unless internal logs are toggled on.activeSSIDis logged as-is and means the managed wifi interface isn't connected to anything.Example line:
Testing
TestLogActiveSSIDcovering the initial (disconnected) log, silence while unchanged, immediate log on change, that other interfaces are ignored, re-logging once the interval elapses, and logging a disconnect.go test -race ./...passes. The only failure is the pre-existingutils.TestInitPaths/failure_cannot_create_directory, which fails in this sandbox because it runs as root and so thechmod 0500the test relies on doesn't blockmkdir; it is unrelated to this change.Key: RSDK-14617
Co-authored by Claude agent for Jira.