llm_call step, and tools
are declared with @tool, so every tool call is recorded as a tool_call step.
On a re-dispatch the agent runs from the top and recorded steps replay instead
of calling the model or the tool again.
Install
Model calls
CrewAI builds its own HTTP client, sohttp_client() can’t be passed in.
Instead, point the model’s base_url at a gateway that implements the
LLM call contract, and forward the dispatch
in headers so the gateway can record the call under it:
execution() reads the current dispatch, so build the LLM inside the handler.
examples/gateway/litellm_proxy.py
is a LiteLLM proxy callback that implements the gateway.
Tools
Apply CrewAI’stool decorator over Rebuno’s @tool. Rebuno’s wrapper keeps
the function’s signature and docstring, so CrewAI builds the tool schema from it
as usual:
at_most_once. See idempotency.
The agent
CrewAI’sAgent and Rebuno’s Agent share a name, so import one under an
alias:
What Rebuno adds
- Policy. Every model and tool call is checked against policy before it runs. A denied tool returns the rule’s reason to the model as the tool result, so the agent can take a different path.
- Approvals. A tool that requires approval parks the execution. Once it’s approved, the agent is dispatched again, the earlier steps replay, and the approved call runs.
- Recovery. If the worker dies partway through, the next dispatch replays every completed step and continues from the first one that didn’t finish. Model calls that already ran are not paid for twice.
Full example
examples/frameworks/python/crewai_agent.py
is a support agent that investigates a customer issue, creates a ticket, and
emails a summary after approval.