Skip to content

Conversation

@tgillam-do
Copy link
Collaborator

@tgillam-do tgillam-do commented Jan 16, 2026

There was a bug previously where maintaining a global state of traces resulted in mis-matched traces during concurrent requests. This change ensure that each request gets a separate trace object and ensures that concurrent requests work fine.

Validated with a 50 query test file with 5 concurrency.

Also removed examples/ folder as it is redundant with gradient-adk-templates.

- Remove unused request_id field from CapturedRequest (simplified from complex UUID correlation)
- Simplify _record_response to use single URL-based matching (foolproof for HTTP call boundaries)
- Simplify _record_request to return void (unused return value removed)
- Clean up imports and add __slots__ to CapturedRequest for memory efficiency
- Remove _ensure_state helper and simplify _get_state
- Update tests to match simplified API
@tgillam-do tgillam-do changed the title Fix concurrency Fix concurrency issues Jan 16, 2026
@tgillam-do tgillam-do merged commit e702a24 into main Jan 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants