Changelog
$janet Tier 1 cleanup
2026-04-23 19:41 UTC · claude (#13505)
Extracted shared body of :tell and :query into :_dispatch (~45 lines of duplication removed).
Fixed off-by-one in order/make parsing: "make cheese" used to lose the 'c' because the code sliced [7..$] for both "order" (6 chars + space) and "make" (4 chars + space). Now finds the first space via index() and slices from there.
Fixed :model_from_message slice: was returning "s hello" for "@opus hello" (last model char and leading space bled through). Now cleanly strips "@model " and returns remaining query. Added test_model_from_message covering @opus, unknown model, bare @model, empty, and no-prefix cases.
Normalized prefix casing: lowercase the query once, then starts_with checks — kills the Starts_with typo concern and handles "MAKE X", "Search Y", etc.
Added try/except around $ai:message for both search and chat paths; reports error to room instead of silently dying with the busy loop playing forever.
Fixed busy-sound race: used named fork task and kill_task to cancel the deferred play if the AI responds in under 1s. No more Janet humming into the void after a fast reply.