Go Desktop Agent Part 1: Architecture and Problem Space

In this first part of our Go Desktop Agent series, we’ll explore the architectural decisions and the real-world problems this agent solves.

The Problem: Reaching Users Where They Are

System administrators, DevOps engineers, and IT professionals often face a critical challenge: how do you reliably notify users about important system events when they’re focused on their work? Email gets buried, Slack messages get missed, and web dashboards require active monitoring. What’s needed is a system that can break through the noise and deliver timely, actionable notifications directly to the desktop.

Real-World Use Cases

Consider these common scenarios where immediate desktop notifications make a critical difference:

Maintenance Window Notifications

"Scheduled maintenance starts in 15 minutes. 
Please save your work and log out."

Systems need to be taken offline for updates, but users deep in their work might miss emails or chat messages. A desktop notification with an OK/Cancel dialog can capture attention and even collect user acknowledgment.

Cost Alerts

"Your cloud resources have incurred $500 today. 
This exceeds your daily budget of $400."

Finance teams and project managers need real-time visibility into spending. A desktop notification can alert the right people before costs spiral out of control, triggering immediate action.

Resource Exhaustion Warnings

"Remote disk usage: 95% full on server prod-db-01. 
Immediate action required."

Infrastructure issues don’t wait for someone to check a dashboard. Direct notifications enable rapid response to prevent outages.

Security Alerts

"Multiple failed login attempts detected from IP 192.168.1.45. 
Review access logs?"

Security events require immediate attention. Desktop notifications ensure security teams are alerted in real-time.

Why a Desktop Agent?

You might ask: “Why not just use email, Slack, or another existing notification system?” Here’s why a dedicated desktop agent provides unique value:

1. Immediate Visibility

Desktop notifications appear on top of all windows. They can’t be missed or ignored like an email that arrives in an already-full inbox.

2. Interactive Responses

Unlike one-way notifications, the agent supports true dialog interactions. Users can acknowledge alerts, make choices (OK/Cancel), and those responses can be routed back to calling systems for automated workflows.

3. Platform Independence

The agent works identically on Windows, macOS, and Linux. One codebase, one API, consistent behavior across your entire infrastructure.

4. Decoupled Architecture

Applications don’t need to know anything about the desktop environment. They simply publish messages to Redis, and the agent handles the rest. This separation of concerns makes integration trivial.

5. Reliable Delivery

Using Redis pub/sub provides a robust, scalable message broker. Redis handles the complexity of message routing, ensuring notifications reach their destinations even in distributed environments.

Architectural Overview

Let’s examine the architecture at a high level, focusing on the key components and their interactions:

┌──────────────────────────────────────────────────────────────┐
│                     Your Infrastructure                       │
│                                                               │
│  ┌─────────────────┐     ┌──────────────────┐               │
│  │  Monitoring     │     │  Cost Tracking   │               │
│  │  System         │     │  Service         │               │
│  └────────┬────────┘     └────────┬─────────┘               │
│           │                       │                          │
│           │  Publish Message      │  Publish Message         │
│           │                       │                          │
│           ▼                       ▼                          │
│  ┌────────────────────────────────────────────┐             │
│  │          Redis Pub/Sub Broker              │             │
│  │                                            │             │
│  │  Channel: "notifications"                  │             │
│  │  Reply Channel: "replies:{hostname}"       │             │
│  └────────────────┬───────────────────────────┘             │
└───────────────────┼─────────────────────────────────────────┘
                    │
                    │ Subscribe & Receive
                    │
                    ▼
┌────────────────────────────────────────────────────────────┐
│                  User's Desktop                             │
│                                                             │
│  ┌──────────────────────────────────────────────────────┐  │
│  │         Go Desktop Agent (System Service)            │  │
│  │                                                      │  │
│  │  ┌─────────────┐  ┌─────────────┐  ┌────────────┐  │  │
│  │  │   Redis     │  │   Native    │  │   System   │  │  │
│  │  │  Subscriber │─▶│   Dialog    │  │    Tray    │  │  │
│  │  │             │  │   Handler   │  │            │  │  │
│  │  └─────────────┘  └──────┬──────┘  └────────────┘  │  │
│  │                          │                          │  │
│  │                          │ User Response            │  │
│  │                          ▼                          │  │
│  │                   ┌─────────────┐                   │  │
│  │                   │   Reply     │                   │  │
│  │                   │  Publisher  │                   │  │
│  │                   └──────┬──────┘                   │  │
│  └──────────────────────────┼──────────────────────────┘  │
└─────────────────────────────┼─────────────────────────────┘
                              │
                              │ Publish Response
                              ▼
                   ┌─────────────────────┐
                   │   Redis Reply       │
                   │   Channel           │
                   └─────────────────────┘

