René's URL Explorer Experiment


Title: Fail loudly instead of hanging forever when no frontend connects (#281) by sspickle · Pull Request #292 · vpython/vpython-jupyter · GitHub

Open Graph Title: Fail loudly instead of hanging forever when no frontend connects (#281) by sspickle · Pull Request #292 · vpython/vpython-jupyter

X Title: Fail loudly instead of hanging forever when no frontend connects (#281) by sspickle · Pull Request #292 · vpython/vpython-jupyter

Description: Addresses the worst half of #281: in any notebook frontend that never runs vpython's injected JavaScript — VS Code notebooks and Google Colab being the common cases — import vpython busy-waited forever on the websocket handshake, silently hanging the kernel. This does not make VPython work in those environments (that's the renderer/adapter work, tracked separately) — it converts an indefinite silent hang into a prompt, actionable error. What changes The unbounded while (not wsConnected): sleep(0.1) at import time in with_notebook.py becomes a bounded wait — default 30 s, overridable via VPYTHON_CONNECT_TIMEOUT for genuinely slow first-runs (nbextension transfer on cold environments). On timeout it raises RuntimeError with a message that: names the detected environment (VS Code via VSCODE_PID/VSCODE_CWD, Colab via COLAB_RELEASE_TAG/COLAB_GPU, or a generic explanation), says where VPython does work (Jupyter Notebook / JupyterLab in a browser), links this issue, and mentions the timeout override. The wait lives in a new pure-python helper (vpython/_frontend_wait.py) with injected clock/sleep/environ, so it's fully unit-tested (6 new tests; suite now 14) without any kernel or websocket machinery. Not changed Normal Jupyter/Lab flows are unaffected — the wait still returns the moment the frontend connects, typically within a couple of seconds. 🤖 Generated with Claude Code https://claude.ai/code/session_01G7y9rTA1r8r8EhEnPSQenR

Open Graph Description: Addresses the worst half of #281: in any notebook frontend that never runs vpython's injected JavaScript — VS Code notebooks and Google Colab being the common cases — import vpython busy-waited...

X Description: Addresses the worst half of #281: in any notebook frontend that never runs vpython's injected JavaScript — VS Code notebooks and Google Colab being the common cases — import vpython busy-wa...

Opengraph URL: https://github.com/vpython/vpython-jupyter/pull/292

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:36ebc1ce-628e-5dcf-931b-e5d6f44ceac2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9910:29BE96:1423ED:1B3510:6B0081BB
html-safe-nonce33179b82edcebea920ef288e3cab52f873876fa5653c601bc56703231504c0fc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTEwOjI5QkU5NjoxNDIzRUQ6MUIzNTEwOjZCMDA4MUJCIiwidmlzaXRvcl9pZCI6IjcwNjIzMjk3MjQzNTczNDU3MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacabf3fda000ce9ba58fabfb940565d5858a9145529ce8663e018a6dea64cff165
hovercard-subject-tagpull_request:4289817616
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/vpython/vpython-jupyter/pull/292/files
twitter:imagehttps://avatars.githubusercontent.com/u/1708412?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1708412?s=400&v=4
og:image:altAddresses the worst half of #281: in any notebook frontend that never runs vpython's injected JavaScript — VS Code notebooks and Google Colab being the common cases — import vpython busy-waited...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None82c186f13e104004ab7bdb779f3195e59dd38bfde531aaa74b76470fc2462b83
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/vpython/vpython-jupyter git https://github.com/vpython/vpython-jupyter.git
octolytics-dimension-user_id1280757
octolytics-dimension-user_loginvpython
octolytics-dimension-repository_id187905226
octolytics-dimension-repository_nwovpython/vpython-jupyter
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id187905226
octolytics-dimension-repository_network_root_nwovpython/vpython-jupyter
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released1bc2aa1939001689f5ce935982c10a6138f745c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/vpython/vpython-jupyter/pull/292/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvpython%2Fvpython-jupyter%2Fpull%2F292%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvpython%2Fvpython-jupyter%2Fpull%2F292%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=vpython%2Fvpython-jupyter
Reloadhttps://github.com/vpython/vpython-jupyter/pull/292/files
Reloadhttps://github.com/vpython/vpython-jupyter/pull/292/files
Reloadhttps://github.com/vpython/vpython-jupyter/pull/292/files
vpythonhttps://github.com/vpython
vpython-jupyterhttps://github.com/vpython/vpython-jupyter
Codehttps://github.com/vpython/vpython-jupyter
Issues26 (26)https://github.com/vpython/vpython-jupyter/issues
Pull requests4 (4)https://github.com/vpython/vpython-jupyter/pulls
Actionshttps://github.com/vpython/vpython-jupyter/actions
Projectshttps://github.com/vpython/vpython-jupyter/projects
Security and qualityhttps://github.com/vpython/vpython-jupyter/security
Insightshttps://github.com/vpython/vpython-jupyter/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fvpython%2Fvpython-jupyter%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fvpython%2Fvpython-jupyter%2Fissues%2Fnew%2Fchoose
sspicklehttps://github.com/sspickle
masterhttps://github.com/vpython/vpython-jupyter/tree/master
fix/281-frontend-connect-timeouthttps://github.com/vpython/vpython-jupyter/tree/fix/281-frontend-connect-timeout
Conversation 0 https://github.com/vpython/vpython-jupyter/pull/292
Commits 1 https://github.com/vpython/vpython-jupyter/pull/292/commits
Checks 13 https://github.com/vpython/vpython-jupyter/pull/292/checks
Files changed https://github.com/vpython/vpython-jupyter/pull/292/files
Please reload this pagehttps://github.com/vpython/vpython-jupyter/pull/292/files
Fail loudly instead of hanging forever when no frontend connects (#281) https://github.com/vpython/vpython-jupyter/pull/292/files#top
Show all changes 1 commit https://github.com/vpython/vpython-jupyter/pull/292/files
5774de4 fix: import vpython no longer hangs forever when no frontend connects… sspickle Aug 16, 2026 https://github.com/vpython/vpython-jupyter/pull/292/commits/5774de4a6c6c9136f7aed4f5642afb1cef7b4340
Clear filters https://github.com/vpython/vpython-jupyter/pull/292/files
Please reload this pagehttps://github.com/vpython/vpython-jupyter/pull/292/files
Please reload this pagehttps://github.com/vpython/vpython-jupyter/pull/292/files
_frontend_wait.py https://github.com/vpython/vpython-jupyter/pull/292/files#diff-06e3162e157f3f763ff4573f431d8f222f95e0b1bac862fe6b99f83b11e6fecb
test_frontend_wait.py https://github.com/vpython/vpython-jupyter/pull/292/files#diff-0d850d09e51f23210b6f0ad0cfbdc2e0c94ee580fcaa06ae5481d1677cc6457b
with_notebook.py https://github.com/vpython/vpython-jupyter/pull/292/files#diff-983b7d55f163bc1a727ff09ba4eb78bb27f89f7037295068343d233aa7a7613a
vpython/_frontend_wait.pyhttps://github.com/vpython/vpython-jupyter/pull/292/files#diff-06e3162e157f3f763ff4573f431d8f222f95e0b1bac862fe6b99f83b11e6fecb
View file https://github.com/vpython/vpython-jupyter/blob/5774de4a6c6c9136f7aed4f5642afb1cef7b4340/vpython/_frontend_wait.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/vpython/vpython-jupyter/pull/292/{{ revealButtonHref }}
vpython/test/test_frontend_wait.pyhttps://github.com/vpython/vpython-jupyter/pull/292/files#diff-0d850d09e51f23210b6f0ad0cfbdc2e0c94ee580fcaa06ae5481d1677cc6457b
View file https://github.com/vpython/vpython-jupyter/blob/5774de4a6c6c9136f7aed4f5642afb1cef7b4340/vpython/test/test_frontend_wait.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/vpython/vpython-jupyter/pull/292/{{ revealButtonHref }}
vpython/with_notebook.pyhttps://github.com/vpython/vpython-jupyter/pull/292/files#diff-983b7d55f163bc1a727ff09ba4eb78bb27f89f7037295068343d233aa7a7613a
View file https://github.com/vpython/vpython-jupyter/blob/5774de4a6c6c9136f7aed4f5642afb1cef7b4340/vpython/with_notebook.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/vpython/vpython-jupyter/pull/292/{{ revealButtonHref }}
https://github.com/vpython/vpython-jupyter/pull/292/files#diff-983b7d55f163bc1a727ff09ba4eb78bb27f89f7037295068343d233aa7a7613a
https://github.com/vpython/vpython-jupyter/pull/292/files#diff-983b7d55f163bc1a727ff09ba4eb78bb27f89f7037295068343d233aa7a7613a
Please reload this pagehttps://github.com/vpython/vpython-jupyter/pull/292/files
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.