OMP Workbook

Read the source. Follow the evidence.

All 46 extension events

These are the complete supplied event names. Numbers follow the supplied inventory and make omissions easy to check.

Unless stated otherwise, a notification handler’s returned value does not control the operation.

Resources and session lifecycle

No.EventPayload/useSupported result
1resources_discovercwd, startup/reload reason; contribute resource pathsskillPaths, promptPaths, themePaths; requires host dispatch/consumption
2session_startInitial initialized session loadNotification
3session_before_switchReason new, resume or fork; optional target file{ cancel }
4session_switchCompleted switch; reason and previous fileNotification; reconstruct current state
5session_before_branchSelected user-message entry ID{ cancel, skipConversationRestore }
6session_branchBranch completed; previous fileNotification
7session_before_compactPreparation, branch entries, public instructions, signal{ cancel, compaction }
8session.compactingSession ID and messages about to be summarized{ context, prompt, preserveData }
9session_compactCompaction entry and fromExtensionNotification
10session_shutdownTeardownCleanup; concurrent bounded handlers
11session_before_treeTree preparation and signal{ cancel, summary }; summary used only when requested
12session_treeOld/new leaf, optional summary entry and originNotification

skipConversationRestore means the branch proceeds while in-memory conversation restoration is skipped. It is not cancellation.

For the cancelable pre-events, cancellation short-circuits. Otherwise the current generic runner retains the last returned result rather than deep-merging every handler’s object. session.compacting likewise uses the last returned result object; coordinate cooperating extensions.

Seed Desk reconstructs after lifecycle events. Review Desk invalidates pending authority before navigation.

Prompt and provider boundaries

No.EventPayload/useSupported result
13contextMessages before each model callReplacement { messages }, chained
14before_provider_requestProvider-specific logical payload; request model in contextReturn the replacement payload directly
15provider_requestFrozen event with final payloadJsonObservation only
16after_provider_responseStatus, headers, request ID, metadata before stream consumptionObservation only
17before_agent_startSubmitted prompt, images, current prompt blocksCustom message and/or replacement systemPrompt blocks
39inputInput text, images and source tag{ handled, text, images }; transforms chain, handled stops

before_provider_request replacements chain in load order. Provider-specific payloads are not one universal HTTP schema.

provider_request is the final logical JSON after those transforms, not exact transport bytes or headers. Returned values cannot change it. Extension observer errors are isolated and are not a reliable dispatch veto.

An embedding that requires a fail-closed final-payload check uses the awaited SDK onProviderRequest callback; rejection there stops dispatch before extension observers.

The supplied guide identifies devin-agent as a provider that does not fire the request hook. Provider implementation coverage must be checked when relying on these boundaries; no live provider was exercised for the workbook examples.

after_provider_response occurs before the response stream has yielded final assistant usage. Use a completed assistant message, commonly at turn_end, for actual turn token/cost accounting.

input source tags are interactive, rpc and extension. The runner supports all three labels, but that does not mean every host path emits the event. The supplied RPC/ACP prompt implementations do not themselves call emitInput(). Do not use it as a universal inbound-policy gateway.

In typed interactive input flow, naming a session from input can precede the normal first-message title check. That does not imply every initial CLI prompt takes the same path.

Agent, turn and message notifications

No.EventPayload/useSupported result
18agent_startAgent-loop startNotification
19agent_endMessages and optional willContinueNotification only
20session_stopMain-session settle context, turn/session IDs, last assistant, stop_hook_active, signal{ continue: true, additionalContext } or { decision: "block", reason }
21turn_startTurn index and timestampNotification
22turn_endCompleted turn message and tool resultsNotification; inspect completed usage here
23message_startA message beginsNotification
24message_updateAssistant message and streaming event/deltaNotification; keep handlers lightweight
25message_endDetached completed-message snapshotNotification, not a rewrite hook

A turn is one assistant response plus its associated tool results. A run can contain several turns and maintenance continuations.

session_stop:

  • is awaited at eligible main-session settle;
  • does not run for task/subagent sessions;
  • requires nonempty continuation context/reason;
  • is capped at eight consecutive continuations;
  • is deferred when automatic continuation or owner-scoped pending async work means the run is not truly finished;
  • can be cancelled through its signal.

