AgentOps-AI / AgentOps-AI/agentops

[Bug]: Prevent blocking on `start_session` and `end_session`

Đang mở
#535 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
5.8k
Fork
619
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Contact Details

_No response_

### 📦 Package Version

0.3.18

### 🎞️ Framework Version

_No response_

### 🔎 Describe the Bug

Currently, `start_session` and `end_session` are blocking on the main thread. This is because start_session fetches a JWT which can take some time. We can move this to `agentops.init` to speed things up.

Additionally, `end_session` runs a flush. We can probably make this more of a "fire and forget" style signal. That is, when the `SessionExporter` sees an end_session event, it doesn't need to trigger a flush. We can just reserve the flush for SIGINT and program exit.

### 🤝 Contribution

- [ ] Yes, I'd be happy to submit a pull request with these changes.
- [ ] I need some guidance on how to contribute.
- [X] I'd prefer the AgentOps team to handle this update.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.