feat: Fix o3-pro response parsing and implement HTTP transport recorder
- Fix o3-pro response parsing to use output_text convenience field - Replace respx with custom httpx transport solution for better reliability - Implement comprehensive PII sanitization to prevent secret exposure - Add HTTP request/response recording with cassette format for testing - Sanitize all existing cassettes to remove exposed API keys - Update documentation to reflect new HTTP transport recorder - Add test suite for PII sanitization and HTTP recording This change: 1. Fixes timeout issues with o3-pro API calls (was 2+ minutes, now ~15-22 seconds) 2. Properly captures response content without httpx.ResponseNotRead exceptions 3. Preserves original HTTP response format including gzip compression 4. Prevents future secret exposure with automatic PII sanitization 5. Enables reliable replay testing for o3-pro interactions Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
90
tests/openai_cassettes/o3_pro_content_capture.json
Normal file
90
tests/openai_cassettes/o3_pro_content_capture.json
Normal file
File diff suppressed because one or more lines are too long
172
tests/openai_cassettes/o3_pro_quick_test.json
Normal file
172
tests/openai_cassettes/o3_pro_quick_test.json
Normal file
File diff suppressed because one or more lines are too long
88
tests/openai_cassettes/o3_pro_simple_enhanced.json
Normal file
88
tests/openai_cassettes/o3_pro_simple_enhanced.json
Normal file
File diff suppressed because one or more lines are too long
53
tests/openai_cassettes/test_replay.json
Normal file
53
tests/openai_cassettes/test_replay.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"interactions": [
|
||||
{
|
||||
"request": {
|
||||
"content": {
|
||||
"input": [
|
||||
{
|
||||
"content": [
|
||||
{
|
||||
"text": "What is 2 + 2?",
|
||||
"type": "input_text"
|
||||
}
|
||||
],
|
||||
"role": "user"
|
||||
}
|
||||
],
|
||||
"model": "o3-pro-2025-06-10",
|
||||
"reasoning": {
|
||||
"effort": "medium"
|
||||
},
|
||||
"store": true
|
||||
},
|
||||
"method": "POST",
|
||||
"path": "/v1/responses",
|
||||
"url": "https://api.openai.com/v1/responses"
|
||||
},
|
||||
"response": {
|
||||
"content": {
|
||||
"created_at": 0,
|
||||
"id": "resp_SANITIZED",
|
||||
"model": "o3-pro-2025-06-10",
|
||||
"object": "response",
|
||||
"output": [
|
||||
{
|
||||
"text": "The answer to 2 + 2 is 4. This is a basic arithmetic operation where we add two whole numbers together.",
|
||||
"type": "output_text"
|
||||
}
|
||||
],
|
||||
"system_fingerprint": "fp_SANITIZED",
|
||||
"usage": {
|
||||
"input_tokens": 50,
|
||||
"output_tokens": 20,
|
||||
"total_tokens": 70
|
||||
}
|
||||
},
|
||||
"headers": {
|
||||
"content-type": "application/json"
|
||||
},
|
||||
"status_code": 200
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user