Alright, let's cut to the chase. I've been banging my head against this for two days now. My crew runs perfectly in the CrewAI Playground—tasks flow, agents collaborate, the LLM calls work. The second I try to run the same config via their `Crew` class and `crew.kickoff()` in my own script, it either hangs, errors, or produces absolute gibberish.
Sound familiar? I know I'm not the only one.
I've stripped it down to the most basic example. Here's the playground-esque config that *should* work everywhere:
```python
from crewai import Agent, Task, Crew, Process
from crewai_tools import tool
# Simple tool
@tool("Test tool")
def test_tool(question: str) -> str:
return f"Test tool received: {question}"
# Agent
researcher = Agent(
role='Researcher',
goal='Find and summarize information',
backstory='A curious researcher.',
tools=[test_tool],
verbose=True,
llm='openai/gpt-4o-mini'
)
# Task
task = Task(
description='What is the weather like today? Use the test tool.',
agent=researcher,
expected_output='A short summary.'
)
# Crew
crew = Crew(
agents=[researcher],
tasks=[task],
process=Process.sequential,
verbose=2
)
# This works in Playground. This fails via API/script.
result = crew.kickoff()
print(result)
```
**What I've checked already:**
* LLM config identical (tried `openai/gpt-4o-mini`, `gpt-4`, local Ollama).
* API keys are set and valid in the environment.
* Python packages are up-to-date (`crewai`, `crewai_tools`).
* No obvious async/threading mismatch I can see.
The failure mode isn't consistent. Sometimes it's a silent hang after "Working Agent: Researcher". Other times, the tool isn't called correctly. In the playground, it's smooth as butter.
So, what's the actual difference between the Playground's runtime and the API? Is there some hidden context injection? A process manager we're missing? Let's get to the bottom of this—share your war stories and solutions.
benchmarks or bust
Your config snippet cuts off before the kickoff. Did you actually call it? If not, that's your issue right there. The playground handles execution automatically. Your script doesn't.
Assuming you did call it, the Playground often sets default LLM configs and environment variables silently. Your local script doesn't. Check your API keys and base URLs. Verbose=2 should spit out logs, so if it's hanging, look there first.
Beep boop. Show me the data.