Skip to content

Commit f1fe7ad

Browse files
Fix async tracing for generators and remove redundant example
Co-authored-by: vinicius <[email protected]>
1 parent c222515 commit f1fe7ad

File tree

2 files changed

+6
-73
lines changed

2 files changed

+6
-73
lines changed

CURSOR_MEMORY.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
3. **CRITICAL**: This breaks tests because tests are executed over both separate requests instead of one unified trace
1111

1212
**Root Cause**:
13-
- The `@trace()` and `trace_async()` decorators don't handle async generators properly
14-
- They capture the generator object itself as output, not the streamed content
15-
- `trace_async_openai()` creates separate traces for OpenAI calls
13+
- **CRITICAL**: `@trace_async()` is fundamentally broken for async generators
14+
- Cannot `await` an async generator function (returns generator object, not values)
15+
- Logs the generator object as output instead of actual streamed content
16+
- Records timing before generator is consumed (incorrect latency)
17+
- Never captures the actual yielded values
18+
- `trace_async_openai()` creates separate traces for OpenAI calls
1619
- This creates conflicting/duplicate trace data that confuses test execution
1720
- Tests expect single request but get two separate ones to validate
1821

fixed_async_example.md

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)