You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
app.memoryBudget takes a non-number mb as "report only" #3706
app.memoryBudget reads its one parameter with p.get("mb").and_then(Value::as_f64) (crates/engine/src/cmd/query.rs:268, on main since 7266f41). An mb that is present but isn't a JSON number ({"mb": "512"}, {"mb": true}, {"mb": [512]}) goes down the same path as a missing one: the command succeeds, returns the memory report, and doesn't change the budget.
Why it matters
A caller over the control channel, MCP or the CLI that sends the number as a string (a common slip from scripts and agents) gets a success reply and thinks the budget changed. Only a careful reading of the budget field in the report shows it didn't. Other commands refuse a mistyped parameter instead: photo_id (crates/engine/src/cmd.rs:228) refuses {"id": "5"}, and denoise.settings refuses a cacheGb that isn't a whole number. An out-of-range number ({"mb": 10}) is already refused here.
What a fix needs
A present, non-null mb that isn't a number is refused with the command's BadParams error, naming the expected values (a number of megabytes from 64 to 1048576).
Missing or nullmb keeps today's behaviour: the report only.
Numbers keep today's behaviour: 64..1048576 sets the budget, anything else (0 included) is refused.
Tests: string, bool and array mb are refused; null and missing return the report; 0 is refused as out of range; a valid number still sets the budget.
PR #3118 (open, #3072) makes mb: 0 mean "automatic" in the same block. This fix touches the same lines, so whichever lands second needs a small rebase.
Activity
ticket-craft commentedon Nov 3, 2026
Possibly related: #181, #2625 and #2097.
test(engine): storytold#3706 an mb in range is applied, checked in a …
fix(engine): storytold#3706 app.memoryBudget refuses an mb that isn't…
test(engine): storytold#3706 an mb in range is applied, checked in a …
test(engine): storytold#3706 both ends of the mb range are applied
fix(engine): storytold#3706 app.memoryBudget refuses an mb that isn't…
test(engine): storytold#3706 an mb in range is applied, checked in a …
test(engine): storytold#3706 both ends of the mb range are applied
Issue storytold#3706: app.memoryBudget's help says the unit, the acce…