Backplane.AgentRuntime.ToolResultContract (backplane_agent_runtime v1.10.92)

Copy Markdown

Host-selected, invocation-bound tool result allowances.

The optional :tool_result_contract execution/Conversation option is a function of the trusted registered descriptor and invocation identity (without tool arguments). It returns :default, {:ok, %{output_limit: bytes, json_limit: bytes}}, or {:error, %Backplane.AgentRuntime.Error{}}. Both limits must be positive, finite integers. The selected contract is persisted in the execution intent before dispatch and is never selected again when delivering that result.

output_limit bounds the Erlang external size of the native result, as the existing output limit does. json_limit independently bounds the JSON-encoded nested result value. Code Mode permits at most its ordinary 1 MiB of protocol envelope overhead in addition to that value. Neither option changes provider output accounting or Code Mode program/output limits.