Use stop_hook_active to avoid endlessly requesting the same extra pass.

Streaming notifications can be queued/detached relative to other host work. Do not base an authorization protocol on an assumed universal arrival order of every message and UI frame.

Tool execution and approval

No.EventPayload/useSupported result
26tool_execution_startCall ID, name, arguments, optional intentObservation
27tool_execution_updateCall identity, arguments and partial resultObservation
28tool_execution_endCall identity, result and error stateObservation
40tool_approval_requestedSession/call/tool IDs, optional reason, approval modeObservation
41tool_approval_resolvedSession/call/tool IDs, approved boolean, optional reasonObservation
42tool_callCall identity and normalized input before execution{ block, reason, input }
43tool_resultEffective input, content, details and error statePatch { content, details, isError }, chained

A tool_execution_start event does not prove the side effect happened; approval may still be pending.

Approval events are emitted when the wrapper reaches a required approval gate and relevant handlers are present. They are not a way to approve by returning a value.

Already-denied calls can short-circuit before tool_call. Schema failures, pre-execution blocks and approval denials do not necessarily traverse the post-execution tool_result path.

tool_call errors/timeouts fail closed. tool_result middleware can change what is reported, not reverse external effects.

Reliability and domain reminders

No.EventPayload/use
29auto_compaction_startReason: threshold, overflow, idle or incomplete; selected action
30auto_compaction_endAction, optional result, aborted/willRetry, optional error/skipped
31auto_retry_startAttempt, maximum attempts, delay, error message and optional error ID
32auto_retry_endSuccess, attempt, final error and optional retry-error presentation updates
33retry_fallback_appliedFrom/to model selectors and configured role
34retry_fallback_succeededFallback model and role that actually succeeded
35ttsr_triggeredRules whose stream matching interrupted generation
36todo_reminderUnfinished todos and reminder attempt information
37goal_updatedCurrent goal or null and optional goal-mode state
38credential_disabledProvider and truncated diagnostic cause for automatic credential soft-disable

These are observations, not return-value control hooks.

Compaction actions include context-full, remote, handoff, shake and snapcompact in the supplied event type. A skipped or aborted compaction is not a successful summary.

retry_fallback_applied means a candidate was selected. retry_fallback_succeeded distinguishes actual success.

credential_disabled is not fired for every user logout/removal. Startup events can be buffered until runtime initialization; the runner’s buffer is bounded at 32.

Human execution and MCP notifications

No.EventPayload/useSupported result
44user_bashCommand, cwd and whether !! excludes output from model contextFull replacement { result }
45user_pythonCode, cwd and whether $$ excludes output from model contextFull replacement { result }
46mcp_notificationRaw server name, method and unknown paramsNotification

user_bash concerns human !/!! execution, not every model bash tool or arbitrary pi.exec() call. user_python concerns the corresponding $/$$ user-code path.

The first returned user-execution result replaces default execution. Throwing is not a supported blocking result.

MCP notifications arrive after the manager’s known-method processing. Buffering is bounded at 100 with drop-oldest behavior at the supplied startup boundaries. Validate payloads and do not mistake notifications for durable authority.

Source, snapshot 2026-08-29: packages/coding-agent/src/extensibility/extensions/types.ts, all on overloads; packages/coding-agent/src/extensibility/shared-events.ts; runner.ts; wrapper.ts; packages/coding-agent/src/session/agent-session.ts; packages/coding-agent/src/session/bash-runner.ts; packages/coding-agent/src/modes/rpc/rpc-mode.ts.

Extensions inside those boundaries · Source chapter: extensions/all-46-extension-events. Original evidence remains scoped to its recorded snapshot.

Read this chapter as Markdown

Your lesson ticks

A self-reported reading checklist, not proof of real OMP behavior. Only these ticks are saved in this browser. Reading a milestone does not resume, fork, reset or export a session.

Chapters I have worked through
Start here 1
Sessions, resets, and reviewable history 19
Memory and reusable knowledge 14
Tangent work and live control 17
Tool permissions and approvals 15
Extensions inside those boundaries 23
Connections and next steps 8
0 of 97 checked

Checklist saving needs JavaScript and available browser storage.