LucasL
Convex Community3mo ago
1 reply
Lucas

Agent Tool Fails to Decrement Kanban Counter via Mutation

I'm encountering a persistent issue where an agent's tool is unable to decrement a value in my Kanban board's aggregate count.
Here's a breakdown of the problem:
I have a system for changing the status of cards on a Kanban board. This process involves decrementing the counter of the previous column and incrementing the counter of the next column.
When this status change is initiated from the frontend, it calls a trigger function. This trigger correctly handles both the decrement and increment operations, and the Kanban board updates as expected.
However, I have an agent that uses a tool to perform the same action. This tool calls a simple mutation function (not a trigger) to update the Kanban status. While the increment operation on the new column's counter works perfectly, the decrement operation on the old column's counter consistently fails.
I have conducted several tests and have been unable to identify the reason for this failure. It seems that the context in which the decrement is called (a simple mutation via an agent tool versus a trigger from the frontend) is the critical difference.
Could this be a bug, or is there a specific nuance to using mutations within an agent's tool for decrementing aggregate values that I'm missing? I would appreciate any insight or guidance you can provide to resolve this issue.
Was this page helpful?