Skip to content

armgit / ax

Public Imported from GitHub
0

Agent Executor (AX) is Google's open agentic orchestration runtime

Go

Make health check configuration its own category (#10)

Jaana Dogan90e819ad961f
diff --git a/README.md b/README.md
index 4b1631f..872d47d 100644
--- a/README.md
+++ b/README.md
@@ -178,8 +178,9 @@ eventlog:
# Maximum steps per trigger
max_steps: 50
-# Health check interval for agents
-health_check_interval: 30s
+health_check:
+ # Health check interval for agents
+ interval: 30s
# Remote agents to register on startup
remote_agents:
diff --git a/cmd/gar/serve.go b/cmd/gar/serve.go
index 878c4c5..451aeeb 100644
--- a/cmd/gar/serve.go
+++ b/cmd/gar/serve.go
@@ -115,7 +115,7 @@ func newControllerFromConfig(ctx context.Context, cfg *config.Config) (*controll
EventLogFactory: eventLogFactory,
PlannerFactory: plannerFactory,
MaxSteps: cfg.MaxSteps,
- HealthCheckInterval: cfg.HealthCheckInterval,
+ HealthCheckInterval: cfg.HealthCheck.Interval,
}
// Create controller
diff --git a/gar.yaml b/gar.yaml
index 7ddc77a..5b4277e 100644
--- a/gar.yaml
+++ b/gar.yaml
@@ -25,8 +25,9 @@ eventlog:
# Maximum number of steps per trigger
max_steps: 50
-# Health check interval for agents (e.g., "30s", "1m")
-health_check_interval: 30s
+health_check:
+ # Health check interval for agents (e.g., "30s", "1m")
+ interval: 30s
# Planner configuration (optional)
# planner:
diff --git a/internal/config/config.go b/internal/config/config.go
index 7dd2f46..b51b175 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -26,12 +26,12 @@ import (
// Config represents the main configuration for GAR server.
type Config struct {
- Server ServerConfig `yaml:"server"`
- EventLog EventLogConfig `yaml:"eventlog"`
- MaxSteps int `yaml:"max_steps"` // Maximum steps per trigger
- HealthCheckInterval time.Duration `yaml:"health_check_interval"` // Health check interval for agents
- Planner PlannerConfig `yaml:"planner,omitempty"`
- RemoteAgents []RemoteAgentConfig `yaml:"remote_agents,omitempty"` // List of remote agents to register
+ Server ServerConfig `yaml:"server"`
+ EventLog EventLogConfig `yaml:"eventlog"`
+ MaxSteps int `yaml:"max_steps"` // Maximum steps per trigger
+ HealthCheck HealthCheckConfig `yaml:"health_check"`
+ Planner PlannerConfig `yaml:"planner,omitempty"`
+ RemoteAgents []RemoteAgentConfig `yaml:"remote_agents,omitempty"` // List of remote agents to register
}
// PlannerConfig configures the planner.
@@ -49,10 +49,8 @@ type EventLogConfig struct {
Dir string `yaml:"dir"` // Directory for event log files
}
-// ControllerConfig configures the controller behavior.
-type ControllerConfig struct {
- MaxSteps int `yaml:"max_steps"` // Maximum steps per trigger
- HealthCheckInterval time.Duration `yaml:"health_check_interval"` // Health check interval for agents
+type HealthCheckConfig struct {
+ Interval time.Duration `yaml:"interval"` // Interval between health checks
}
// GeminiPlannerConfig configures the Gemini-based planner.
@@ -118,8 +116,9 @@ func (c *Config) setDefaults() {
if c.MaxSteps == 0 {
c.MaxSteps = 100
}
- if c.HealthCheckInterval == 0 {
- c.HealthCheckInterval = 30 * time.Second
+
+ if c.HealthCheck.Interval == 0 {
+ c.HealthCheck.Interval = 30 * time.Second
}
}
@@ -134,8 +133,8 @@ func (c *Config) Validate() error {
if c.MaxSteps <= 0 {
return fmt.Errorf("max_steps must be positive")
}
- if c.HealthCheckInterval <= 0 {
- return fmt.Errorf("health_check_interval must be positive")
+ if c.HealthCheck.Interval <= 0 {
+ return fmt.Errorf("health_check.interval must be positive")
}
return nil
}