Skip to content

fix: requests instrumentation fixes#23

Merged
sohankshirsagar merged 4 commits intomainfrom
sohan/fix-requests-instrumentation
Jan 12, 2026
Merged

fix: requests instrumentation fixes#23
sohankshirsagar merged 4 commits intomainfrom
sohan/fix-requests-instrumentation

Conversation

@sohankshirsagar
Copy link
Contributor

@sohankshirsagar sohankshirsagar commented Jan 11, 2026

Note

Shifts interception from Session.request to Session.send to cover all call paths, including direct session.send(PreparedRequest).

  • New handlers _handle_record_send and _handle_replay_send; extract kwargs from PreparedRequest via _extract_kwargs_from_prepared_request
  • Default and mock responses mark _content_consumed=True and replay path dispatches response hooks to match Requests behavior
  • E2E app adds endpoints for session-send-direct, streaming-iter-lines, and response-hooks; test runner invokes them

Written by Cursor Bugbot for commit 9ab1d73. This will update automatically on new commits. Configure here.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="drift/instrumentation/requests/instrumentation.py">

<violation number="1" location="drift/instrumentation/requests/instrumentation.py:185">
P3: Docstring documents `sdk` parameter that doesn't exist in the method signature. Remove the `sdk: TuskDrift instance` line from the Args section.</violation>
</file>

You're on the cubic free plan with 19 free PR reviews remaining this month. Upgrade for unlimited reviews.

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@sohankshirsagar
Copy link
Contributor Author

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!

@sohankshirsagar sohankshirsagar merged commit 34a539d into main Jan 12, 2026
14 checks passed
@sohankshirsagar sohankshirsagar deleted the sohan/fix-requests-instrumentation branch January 12, 2026 05:25
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