diff --git a/internal/store/pg/agents.go b/internal/store/pg/agents.go index af5cc4fe..6d537839 100644 --- a/internal/store/pg/agents.go +++ b/internal/store/pg/agents.go @@ -190,8 +190,17 @@ func (s *PGAgentStore) Update(ctx context.Context, id uuid.UUID, updates map[str } // Coerce NOT NULL columns: null → default to prevent constraint violations. - if v, ok := updates["skill_nudge_interval"]; ok && v == nil { - updates["skill_nudge_interval"] = 0 + // Promoted TEXT columns (migration 000037): null → empty string. + for _, col := range []string{"emoji", "agent_description", "thinking_level"} { + if v, ok := updates[col]; ok && v == nil { + updates[col] = "" + } + } + // Promoted INT columns: null → 0. + for _, col := range []string{"skill_nudge_interval", "max_tokens"} { + if v, ok := updates[col]; ok && v == nil { + updates[col] = 0 + } } // NOT NULL JSONB columns: null → empty object. for _, col := range []string{"chatgpt_oauth_routing", "reasoning_config", "workspace_sharing", "shell_deny_groups", "kg_dedup_config"} { diff --git a/internal/store/sqlitestore/agents.go b/internal/store/sqlitestore/agents.go index d9b04933..65acd565 100644 --- a/internal/store/sqlitestore/agents.go +++ b/internal/store/sqlitestore/agents.go @@ -133,9 +133,18 @@ func (s *SQLiteAgentStore) Update(ctx context.Context, id uuid.UUID, updates map return nil } - // Coerce NOT NULL int columns: null → default to prevent constraint violations. - if v, ok := updates["skill_nudge_interval"]; ok && v == nil { - updates["skill_nudge_interval"] = 0 + // Coerce NOT NULL columns: null → default to prevent constraint violations. + // Promoted TEXT columns: null → empty string. + for _, col := range []string{"emoji", "agent_description", "thinking_level"} { + if v, ok := updates[col]; ok && v == nil { + updates[col] = "" + } + } + // Promoted INT columns: null → 0. + for _, col := range []string{"skill_nudge_interval", "max_tokens"} { + if v, ok := updates[col]; ok && v == nil { + updates[col] = 0 + } } // Unset existing default before setting a new one (scoped to same tenant). diff --git a/ui/web/src/pages/agents/agent-detail/agent-overview-tab.tsx b/ui/web/src/pages/agents/agent-detail/agent-overview-tab.tsx index 26de81d6..84937029 100644 --- a/ui/web/src/pages/agents/agent-detail/agent-overview-tab.tsx +++ b/ui/web/src/pages/agents/agent-detail/agent-overview-tab.tsx @@ -81,8 +81,8 @@ export function AgentOverviewTab({ agent, onUpdate, heartbeat, onManageCodexPool tools_config: toolsEnabled ? { profile: tools.profile, allow: tools.allow, deny: tools.deny, alsoAllow: tools.alsoAllow, byProvider: tools.byProvider } : {}, - // Promoted fields sent at top level - emoji: emoji.trim() || null, + // Promoted fields sent at top level (NOT NULL columns — send "" not null) + emoji: emoji.trim(), self_evolve: selfEvolve, skill_evolve: skillEvolve, skill_nudge_interval: skillEvolve ? skillNudgeInterval : 15,