Oda SDK: the runtime server

The runtime server is the serving side of the Oda SDK: it answers a program of yours over standard input and output, so you can drive DataMind Oda without the app window. This page describes the server's side of the connection, from the handshake to shutdown. Start with the Oda SDK overview if you are new to the family, and see Automation clients to connect a program of your own.

The serving connection

Warning

Standard output carries protocol messages only. Never compose a logger or any other writer onto it: this is checked when the runtime is deployed.

Start with one handshake

Sessions and prompts

Inline images

Statuses and notifications

Shutdown and teardown

Questions, answered

What happens if a prompt arrives before the handshake?

The server refuses it with SDK server is not initialized. Complete one successful initialize first; if the handshake itself failed, its error says why.

Does every prompt need its own handshake?

No. One handshake covers the connection: the route is resolved once, and sessions start on first use of their session id.

Why did the handshake fail with no adapter registered for provider "<provider>"?

The provider you named cannot be served by this runtime, so the route could not be resolved. Name a provider and a model this runtime can serve, then handshake again; the route does not fall back to a default.

What comes back when a prompt is accepted?

Its receipt, an object with a messageId, straight away. It confirms that exactly one user message was queued; it does not identify a later assistant message, a turn ending or the result of that prompt.

What happens to an image I send with a prompt?

It is stored as a durable attachment before the prompt is queued, and the session keeps a reference to the stored image. Without an attachment store the server refuses the prompt rather than lose the image: SDK image prompt requires an attachment store.

What do running and idle describe?

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

Which subagent runs does subagent.finished report?

Only runs that executed in the server's own process. A subagent run that happened elsewhere is not reported through it.

A run stopped at its token limit. Why does the server report error?

By default a max-token stop is not a success: a completed run maps to ok, and a run that ended at its token limit maps to error unless the runtime is configured to treat 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 shutdown answer reports a teardown failure. What should I do?

Several parts of the runtime did not dispose cleanly at once; several failures together read SDK server teardown failed, while a single failure is reported as itself. Restart the runtime before the next run.

Why was my session refused with session agent was disposed outside the server?

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

Why must standard output carry only protocol messages?

That channel carries the protocol for the client, so a deployment must keep every other writer, a logger included, off it; this requirement is checked when the runtime is deployed.