From 20b4ad102d1a1a613d48ccde6745d366bf633ad7 Mon Sep 17 00:00:00 2001 From: Carlos Escalante Date: Wed, 29 Apr 2026 22:58:28 -0600 Subject: [PATCH] Wrap transaction_type in col() for notin_ filter SQLModel enum columns need col() to expose SQLAlchemy operators like notin_. Without it the agent tool raised at query build time and the chat card flashed away. Co-Authored-By: Claude Opus 4.7 (1M context) --- backend/app/agent/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/agent/tools.py b/backend/app/agent/tools.py index ea71b78..8caac0e 100644 --- a/backend/app/agent/tools.py +++ b/backend/app/agent/tools.py @@ -119,7 +119,7 @@ def get_recent_transactions( """Recent transactions, newest first. Use filters to narrow down. For billing-cycle scoped totals prefer get_cycle_summary.""" q = select(Transaction).where( - Transaction.transaction_type.notin_( + col(Transaction.transaction_type).notin_( [TransactionType.SALARY, TransactionType.DEPOSITO] ) )