Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: CrewAI session handling not working #653

Open
1 of 3 tasks
areibman opened this issue Jan 20, 2025 · 0 comments
Open
1 of 3 tasks

[Bug]: CrewAI session handling not working #653

areibman opened this issue Jan 20, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@areibman
Copy link
Contributor

areibman commented Jan 20, 2025

Contact Details

No response

📦 Package Version

0.3.24

🎞️ Framework Version

CrewAI

🔎 Describe the Bug

There are issues with session management when implementing AgentOps for a CrewAI flow loop. The use case involves running a server that executes a CrewAI flow loop. Within this flow, there are two different crews, each of which can run multiple times within a single iteration.

All agents’ information for one iteration of the loop should be grouped into a single session for review purposes.

The following approach was used to manage sessions:

print(SESSION_ID)
if SESSION_ID is None:
    SESSION_ID = str(agentops.start_session().session_id)
else:
    try:
        agentops.start_session(inherited_session_id=SESSION_ID)
    except Exception as e:
        print("Error in starting session", e)
        SESSION_ID = agentops.start_session().session_id

Observed Behavior

This approach has resulted in the following issues:
• Session ID does not exist or is returned as None.
• Errors such as “Error in replacing UUID.”
• Inability to initialize new sessions using existing session IDs.

Another implementation using the following code also encountered problems:

for message in list:
    agentops.init(auto_start_session=False, skip_auto_end_session=True, default_tags=RUN_TAGS)
    agentops.start_session()
    result = (
        CrewAiCrew()
        .crew()
        .kickoff(inputs={})
    )
    agentops.end_session(end_state="Success")

🤝 Contribution

  • Yes, I'd be happy to submit a pull request with these changes.
  • I need some guidance on how to contribute.
  • I'd prefer the AgentOps team to handle this update.
@areibman areibman added the bug Something isn't working label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants