Skip to content

Adding Weave causes CrewAI "kickoff" to hang #5158

@ChuckJonas

Description

@ChuckJonas

Adding weave into my setup is causes CrewAI "kickoff" to hang indefinitely. I get a pending crewai.Crew.kickoff log that never finishes and the crew never proceeds.

Running the following code results in the process hanging after it logs the kickoff (until I kill it). Removing the weave.init and the process completes in seconds.

Image

Image

Reproduction Example

import dotenv
from crewai import Agent, Task, Crew, Process, LLM
import weave

dotenv.load_dotenv()

llm = LLM(model="bedrock/us.anthropic.claude-3-7-sonnet-20250219-v1:0", temperature=0.7)


def create_simple_agents():
    """Create a very simple agent for testing"""

    simple_agent = Agent(
        role="Test Agent",
        goal="Answer simple questions",
        backstory="You are a helpful test agent that provides brief answers to questions.",
        llm=llm,
        verbose=True,
        allow_delegation=False,
    )

    return simple_agent


def create_simple_task(user_query, agent):
    """Create a simple task"""

    task = Task(
        description=f"Answer this question briefly: {user_query}",
        agent=agent,
        expected_output="A brief, helpful answer to the user's question.",
    )

    return task


def test_with_weave():
    """Test crew execution with weave - this should hang"""

    # Initialize weave - this is where the problem likely occurs
    weave.init("weave-bug-testing")
    print("Weave initialized successfully")

    # Create agent and task
    agent = create_simple_agents()
    task = create_simple_task("What is 3+3?", agent)

    # Create crew
    crew = Crew(
        agents=[agent],
        tasks=[task],
        process=Process.sequential,
        verbose=True,
    )

    # Execute crew - this is where it should hang
    print("Starting crew execution with weave...")
    result = crew.kickoff()
    print(f"Result: {result.raw}")


if __name__ == "__main__":
    test_with_weave()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions