You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CURSOR_MEMORY.md
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,20 @@
2
2
3
3
## Key Lessons Learned
4
4
5
+
### 🚨 CRITICAL SDK BUG: trace_async Doesn't Support Async Generators
6
+
7
+
**STATUS**: This is a fundamental bug in the Openlayer SDK that needs immediate fixing. Users should NOT have to modify their code.
8
+
9
+
**The Bug**: `trace_async` decorator cannot handle async generator functions (functions that use `yield`). It tries to `await` an async generator function, which returns the generator object instead of the yielded values.
10
+
11
+
**Impact**:
12
+
- Logs `<async_generator object>` instead of actual content
13
+
- Wrong timing measurements
14
+
- Breaks user expectations for streaming functions
15
+
- Forces unnecessary code modifications
16
+
17
+
**Required Fix**: Use `inspect.isasyncgenfunction()` to detect async generators and handle them by consuming the generator while yielding values to maintain streaming behavior.
18
+
5
19
### Duplicate Trace Issue with Async Streaming
6
20
7
21
**Problem**: When using both `@trace()` decorator and `trace_async_openai()` together, duplicate traces are generated:
0 commit comments