Overview
RunOptions defines the configuration for executing a Codebuff agent. These options are passed to client.run() and control the agent’s behavior, context, and execution parameters.
Type Definition
Properties
The agent to run.
- Use
'base'for the default Codebuff agent - Use a custom agent ID (e.g.,
'my-agent') if you defined custom agents - Pass an inline AgentDefinition object for one-off agent configurations
The user prompt describing what you want the agent to do.This is the main instruction to the agent. Be clear and specific about the task.Examples:
Content array for multimodal messages supporting text and images.Use this when you need to include images or structured content beyond plain text.Example:
Additional parameters for the agent as a JSON object.Most agents don’t use this field, but custom agents can define an
inputSchema.params to accept structured input beyond the prompt string.Example with a custom agent that expects parameters:JSON state returned from a previous
run() call.Use this to continue a conversation or maintain session context across multiple agent invocations. The agent will have access to the full conversation history and accumulated context.Example:Additional tool result messages to inject into the conversation.This is an advanced feature for programmatically adding tool execution results to the agent’s context without actually running the tools.
AbortSignal for canceling the agent run.Use with
AbortController to provide cancellation support. When aborted, the run will terminate and return an error output.Example:Cost optimization mode for the run.
'normal'(default): Standard execution- Other modes may be available depending on your Codebuff plan
Combined with CodebuffClientOptions
When callingclient.run(), you can override any CodebuffClientOptions on a per-run basis:
Complete Example
Return Type
Therun() method returns a Promise<RunState>:
Related Types
- CodebuffClient - Main client class
- AgentDefinition - Custom agent configuration
- MessageContent - Multimodal content types

