Agentic RL support cancel async call#1
Merged
Merged
Conversation
- Add detailed exception logging for sync and async HTTP streaming requests - Include request context such as url, method, stream, timeout, status code, and request id - Handle SSE done events consistently across streaming parsers - Avoid swallowing stream read failures while preserving original exception behavior - Fix pylint warning by avoiding redefinition of built-in id
This reverts commit 10b3fda.
This reverts commit 54dc3af.
This reverts commit 82d726a.
…timeout" This reverts commit d6de042.
This reverts commit 7f90814.
This reverts commit f3f0929.
This reverts commit 652f5e9.
This reverts commit cfa1adb.
This reverts commit dbbe5b2.
This reverts commit 2676efd.
Replace per-request aiohttp.ClientSession creation with a shared session pool (one per event loop) to enable HTTP connection reuse across async API calls. SSL context is cached and shared across all sessions. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Streaming requests were using aiohttp.ClientTimeout(total=...) which kills the connection after the deadline even if the model is still actively producing tokens. Switch to ClientTimeout(sock_read=...) for streaming requests so the timeout only triggers on idle connections (no data between chunks). Non-streaming requests still use total timeout. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Protect _shared_ssl_context lazy init and _aio_sessions dict access with an RLock to prevent race conditions in multi-threaded environments. Use RLock instead of Lock since get_shared_aio_session calls get_ssl_context while holding the lock. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Reapply/aiohttp fix
…e_shared_aio_session - Add optional `session` parameter to AioHttpRequest.__init__ for injecting external aiohttp.ClientSession (aligned with HttpRequest) - Add should_close lifecycle pattern to async request handlers in both AioHttpRequest and HttpRequest (consistent with sync _handle_request) - Export close_shared_aio_session from dashscope package for explicit connection pool cleanup Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
funasr support payload.input and bug fix in transcription
tiktoken's recursive BPE merging overflows the call stack on very long inputs, causing pyo3_runtime.PanicException: StackOverflow. Split text into chunks (<= 100k chars) at line boundaries before encoding. Short text takes the original fast path unchanged. Fixes dashscope#116
The server currently does not support session.finish event for qwen3.5-omni-flash-realtime, returning an error instead of session.finished. Previously end_session() would wait the full timeout duration (20s) before falling back to ws.close(). Now the method detects server error events immediately and closes the connection without waiting, reducing wait time from 20s to <0.1s when the server rejects session.finish. Related to issue dashscope#140
- Add trust_env=True to base_api.py async task polling (issue dashscope#112) - Extract user_agent from kwargs in api_request_factory to ensure incremental_to_full flag reaches HTTP header (issue dashscope#4) - Update test to verify user_agent doesn't leak into request body Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The SDK's exception handlers were logging exceptions at error level before re-raising, causing duplicate logs in user applications. Following PR dashscope#68 discussion, downgrade to debug level across audio/asr, audio/qwen_asr, and audio/tts_v2 modules. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Change raise e to bare raise in recognition.py and translation_recognizer.py to preserve original tracebacks - Fix vocabulary.py and enrollment.py catching asyncio/aiohttp exceptions despite using sync requests-based BaseApi; switch to requests.Timeout and requests.ConnectionError Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
BaseAsyncApi uses sync requests.Session() under the hood (the "Async" refers to DashScope server-side task polling, not Python async I/O). Switch from asyncio/aiohttp exceptions to requests.Timeout and requests.ConnectionError to ensure retry logic actually catches real network errors. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fix: downgrade redundant logger.error(e) to debug in audio modules
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
[Describe what this PR does and why]
Related Issue: Fixes #[issue_number] or Relates to #[issue_number]
Security Considerations: [Check if API keys or sensitive credentials are exposed in code/logs]
Type of Change
Component(s) Affected
Checklist
Testing
[How to test these changes]
Additional Notes
[Optional: any other context]