Bug description
When calling update_sql_transformation with multiple str_replace operations in a single batch, the tool returns success: true even when none of the search strings were found and no changes were made.
Steps to reproduce
- Fetch transformation config SQL from dev branch
- Build a batch of 40+
str_replace operations (e.g. removing AS from table aliases)
- Call
update_sql_transformation with all operations in one payload
- Tool returns
{"success": true, "version": N} (version unchanged or incremented)
- Re-fetch the SQL — no changes were applied
Expected behavior
- Each failing
str_replace operation (search string not found) should be reported individually
- OR the batch should fail with a list of which operations had no match
- The version should NOT increment if nothing changed
Actual behavior
- Tool returns
success: true with a new version number
- No replacements were actually made
- Only when running single operations does it explicitly report "search string not found"
Workaround used
Had to abandon batch approach entirely. Used direct Keboola Storage API (PUT /v2/storage/branch/{branch_id}/components/.../configs/{config_id}) with a locally-prepared JSON payload to push the full updated configuration.
Impact
AI agents iterating on SQL code cannot trust batch str_replace results. Silent no-ops with a success response make it impossible to detect when transformations failed without re-fetching and diffing the entire config after every batch.
Context
- kbagent version: 0.9.0
- Operation: removing 182
AS alias occurrences from Products code (config 746772863, Slevomat project 226)
- Dev branch: 1285731
Bug description
When calling
update_sql_transformationwith multiplestr_replaceoperations in a single batch, the tool returnssuccess: trueeven when none of the search strings were found and no changes were made.Steps to reproduce
str_replaceoperations (e.g. removingASfrom table aliases)update_sql_transformationwith all operations in one payload{"success": true, "version": N}(version unchanged or incremented)Expected behavior
str_replaceoperation (search string not found) should be reported individuallyActual behavior
success: truewith a new version numberWorkaround used
Had to abandon batch approach entirely. Used direct Keboola Storage API (
PUT /v2/storage/branch/{branch_id}/components/.../configs/{config_id}) with a locally-prepared JSON payload to push the full updated configuration.Impact
AI agents iterating on SQL code cannot trust batch
str_replaceresults. Silent no-ops with a success response make it impossible to detect when transformations failed without re-fetching and diffing the entire config after every batch.Context
AS aliasoccurrences from Products code (config 746772863, Slevomat project 226)