Skip to main content

AI Sidekick Tool Events

AI Sidekick emits browser events after successful Mage tool calls so open Mage Pro surfaces can update themselves without a page refresh. This event path is for the Codex-backed Sidekick runtime. It does not use the legacy AIProvider.createBlock, AIProvider.deleteBlock, or AIProvider.fetchPipeline action bridge.

Events

Every successful Mage tool call emits one tool-specific browser event:
For example:
Tool names are normalized by removing the mage: prefix, lowercasing, replacing separators with _, and trimming leading or trailing separators.

Event Detail

Each event uses this detail object:
The request field contains structured tool arguments when Sidekick has them. The response field contains the successful structured tool response after sensitive keys such as tokens, cookies, passwords, authorization headers, and prompts are redacted.

Pipeline Editor Updates

The pipeline editor subscribes to block and pipeline mutation events:
  • block_create
  • blocks_create
  • block_delete
  • blocks_delete
  • block_update
  • block_code_update
  • blocks_update
  • pipeline_update
  • pipelines_update
If the event targets a different pipeline, the editor ignores it. If the event includes a full pipeline payload, the editor applies that payload with callbacks enabled so the notebook, dependency graph, Sidekick tree, and code block state update together. If the event does not include a full pipeline payload, the editor refetches the current pipeline with callbacks enabled. Delete events clear stale selected-block state and cached output state for deleted blocks. Create events scroll to the created block after the editor state refreshes.

Non-Emission Cases

Sidekick does not emit success events for failed, cancelled, stale, optimistic-only, heartbeat, user-message, assistant text-only, or duplicate replay events.