Skip to content

Limits ​

A script runs on a shared server, so every run has a budget. When a limit trips, the script leaves by «ошибка» (error), with the text in $script_error.

A run ​

WhatLimit«Доступ студии» (Studio access)
time10 s — including bot.http, llm.ask, sleepthe same
interpreter steps1,000,000the same
memory16 MB of live values64 MB
call depth64the same
one string256 KB8 MB
one collection50,000 elementsthe same
the block's code20,000 bytes (a Cyrillic letter is 2 bytes)the same
sleep(d)up to 5 s at a timethe same
async fn tasks5 unfinished at onceno count
a regex pattern built at runtime4 KBthe same

Time, steps, memory, depth, sizes and tasks are interpreter limits: try doesn't catch them. Errors of sleep, bot functions and llm.ask are caught.

mzs
sleep(2)    # fine
sleep(6)    # error: sleep: at most 5 seconds at a time, got 6

bot functions ​

FunctionPer runSize
bot.say + bot.file10 messagestext, caption, link — 4000 bytes; file name — 200 characters
bot.edit10 editstext — 4000 bytes
bot.delete10 deletes—
bot.buttons3 calls10 buttons per call, label — 64 characters
bot.set50 writesvalue — 4000 bytes
bot.http3 requests5 s per request; request body — 64 KB, response — 256 KB (8 MB with «Доступ студии»)
bot.store_set + bot.store_delete20 writes (no count with «Доступ студии»)value — 4000 bytes (8 MB)
llm.ask5 callsprompt + system — 16 KB, max_tokens — 1–2000

Over the limit — an error naming the function:

mzs
include bot
for i in 1..11 { bot.say("Message ${i}") }
text
bot.say: more than 10 messages in one run

An empty bot.say("") doesn't count. A long bot.http response is cut silently — cut JSON no longer parses.

The bot ​

WhatLimit
bot variables100 per bot (no count with «Доступ студии»), a name up to 64 characters
the bot's script runs at once2; a third leaves by «ошибка» at once (too many scripts are running right now)
requests per visitor message10 across all HTTP request blocks and bot.http
blocks per message300 — a scenario with an instant loop is stopped
files included with include50, each up to 20,000 characters, 512 KB together
custom exits of a block10
$script_error1000 bytes

Scheduled ​

WhatLimit
scheduled blocks5 per bot
intervalat most once every 5 minutes; cron of 5 fields, no seconds
not allowedbot.say, bot.file, bot.edit, bot.delete, bot.buttons, bot.wait

Tasks ​

Five tasks at once are enough to make three requests in parallel. A sixth unfinished one is an error; for «Доступ студии» bots tasks aren't counted.

mzs
include tasks
async fn slow(i) { sleep(1); i }
ts = (1..6).map { slow(it) }    # limit: too many tasks: 5 already running
tasks.all(ts)

Not at all ​

The http and io modules, rand, uuid, shuffle, sample, crypto.random, eval. println output shows only in the studio's trial run.

Where to look ​

The trial run in the editor shows which limit tripped (timeout, steps, memory, depth, size, regex, busy), how many steps and milliseconds were used, and peak memory.