Skip to main content
Display callbacks let you react to agent events — tool calls, LLM turns, errors — without changing agent logic. The user runs the agent; display callbacks fire on tool calls, LLM turns, and errors for custom terminals or dashboards.

How It Works

Quick Start

1

Register a callback

2

Log tool calls

3

Async callback for dashboards

Callback Types

Register with register_display_callback(type, fn, is_async=False). Alias: add_display_callback.

Configuration Options

Callbacks receive keyword arguments matching the event (for example message, response, tool_name, agent_name). Extra kwargs are filtered to the function signature automatically.

Best Practices

Display callbacks run on the hot path. Log or enqueue work — avoid heavy I/O in sync handlers.
Set is_async=True when writing to WebSockets, Slack, or dashboards so the agent loop stays responsive.
A failing callback should not crash the agent. Catch, log, and return.
Use display callbacks for output formatting; use hooks when you need to allow, block, or mutate tool calls.

Display System

TaskOutput, terminal rendering, and global registries

Callbacks

Broader callback patterns for agents and tasks