Skip to content

Commit c4bbbf7

Browse files
authored
Merge pull request #63 from aoagents/revert-58-feat/55
Revert "feat: add notifier delivery runtime"
2 parents d06c0ce + cb2a00a commit c4bbbf7

29 files changed

Lines changed: 32 additions & 2494 deletions

backend/internal/cdc/event.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ import (
1818
type EventType string
1919

2020
const (
21-
EventSessionCreated EventType = "session_created"
22-
EventSessionUpdated EventType = "session_updated"
23-
EventPRCreated EventType = "pr_created"
24-
EventPRUpdated EventType = "pr_updated"
25-
EventPRCheckRecorded EventType = "pr_check_recorded"
26-
EventNotificationCreated EventType = "notification_created"
27-
EventNotificationUpdated EventType = "notification_updated"
28-
EventNotificationDeliveryCreated EventType = "notification_delivery_created"
29-
EventNotificationDeliveryUpdated EventType = "notification_delivery_updated"
21+
EventSessionCreated EventType = "session_created"
22+
EventSessionUpdated EventType = "session_updated"
23+
EventPRCreated EventType = "pr_created"
24+
EventPRUpdated EventType = "pr_updated"
25+
EventPRCheckRecorded EventType = "pr_check_recorded"
26+
EventNotificationCreated EventType = "notification_created"
27+
EventNotificationUpdated EventType = "notification_updated"
3028
)
3129

3230
// Event is one CDC change read from change_log. Seq is the monotonic ordering +

backend/internal/config/config.go

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import (
1111
"path/filepath"
1212
"strconv"
1313
"time"
14-
15-
"github.com/aoagents/agent-orchestrator/backend/internal/ports"
1614
)
1715

1816
const (
@@ -52,46 +50,6 @@ type Config struct {
5250
// DataDir is the directory holding durable state (the SQLite database and
5351
// the CDC JSONL log). It is created on first use by the storage layer.
5452
DataDir string
55-
// Notifications controls the central notifier runtime. The dashboard is the
56-
// durable notifications table itself; desktop delivery is handed off to the
57-
// AO Electron app via notification_deliveries rows.
58-
Notifications NotificationConfig
59-
}
60-
61-
// NotificationConfig contains the global notification settings used by the
62-
// central notifier runtime. It intentionally starts global (not per-project) so
63-
// the routing model can grow without changing lifecycle reactions.
64-
type NotificationConfig struct {
65-
Enabled bool
66-
Dashboard DashboardNotificationConfig
67-
Desktop DesktopNotificationConfig
68-
Routing NotificationRoutingConfig
69-
Retry NotificationRetryConfig
70-
}
71-
72-
type DashboardNotificationConfig struct {
73-
Enabled bool
74-
Limit int
75-
}
76-
77-
type DesktopNotificationConfig struct {
78-
Enabled bool
79-
Priorities []ports.Priority
80-
SoundPriorities []ports.Priority
81-
}
82-
83-
type NotificationRoutingConfig struct {
84-
// Priorities maps notification priority to built-in route names. The
85-
// notifier currently implements dashboard and desktop only.
86-
Priorities map[ports.Priority][]string
87-
}
88-
89-
type NotificationRetryConfig struct {
90-
MaxAttempts int
91-
BaseDelay time.Duration
92-
MaxDelay time.Duration
93-
LeaseTTL time.Duration
94-
BatchSize int
9553
}
9654

9755
// Addr returns the host:port the HTTP server binds. It uses net.JoinHostPort so
@@ -119,7 +77,6 @@ func Load() (Config, error) {
11977
Port: DefaultPort,
12078
RequestTimeout: DefaultRequestTimeout,
12179
ShutdownTimeout: DefaultShutdownTimeout,
122-
Notifications: DefaultNotificationConfig(),
12380
}
12481

12582
if raw := os.Getenv("AO_PORT"); raw != "" {
@@ -164,35 +121,6 @@ func Load() (Config, error) {
164121
return cfg, nil
165122
}
166123

167-
// DefaultNotificationConfig returns the safe zero-setup notification settings.
168-
func DefaultNotificationConfig() NotificationConfig {
169-
return NotificationConfig{
170-
Enabled: true,
171-
Dashboard: DashboardNotificationConfig{
172-
Enabled: true,
173-
Limit: 50,
174-
},
175-
Desktop: DesktopNotificationConfig{
176-
Enabled: true,
177-
Priorities: []ports.Priority{ports.PriorityUrgent, ports.PriorityAction},
178-
SoundPriorities: []ports.Priority{ports.PriorityUrgent},
179-
},
180-
Routing: NotificationRoutingConfig{Priorities: map[ports.Priority][]string{
181-
ports.PriorityUrgent: []string{"dashboard", "desktop"},
182-
ports.PriorityAction: []string{"dashboard", "desktop"},
183-
ports.PriorityWarning: []string{"dashboard"},
184-
ports.PriorityInfo: []string{"dashboard"},
185-
}},
186-
Retry: NotificationRetryConfig{
187-
MaxAttempts: 5,
188-
BaseDelay: time.Second,
189-
MaxDelay: 5 * time.Minute,
190-
LeaseTTL: 30 * time.Second,
191-
BatchSize: 50,
192-
},
193-
}
194-
}
195-
196124
// parsePositiveDuration rejects zero and negative durations: a zero
197125
// RequestTimeout would expire every request instantly, and a non-positive
198126
// ShutdownTimeout would defeat graceful shutdown.

backend/internal/config/config_test.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package config
33
import (
44
"testing"
55
"time"
6-
7-
"github.com/aoagents/agent-orchestrator/backend/internal/ports"
86
)
97

108
func TestLoadDefaults(t *testing.T) {
@@ -33,18 +31,6 @@ func TestLoadDefaults(t *testing.T) {
3331
if cfg.RunFilePath == "" {
3432
t.Error("RunFilePath is empty, want a resolved default path")
3533
}
36-
if !cfg.Notifications.Enabled || !cfg.Notifications.Dashboard.Enabled || !cfg.Notifications.Desktop.Enabled {
37-
t.Fatalf("notification defaults should be enabled: %+v", cfg.Notifications)
38-
}
39-
if cfg.Notifications.Dashboard.Limit != 50 {
40-
t.Fatalf("dashboard limit = %d, want 50", cfg.Notifications.Dashboard.Limit)
41-
}
42-
if got := cfg.Notifications.Routing.Priorities[ports.PriorityUrgent]; len(got) != 2 || got[0] != "dashboard" || got[1] != "desktop" {
43-
t.Fatalf("urgent routes = %v, want dashboard+desktop", got)
44-
}
45-
if cfg.Notifications.Retry.MaxAttempts != 5 || cfg.Notifications.Retry.LeaseTTL != 30*time.Second {
46-
t.Fatalf("retry defaults = %+v", cfg.Notifications.Retry)
47-
}
4834
}
4935

5036
func TestLoadOverrides(t *testing.T) {

backend/internal/daemon/daemon.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ func Run() error {
6161
return err
6262
}
6363

64-
notifier := startNotifier(ctx, cfg, store, log)
65-
6664
// Terminal streaming: the tmux runtime supplies the PTY-attach command and
6765
// liveness; the CDC broadcaster feeds the session-state channel. The manager
6866
// is handed to httpd, which mounts it at /mux. Raw PTY bytes never flow
@@ -73,11 +71,6 @@ func Run() error {
7371

7472
srv, err := httpd.New(cfg, log, termMgr)
7573
if err != nil {
76-
stop()
77-
notifier.Stop()
78-
if cdcErr := cdcPipe.Stop(); cdcErr != nil {
79-
log.Error("cdc pipeline shutdown", "err", cdcErr)
80-
}
8174
return err
8275
}
8376

@@ -86,11 +79,6 @@ func Run() error {
8679
// trigger -> change_log -> poller -> broadcaster.
8780
lcStack, err := startLifecycle(ctx, store, log)
8881
if err != nil {
89-
stop()
90-
notifier.Stop()
91-
if cdcErr := cdcPipe.Stop(); cdcErr != nil {
92-
log.Error("cdc pipeline shutdown", "err", cdcErr)
93-
}
9482
return err
9583
}
9684

@@ -110,7 +98,6 @@ func Run() error {
11098
// the LIFO trap (see comment after srv.Run), hence explicit.
11199
stop()
112100
lcStack.Stop()
113-
notifier.Stop()
114101
if cdcErr := cdcPipe.Stop(); cdcErr != nil {
115102
log.Error("cdc pipeline shutdown", "err", cdcErr)
116103
}
@@ -126,7 +113,6 @@ func Run() error {
126113
// runs before the cancel — which would hang any non-signal exit path.
127114
stop()
128115
lcStack.Stop()
129-
notifier.Stop()
130116
if err := cdcPipe.Stop(); err != nil {
131117
log.Error("cdc pipeline shutdown", "err", err)
132118
}

backend/internal/daemon/notifier_wiring.go

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

backend/internal/domain/notification.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ type Notification struct {
2727
CauseKey string
2828
ReadAt time.Time
2929
ArchivedAt time.Time
30-
RoutedAt time.Time
3130
CreatedAt time.Time
3231
UpdatedAt time.Time
3332
}

backend/internal/integration/notification_runtime_test.go

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

0 commit comments

Comments
 (0)