Skip to content

Commit c695cd9

Browse files
author
rictus
committed
Add inline comment explaining graceful degradation in ResolveRoleAgentConfig
The validation-failure-triggers-fallback pattern is non-obvious. Added a comment explaining that this allows the system to gracefully degrade when a configured agent is unavailable (e.g., binary not installed or custom agent removed). Task: gt-1rri8 (settings.go doesn't exist - added to loader.go instead)
1 parent 9b2a1c4 commit c695cd9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/config/loader.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,10 @@ func ResolveRoleAgentConfig(role, townRoot, rigPath string) *RuntimeConfig {
978978
_ = LoadRigAgentRegistry(RigAgentRegistryPath(rigPath))
979979
}
980980

981-
// Check rig's RoleAgents first
981+
// Check rig's RoleAgents first.
982+
// Note: validation failure triggers a warning and fallback rather than an error,
983+
// allowing the system to gracefully degrade when a configured agent is unavailable
984+
// (e.g., binary not installed, custom agent removed from config).
982985
if rigSettings != nil && rigSettings.RoleAgents != nil {
983986
if agentName, ok := rigSettings.RoleAgents[role]; ok && agentName != "" {
984987
if err := ValidateAgentConfig(agentName, townSettings, rigSettings); err != nil {

0 commit comments

Comments
 (0)