refactor: drop knowledge, code-execution and mcp interception points

Removes `knowledge_retrieval`, `pre_code_execution`, and `mcp_connect`
from the catalog — no concrete use case justifies them yet, and the mcp
seam had an observability gap (an abort fires before the connection
events, leaving no native record). The catalog now adds only `pre_step`
and `post_step` on top of the model/tool and execution-boundary points.
This commit is contained in:
Lucas Gomide
2026-07-14 04:39:18 -03:00
parent ef48447a25
commit b07a690cea
6 changed files with 5 additions and 97 deletions

View File

@@ -6,8 +6,8 @@ mode: "wide"
Interception hooks give you a single, uniform way to observe and modify CrewAI's
runtime at well-defined points — from the moment an execution starts, through
every model call, tool call, and knowledge lookup, down to the final output.
All points share one contract and one registration API.
every model call, tool call, and task or flow-method step, down to the final
output. All points share one contract and one registration API.
The four LLM/tool hooks documented in [LLM Hooks](/learn/llm-hooks) and
[Tool Hooks](/learn/tool-hooks) are the same mechanism. Their existing
@@ -101,14 +101,6 @@ behavior.
`PRE_STEP` / `POST_STEP` carry `ctx.kind` (`"task"` or `"flow_method"`) and
`ctx.step_name`.
### Subsystem points
| Point | When | `payload` |
|-------|------|-----------|
| `KNOWLEDGE_RETRIEVAL` | A knowledge query is issued | query |
| `PRE_CODE_EXECUTION` | Code is about to run (flow `ScriptAction`) | code string |
| `MCP_CONNECT` | An MCP client is about to connect | connection params |
## Aborting an operation
`HookAborted` carries a `reason` and an optional `source`. The `source` defaults