Run an Oda runtime server

A runtime server lets a program of yours drive DataMind Oda without the app window: the program talks to the runtime over standard input and output and speaks the Oda SDK messages. This page describes the runtime's side of that conversation, from the handshake to shutdown. For the parts of the SDK, see the Oda SDK overview; to connect a program of your own, see Automation clients.

Serve one client

Warning

Standard output carries only protocol messages, and clients parse every byte of it. Keep anything else, such as a logger that writes to standard output, out of the runtime: a stray line corrupts the connection. Diagnostics belong on standard error.

Start with the handshake

Send a prompt

Attach images

Events and statuses

Shut down cleanly

Questions, answered

Can two clients share one runtime server?

No. A runtime serves one client from the first message until it disconnects; give each client its own runtime.

My prompt failed with SDK server is not initialized. What does that mean?

The runtime has not completed an initialize handshake, so it does not accept prompts yet. Complete a successful handshake before sending prompts; if the handshake itself failed, its error says why.

Can my client send another prompt while a run is still working?

Yes. More work can be enqueued on the same session; prompts for one session wait their turn, and a busy session does not block prompts for other sessions.

Why does an image prompt fail with SDK image prompt requires an attachment store?

The runtime has no attachment store to keep the image, so it refuses the prompt instead of losing the image. The image itself is fine; the runtime needs attachment storage before it can accept inline images.

Why did I not get a subagent.finished notification?

It is sent only for a subagent run that happened in this runtime's own process. A subagent that ran elsewhere is not reported through it.

What do the running and idle statuses describe?

The whole agent, not one turn: running while the agent works and idle when it stops.

A turn stopped at its token limit. Why does the server report a failure?

By default a max-token stop is not a success. A runtime can be configured to report max-token terminations as successful results.

What happens to a prompt while the server is shutting down?

A prompt that needs a new session is refused with SDK server is shutting down. The runtime is finishing its shutdown; start a new runtime for the next run.

The server answered SDK server teardown failed. What do I do?

Several parts of the runtime did not shut down cleanly at once. Stop the runtime process and start a new one before the next run.

A session stopped working with session agent was disposed outside the server. Why?

Something outside the server stopped that session's agent, so the server refuses to drive the session further. Continue in a new session.