Programs Oda runs

Some tasks are carried out as a small program: Oda writes one program that uses its usual tools as ordinary calls, runs it, and the result returns to your chat. This page covers what you see in the chat, what a program may use, and the limits and messages that come with it.

Whether a chat works this way is decided when its agent is set up; Tools and how they are offered describes that choice.

What you see in the chat

What a program may use

Time and output limits

WhatThe limit
Time budget120,000 ms (about two minutes) by default. A longer budget must be a positive number, and anything above the ceiling is capped at 600,000 ms (ten minutes). A budget of zero does not remove the deadline.
What the budget coversThe whole run, including waiting for the steps the program calls and for your approvals. It is not a measure of processor time.
OutputThe lines a program printed and its result are capped together at 64 MiB (67,108,864 bytes). Past the cap, the fitting part of the output is kept and the result says the limit was hit.
MemoryThe program's own memory is capped at 512 MiB (a heap limit). It is not a total memory cap for everything the run starts.

A run started from the chat always has a deadline; runs that other parts of Oda start, such as a workflow, can be given no deadline at all.

The chat's file limits

The modes, blocked steps and wider retries are described in full on Command sandboxing and approvals.

When a program fails

A failed run is reported in the chat and to Oda: the row replaces the program's description with the first line of the failure, and the card keeps the full text under OUT, followed by any lines the program printed before it failed and the file-sandbox facts for the run. Oda reads the same failure and can adjust the work and try again.

The failure names the reason and its detail, for example:

Values move between the program and Oda as plain data: text, numbers, true or false, lists and objects, without gaps or special values. A value that cannot make that trip fails the run instead of being replaced, and a standard line says so:

Questions, answered

Why is a step shown as Code?

The step is a program Oda wrote: it works through several tool calls in one run, and the card carries the program. Open the row to read it, and look under the row for the steps it called.

Why does the program's output not appear while it runs?

The run keeps its output until it settles: the printed lines and the result arrive together when the run ends, under OUT. The steps it calls are shown as they happen, nested under the Code row.

How long may a program run?

About two minutes by default, and ten minutes at most: Oda can ask for a longer budget, but only as a positive number, and larger requests are capped. The budget covers the whole run, including waiting for the steps it calls and for your approvals.

What happens when a program runs out of time?

The run ends and reports it, reading like Error: code run failed (timeout): execution deadline reached (120000ms). The output the program produced before the deadline is kept with the result.

What does Error: code run failed mean?

A program failed before it finished. The parentheses name the reason, such as a timeout, a stop or output past the cap, and the rest of the line carries the detail. Oda reads the same failure and can adjust the work and try again.

Why did a value fail to come back from the run?

Values move between the program and Oda as plain data: text, numbers, true or false, lists, and objects, without gaps or special values. A value that cannot survive that trip fails the run and is reported, reading like program completion must be lossless JSON or cannot encode a sparse JSON array.

Does a program see my environment variables?

No. Each run starts with an empty environment: only a few system variables it needs to start other programs are kept.

Does a program keep anything for the next run?

No. Each run starts fresh: no state is kept from earlier runs.

What happens when a program prints too much?

The lines it printed and its result are capped together at 64 MiB. Past the cap, the fitting part of the output is kept and the result says the limit was hit.

Do the chat's file limits apply to a program?

Yes. A program runs under the chat's access mode, like any other step, and its result reports how the limits were applied, including when they could only be applied partly on this computer. The steps it calls keep their own approvals and limits, and a wider retry for a blocked program must be approved and covers the whole run. See Command sandboxing and approvals.

Why did the run complete with no output?

The program's output is only what it printed or returned. A program that did neither still did its work through the steps it called, and the output says the run completed with no output instead of showing an empty result.