Code Mode
In Settings → Elowen AI → Tool execution, turn on Code mode for a connected provider. Code Mode lets a model run JavaScript that calls several tools in one turn, which is useful when later tool calls depend on earlier results. Each call still follows the account's permissions and approval rules.
Turn on Code Mode
In Settings → Elowen AI, find a connected provider and open Tool execution. Turn on Code mode for that provider. The setting applies to every model from that provider.
The switch appears only for providers that support it. Models trained for this tool format, such as GPT-5.6 and newer, tend to work best; try a real task before enabling it for another model.
What the model can do
The model receives an exec tool for raw JavaScript and a wait tool for checking a script that is still running. Other available tools can be called inside the script through tools.<name>. AskUserQuestion remains available for asking you to make a choice.
A script can run several dependent tool calls without a separate model round for each one. It can also yield while work continues, then resume with wait. The script itself has no direct filesystem or network access; use the available tools for those actions.
Code Mode does not grant extra access. Every tool call inside a script uses the same account, Project, tool permissions and approval checks as a direct call. Code Mode and deferred Tool Search cannot be used together.
Use JavaScript cells
Each exec call starts a new JavaScript cell. For long-running work, the script can yield and return a cell ID. Then call wait with that ID to get more output or completion. Use terminate: true to stop a running cell. A completed or terminated cell cannot be resumed.
A first-line pragma can change the wait and output limits for one call:
// @exec: {"yield_time_ms": 60000, "max_output_tokens": 2000}
return await tools.ListDir({ path: "src" });
Code Mode limits
A conversation can have up to 8 open cells. Each cell has a 256 MB memory limit. A cell is stopped after 600 seconds without being observed. The default wait is 120 seconds and can be set from 10 to 600 seconds in Settings → Elowen AI → Runtime. Output defaults to 10,000 tokens; an administrator can set its limit from 1,000 to 50,000 tokens in the same section.
Cells belong to the conversation that created them. Another conversation cannot use their IDs, and only one observer can wait on a cell at a time.
Turn off Code Mode
Return to Settings → Elowen AI → Tool execution and switch Code Mode off for that provider. There is no separate slash command.