Register an action
Return type
Context
Actions receive an extended context that includes cached eval and enrichment results:| Field | Type | Description |
|---|---|---|
entries | object[] | Raw JSONL entries |
stats | EvalLogStats | Computed session stats |
projectName | string | Project name |
sessionId | string | Session ID |
source | string | "session" or "agent-{id}" |
evalResults | Record<string, EvalRunResult> | Cached eval results for the session |
enrichmentResults | Record<string, EnrichRunResult> | Cached enrichment results |
Options
| Option | Type | Default | Description |
|---|---|---|---|
condition | ConditionFunction | - | Per-action gate. Returns false → skipped. |
scope | 'session' | 'subagent' | 'both' | 'session' | Where the action appears |
subagentType | string | - | Only show for subagents of this type |
cache | boolean | true | Set to false for side-effect actions that should always re-run |
Examples
Export enrichment data to a file
For actions with side effects, setcache: false so the action always re-executes:
Conditional action
Subagent-scoped action
UI behavior
The Actions panel appears on session pages when matching actions are registered.- Shows all registered actions as idle on initial load; cached results display immediately
- Run button per action; Run All button in the panel header
outputis rendered in a scrollable monospace block with a copy-to-clipboard button- A “cached” badge appears for results served from cache
- Panel collapses by default; error count and loading spinners are visible in the header even when collapsed

