Commit Graph
7 Commits
Author SHA1 Message Date
Xianzong Xie 5d59f47db4 refactor: extract should_use_polling_for_request to polling_handler module
Committed-By-Agent: cursor
2025-12-05 09:02:15 -08:00
Xianzong Xie 52d784b763 fix: correct mock setup for delete_polling test
- Use Mock instead of AsyncMock for init_async_client (sync method)

Committed-By-Agent: cursor
2025-12-04 18:00:28 -08:00
Xianzong Xie 03ee5c4489 test: add comprehensive tests for polling via cache feature
- Add TestPollingConditionChecks: tests for all condition combinations
- Add TestStreamingEventParsing: tests for OpenAI streaming event handling
- Add TestEdgeCases: tests for empty model, multiple slashes, edge cases

Total test count increased significantly for better coverage.

Committed-By-Agent: cursor
2025-12-04 17:55:38 -08:00
Xianzong Xie a8a38778a3 fix: resolve provider from router for polling_via_cache
- Fix bug where model names without slash (e.g., 'gpt-5') couldn't
  match providers in polling_via_cache list
- Look up model in llm_router.model_name_to_deployment_indices
- Check ALL deployments for matching provider (supports load balancing)
- Check custom_llm_provider first, then extract from model string
- Add comprehensive tests for provider resolution logic

Committed-By-Agent: cursor
2025-12-04 17:47:30 -08:00
Xianzong Xie 748bb6d5f5 test: add tests for all ResponsesAPIResponse fields
- Add test_update_state_with_all_responses_api_fields to verify all fields
- Add test_update_state_preserves_existing_fields to verify partial updates

Committed-By-Agent: cursor
2025-12-04 14:15:06 -08:00
Xianzong Xie 1c3c12bb1b refactor: move background_streaming_task to separate module
- Create new background_streaming.py in response_polling/
- Update endpoints.py to import from new location
- Update __init__.py to export background_streaming_task
- Add tests for module imports and structure

Committed-By-Agent: cursor
2025-12-03 22:50:26 -08:00
Xianzong Xie 540f14ef51 feat: improve polling via cache feature
- Add 150ms batched updates instead of per-event updates for better performance
- Handle response.output_text.delta events for text accumulation
- Add response.in_progress event handling for status updates
- Add response.completed event handling with reasoning, tools, tool_choice
- Remove unused output_item parameter from update_state
- Remove response.done event type (not valid in OpenAI spec)
- Remove documentation files
- Add comprehensive unit tests for ResponsePollingHandler

Committed-By-Agent: cursor
2025-12-03 18:37:28 -08:00