From bf600f8c5f98ce655f5e8dadb0197db330a7442d Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Wed, 25 Mar 2026 10:22:13 +0100 Subject: [PATCH] fix: read version and updated_at from SQL columns in config repository The findByApplication query only read config_val JSONB, ignoring the version and updated_at SQL columns. The JSON blob contained version 0 from the original save, so agents saw no config and fell back to defaults. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../app/storage/PostgresApplicationConfigRepository.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cameleer3-server-app/src/main/java/com/cameleer3/server/app/storage/PostgresApplicationConfigRepository.java b/cameleer3-server-app/src/main/java/com/cameleer3/server/app/storage/PostgresApplicationConfigRepository.java index be4adc02..14fa6e93 100644 --- a/cameleer3-server-app/src/main/java/com/cameleer3/server/app/storage/PostgresApplicationConfigRepository.java +++ b/cameleer3-server-app/src/main/java/com/cameleer3/server/app/storage/PostgresApplicationConfigRepository.java @@ -22,10 +22,13 @@ public class PostgresApplicationConfigRepository { public Optional findByApplication(String application) { List results = jdbc.query( - "SELECT config_val FROM application_config WHERE application = ?", + "SELECT config_val, version, updated_at FROM application_config WHERE application = ?", (rs, rowNum) -> { try { - return objectMapper.readValue(rs.getString("config_val"), ApplicationConfig.class); + ApplicationConfig cfg = objectMapper.readValue(rs.getString("config_val"), ApplicationConfig.class); + cfg.setVersion(rs.getInt("version")); + cfg.setUpdatedAt(rs.getTimestamp("updated_at").toInstant()); + return cfg; } catch (JsonProcessingException e) { throw new RuntimeException("Failed to deserialize application config", e); }