Expand description
Agent definitions, configuration, and completion API types.
An Agent is a fully-specified configuration of a single upstream language model. It encapsulates:
- Model identity (which LLM to use)
- Prompt structure (prefix/suffix messages)
- Decoding parameters (temperature, top_p, etc.)
- Provider preferences and routing
- Output mode, reasoning settings, and verbosity
§Content-Addressed Identity
Agents use content-addressed identifiers - their ID is derived deterministically from their full definition using XXHash3-128. This ensures:
- Two identical definitions always produce the same ID
- IDs can be computed anywhere (server, client, browser via WASM)
- No hidden mutation or “latest version” ambiguity
§Normalization
Before computing an ID, definitions are normalized via InlineAgentBase::prepare:
- Default values are removed (e.g.,
temperature: 1.0becomesNone) - Empty collections are removed
- Collections are sorted for deterministic ordering
Modules§
- claude_
agent_ sdk - codex_
sdk - completions
- Agent completions request and response types.
- laboratories
- Functions for working with
Laboratories. - mcp_
servers - Functions for working with
McpServers. - mock
- openrouter
- script
- validate
Structs§
- Agent
With Fallbacks With Count - An
AgentWithFallbackswith a count (post-validation swarm agent slot). - Client
Objectiveai Mcp - Client-side MCP surface the agent expects:
- Client
Objectiveai McpEntry - A single
owner/name/versionreference identifying one tool insideClientObjectiveaiMcp::tools. Plugin references use the largerClientObjectiveaiMcpPluginEntry— they carry extraexecutable/mcp_serversfields tools don’t have. - Client
Objectiveai McpHeaders - Snapshot of the three transient
X-OBJECTIVEAI-MCP-*request headers an HTTP caller stamps on its initial dial of the objectiveai-mcp proxy upstream. - Client
Objectiveai McpPlugin Entry - Plugin reference inside
ClientObjectiveaiMcp::plugins. - Client
Objectiveai McpPlugin McpServer - One
mcp_serversentry on aClientObjectiveaiMcpPluginEntry: the manifest-declarednamethe agent wants exposed, plus optionalargumentsthe CLI feeds to the plugin alongside the name when bringing the server up. The arguments map is sorted by key inprepareso two equivalent declarations (same key/value pairs in any order) hash to the same canonical form. - Inline
Agent Base With Fallbacks - An
InlineAgentBasewith optional fallbacks (no description). - Inline
Agent Base With Fallbacks OrRemote With Count - An
InlineAgentBaseWithFallbacksOrRemotewith a count (pre-validation swarm agent slot). - Inline
Agent With Fallbacks - A validated
InlineAgentwith optional fallbacks (no description). - Laboratory
- A laboratory provisioned for an agent: the container spec the CLI conduit materializes on demand at MCP-initialize. No mounts — agent laboratories don’t support them.
- McpServer
- An MCP server that the agent can connect to.
- Remote
Agent - A validated remote Agent with metadata and computed content-addressed ID.
- Remote
Agent Base - A remote agent base definition with metadata.
- Remote
Agent Base With Fallbacks - A remote agent base definition with description and optional fallbacks.
- Remote
Agent With Fallbacks - A validated remote agent with description and optional fallbacks.
Enums§
- Agent
- A validated Agent, either remote (with metadata) or inline.
- Agent
Base - An Agent base definition, either remote (with metadata) or inline.
- Agent
With Fallbacks - A validated agent with optional fallbacks, either remote (with description) or inline.
- Continuation
- Continuation state for multi-turn agent completions.
- Inline
Agent - A validated inline Agent with its computed content-addressed ID.
- Inline
Agent Base - The base inline configuration for an Agent (without computed ID or metadata).
- Inline
Agent Base With Fallbacks OrRemote - An agent specification that is either an inline agent base with fallbacks or a remote path reference.
- Inline
Agent Base With Fallbacks OrRemote Commit Optional - Like
InlineAgentBaseWithFallbacksOrRemotebut with optional commit. Used in request types where commit resolution happens server-side. - Inline
Agent Ref - A borrowed reference into an
InlineAgentBasevariant. - Output
Mode - The method used to constrain LLM output to valid response keys.
- Upstream
- Supported agent upstreams.
Constants§
- AGENT_
LABORATORY_ ID_ PREFIX - The reserved id namespace for agent laboratories. A laboratory
whose id starts with this prefix is DERIVED from an agent (see
laboratories::derived_id) — never user-created, never attachable or detachable.
Functions§
- prepare
- Sorts plugins + tools for deterministic ordering. Per-plugin
mcp_serversget their innerargumentsIndexMap key-sorted in place, then themcp_serversVec is sorted via theClientObjectiveaiMcpPluginMcpServerOrdimpl. Collapses an all-empty struct toNoneso the enclosingOptioncan drop the empty container entirely (same convention assuper::mcp_servers::prepare). - validate
- Validates the configuration. Each entry’s fields must be
non-empty, and the
plugins/toolslists each contain no(owner, name, version)duplicates. Free-function counterpart tosuper::mcp_servers::validate.
Type Aliases§
- Laboratories
- A list of agent laboratories.
- McpServers
- A list of MCP servers.