Skip to content

Commit 34cee28

Browse files
committed
Fix first-run config: always re-read config from DB in ensure_settings
1 parent 2f33ea9 commit 34cee28

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

extensions/src/adam_ext_chat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ static adam_tool_result_t ext_sql_tool(arena_t *arena, void *tool_ctx,
128128

129129
int adam_ext_ensure_settings(adam_ext_ctx_t *ctx,
130130
char *err_buf, size_t err_buf_size) {
131-
if (ctx->initialized && ctx->settings) return 0;
132-
131+
// Always re-read config from DB (settings may have been set in a
132+
// previous SQL call within the same connection)
133133
if (adam_ext_config_apply(ctx) != 0 || !ctx->settings) {
134134
snprintf(err_buf, err_buf_size,
135135
"adam not configured. Use: SELECT adam_config('provider','anthropic'); "

0 commit comments

Comments
 (0)