Component Breakdown

1. Message Publishers (Your Applications) Any system in your infrastructure can publish notifications. This could be:

  • Monitoring systems (Prometheus, Nagios, Zabbix)
  • Custom scripts (bash, Python, PowerShell)
  • Web applications
  • CI/CD pipelines
  • Cost management tools
  • Security systems

Publishers simply need Redis connectivity and send JSON messages to the notifications channel.

2. Redis Pub/Sub Broker Redis acts as the central nervous system:

  • Receives messages from publishers
  • Distributes to subscribed agents
  • Handles reply routing back to publishers
  • Provides persistence and reliability
  • Scales horizontally for large deployments

3. Go Desktop Agent (The Client) Runs as a system service on each user’s machine:

  • Subscribes to notification channels
  • Renders native desktop dialogs
  • Manages system tray presence
  • Handles user interactions
  • Publishes responses back to reply channels

Message Flow

Let’s trace a complete notification lifecycle:

  1. Event Occurs: A monitoring system detects disk usage at 95%
  2. Publish: The monitoring system publishes a JSON message to Redis:
    {
      "title": "Disk Space Alert",
      "message": "Server prod-db-01 is 95% full",
      "type": "OKCancel",
      "reply_channel": "replies:admin-workstation"
    }
    
  3. Receive: The Desktop Agent on admin-workstation receives the message
  4. Display: A native dialog appears on the admin’s screen
  5. Interact: Admin clicks “OK” to acknowledge
  6. Respond: Agent publishes response to replies:admin-workstation:
    {
      "hostname": "admin-workstation",
      "response": "OK",
      "timestamp": "2026-01-15T14:30:00Z"
    }
    
  7. Process: The monitoring system receives the acknowledgment and logs it

Design Principles

The architecture embodies several key design principles:

Simplicity

The agent requires minimal configuration. Point it at Redis, and it works. No complex setup, no dependency hell, just a single binary.

Separation of Concerns

Publishers don’t know about desktops. The agent doesn’t know about monitoring systems. Redis handles the middle ground. This decoupling makes the system maintainable and extensible.

Platform Agnostic

By using Go and platform-specific native APIs, the agent provides consistent functionality across operating systems while respecting native UI conventions.

Reliability First

Redis pub/sub is battle-tested. The agent handles reconnections gracefully. Messages don’t get lost, and the system degrades gracefully under failure conditions.

Security Aware

The agent can connect to Redis over TLS. Reply channels are hostname-specific, preventing cross-talk. Sensitive data never touches disk unnecessarily.

When to Use This Architecture

This notification system excels in scenarios where:

  • Immediate attention is required: System outages, security breaches, resource exhaustion
  • User acknowledgment is valuable: Maintenance windows, policy changes, critical alerts
  • Cross-platform consistency matters: Mixed Windows/Mac/Linux environments
  • Operational workflows need automation: Collecting responses, tracking acknowledgments
  • Existing systems need desktop reach: Extending monitoring, cost management, or security tools

When NOT to Use This Architecture

Consider alternatives if:

  • Mobile notifications are primary: This is desktop-focused
  • Rich media is essential: The agent displays text dialogs, not complex HTML
  • User installation is problematic: Each machine needs the agent installed
  • Email/chat is sufficient: Don’t add complexity if existing channels work

What’s Next

In Part 2, we’ll dive into the technical implementation, exploring:

  • Go project structure and dependencies
  • Redis pub/sub integration patterns
  • Cross-platform system tray implementation
  • Native dialog handling per operating system
  • Running as a Windows service vs. macOS daemon

Whether you’re a developer looking to understand the implementation or a product owner evaluating desktop notification solutions, this series will provide the insights you need to make informed decisions.

The complete source code is available at gitlab.com/hocmodo/go-desktop-agent, and we encourage you to explore, experiment, and adapt it to your needs.


Have questions or use cases we should cover? Let us know in the comments or reach out through our contact page.