diff --git a/migrations/V25__wasm_fuel_limit_bump.sql b/migrations/V25__wasm_fuel_limit_bump.sql new file mode 100644 index 0000000000..a6fe61a12c --- /dev/null +++ b/migrations/V25__wasm_fuel_limit_bump.sql @@ -0,0 +1,7 @@ +-- The code default for wasm.default_fuel_limit was bumped from 10M to 500M +-- (limits.rs, config/wasm.rs), but databases that persisted the old 10M value +-- in the settings table still read it back at startup (DB-first resolution). +-- Delete the stale row so the code default takes effect. +DELETE FROM settings +WHERE key = 'wasm.default_fuel_limit' + AND (value#>>'{}')::BIGINT = 10000000; diff --git a/migrations/checksums.lock b/migrations/checksums.lock index c699f5b9b5..d3547a8796 100644 --- a/migrations/checksums.lock +++ b/migrations/checksums.lock @@ -37,3 +37,4 @@ V21__backfill_conversation_source_channel = 4041142068103384561 V22__sandbox_restart_params = 12611649486554869350 V23__list_workspace_files_escape_like = 12519024535161914473 V24__llm_calls_created_at_index = 2650126284755685421 +V25__wasm_fuel_limit_bump = 8924323300096627270 diff --git a/src/db/libsql_migrations.rs b/src/db/libsql_migrations.rs index 354cfe50a8..27bff085af 100644 --- a/src/db/libsql_migrations.rs +++ b/src/db/libsql_migrations.rs @@ -990,6 +990,21 @@ ALTER TABLE agent_jobs ADD COLUMN restart_params TEXT; "llm_calls_created_at_index", r#" CREATE INDEX IF NOT EXISTS idx_llm_calls_created_at ON llm_calls(created_at); +"#, + ), + ( + 25, + "wasm_fuel_limit_bump", + // The code default for wasm.default_fuel_limit was bumped from 10M to + // 500M (limits.rs, config/wasm.rs), but databases that persisted the + // old 10M value in the settings table still read it back at startup + // (DB-first resolution). Delete the stale row so the code default + // takes effect; users who intentionally lowered the limit can re-set + // it via the settings API. + r#" +DELETE FROM settings +WHERE key = 'wasm.default_fuel_limit' + AND CAST(json_extract(value, '$') AS INTEGER) = 10000000; "#, ), ];