René's URL Explorer Experiment


Title: Qwen-Omni Realtime API - Invalid session.finish event, session failure on ws.close(), and VAD token consumption inquiry · Issue #140 · dashscope/dashscope-sdk-python · GitHub

Open Graph Title: Qwen-Omni Realtime API - Invalid session.finish event, session failure on ws.close(), and VAD token consumption inquiry · Issue #140 · dashscope/dashscope-sdk-python

X Title: Qwen-Omni Realtime API - Invalid session.finish event, session failure on ws.close(), and VAD token consumption inquiry · Issue #140 · dashscope/dashscope-sdk-python

Description: Context / Background I am using the Qwen3.5-Omni-Flash-Realtime model over a WebSocket connection. I reviewed the sample implementation provided in your repository at: https://github.com/aliyun/alibabacloud-bailian-speech-demo/blob/maste...

Open Graph Description: Context / Background I am using the Qwen3.5-Omni-Flash-Realtime model over a WebSocket connection. I reviewed the sample implementation provided in your repository at: https://github.com/aliyun/ali...

X Description: Context / Background I am using the Qwen3.5-Omni-Flash-Realtime model over a WebSocket connection. I reviewed the sample implementation provided in your repository at: https://github.com/aliyun/ali...

Opengraph URL: https://github.com/dashscope/dashscope-sdk-python/issues/140

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Qwen-Omni Realtime API - Invalid session.finish event, session failure on ws.close(), and VAD token consumption inquiry","articleBody":"### Context / Background\n\nI am using the **Qwen3.5-Omni-Flash-Realtime** model over a WebSocket connection. I reviewed the sample implementation provided in your repository at:\n`https://github.com/aliyun/alibabacloud-bailian-speech-demo/blob/master/samples/conversation/omni/python/run_server_vad.py`\n\n### Problem 1: Invalid `session.finish` event \u0026 Missing Graceful Shutdown\n\nWhen attempting to gracefully shut down the WebSocket connection, I tried sending a `session.finish` event type, same as the sdk of Realtime API specifications:\n\n```json\n{\n    \"event_id\": \"...\",\n    \"type\": \"session.finish\"\n}\n\n```\n\nHowever, the server returns an error stating that this is an **invalid event type**.\n\nLooking closely at your sample code (`run_server_vad.py`), it only calls `conversation.close()`, which internally just executes `ws.close()`. This abruptly terminates the WebSocket connection without a proper higher-level elegant handshake or session termination event.\n\n### Problem 2: Dashboard showing \"Failed\" sessions \u0026 Token usage tracking\n\nBecause the connection is abruptly killed via `ws.close()`, every single one of my Realtime API sessions is marked as **\"Failed\"** in my Qwen Cloud Console / DashScope Dashboard. This makes it extremely difficult to track my exact token usage, session histories, and accurate analytics.\n\n\u003cimg width=\"851\" height=\"527\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/c8c27fd5-5043-4b29-ac24-953268221dbd\" /\u003e\n\n\u003cimg width=\"452\" height=\"685\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/78feb200-61c3-4826-be89-1304775da247\" /\u003e\n\n* Is the rejection of `session.finish` expected behavior, or is there another protocol-compliant event to gracefully close a session?\n* Is there a bug on the server side that records abrupt `ws.close()` actions as session failures?\n\n---\n\n### Question 3: VAD Token Consumption\n\nAdditionally, I have a question regarding the Voice Activity Detection (VAD) mode.\nWhen VAD is enabled, **does the server consume any tokens during the idle state** (i.e., when the client is streaming background silence/noise before the actual speech or user message is triggered/recognized)?\n\n### Environment\n\n* Model: Qwen3.5-Omni-Flash-Realtime\n\nAny clarification or guidance on how to properly perform a graceful shutdown and understand VAD token mechanics would be greatly appreciated. Thank you!\n","author":{"url":"https://github.com/ptaejoon","@type":"Person","name":"ptaejoon"},"datePublished":"2026-06-15T10:21:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/140/dashscope-sdk-python/issues/140"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ba4786df-0eb9-cb91-db89-8806e3ec9f1e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8BDA:C1A48:276975:357A26:6A6290CC
html-safe-nonceca2b8e0438c64466afb61a6460b7eabaeb50d70ff9bcb99cea8225d93933f4ac
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkRBOkMxQTQ4OjI3Njk3NTozNTdBMjY6NkE2MjkwQ0MiLCJ2aXNpdG9yX2lkIjoiODM3ODYwOTE5MzM2NTcwNDkwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac5990aff60569accf238420a88d7fe2443c0334bfa5fcabbba9fe5262e352550a
hovercard-subject-tagissue:4664181500
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/dashscope/dashscope-sdk-python/140/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ec1ad0bf037f1e98cd9819d7e2c3df44660b2d08d188a3608e0fa9846d1f4ea3/dashscope/dashscope-sdk-python/issues/140
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ec1ad0bf037f1e98cd9819d7e2c3df44660b2d08d188a3608e0fa9846d1f4ea3/dashscope/dashscope-sdk-python/issues/140
og:image:altContext / Background I am using the Qwen3.5-Omni-Flash-Realtime model over a WebSocket connection. I reviewed the sample implementation provided in your repository at: https://github.com/aliyun/ali...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameptaejoon
hostnamegithub.com
expected-hostnamegithub.com
Noneac2209d8cb6970a1bd08cb0a3f821d7166ac544c2ca1c87819c335bb84310ecd
turbo-cache-controlno-preview
go-importgithub.com/dashscope/dashscope-sdk-python git https://github.com/dashscope/dashscope-sdk-python.git
octolytics-dimension-user_id127009744
octolytics-dimension-user_logindashscope
octolytics-dimension-repository_id944303085
octolytics-dimension-repository_nwodashscope/dashscope-sdk-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id944303085
octolytics-dimension-repository_network_root_nwodashscope/dashscope-sdk-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2fca8cd598678aaa64706088ad13b4e19177e108
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/dashscope/dashscope-sdk-python/issues/140#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdashscope%2Fdashscope-sdk-python%2Fissues%2F140
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdashscope%2Fdashscope-sdk-python%2Fissues%2F140
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=dashscope%2Fdashscope-sdk-python
Reloadhttps://github.com/dashscope/dashscope-sdk-python/issues/140
Reloadhttps://github.com/dashscope/dashscope-sdk-python/issues/140
Reloadhttps://github.com/dashscope/dashscope-sdk-python/issues/140
Please reload this pagehttps://github.com/dashscope/dashscope-sdk-python/issues/140
dashscope https://github.com/dashscope
dashscope-sdk-pythonhttps://github.com/dashscope/dashscope-sdk-python
Notifications https://github.com/login?return_to=%2Fdashscope%2Fdashscope-sdk-python
Fork 27 https://github.com/login?return_to=%2Fdashscope%2Fdashscope-sdk-python
Star 68 https://github.com/login?return_to=%2Fdashscope%2Fdashscope-sdk-python
Code https://github.com/dashscope/dashscope-sdk-python
Issues 0 https://github.com/dashscope/dashscope-sdk-python/issues
Pull requests 1 https://github.com/dashscope/dashscope-sdk-python/pulls
Actions https://github.com/dashscope/dashscope-sdk-python/actions
Projects https://github.com/dashscope/dashscope-sdk-python/projects
Security and quality 0 https://github.com/dashscope/dashscope-sdk-python/security
Insights https://github.com/dashscope/dashscope-sdk-python/pulse
Code https://github.com/dashscope/dashscope-sdk-python
Issues https://github.com/dashscope/dashscope-sdk-python/issues
Pull requests https://github.com/dashscope/dashscope-sdk-python/pulls
Actions https://github.com/dashscope/dashscope-sdk-python/actions
Projects https://github.com/dashscope/dashscope-sdk-python/projects
Security and quality https://github.com/dashscope/dashscope-sdk-python/security
Insights https://github.com/dashscope/dashscope-sdk-python/pulse
Qwen-Omni Realtime API - Invalid session.finish event, session failure on ws.close(), and VAD token consumption inquiryhttps://github.com/dashscope/dashscope-sdk-python/issues/140#top
https://github.com/ptaejoon
ptaejoonhttps://github.com/ptaejoon
on Jun 15, 2026https://github.com/dashscope/dashscope-sdk-python/issues/140#issue-4664181500
https://private-user-images.githubusercontent.com/17878758/607853015-c8c27fd5-5043-4b29-ac24-953268221dbd.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODQ4NDQ3OTMsIm5iZiI6MTc4NDg0NDQ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waXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNlNTIwMzVkNmU0ZDcxNWMwMjRmMDI2NzFlYjY2NGJmMTA4YmQ1YmNkZDQxZWFjNjFjOTgyOTU1ZjBmZGE2ZTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.kNXHqudLfxFsXWu06_QlbMtqqk6fmhmggGlLC7nwvc8
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.