René's URL Explorer Experiment


Title: Bug: RuntimeError: Event loop is closed when quitting TUI · Issue #558 · cecli-dev/cecli · GitHub

Open Graph Title: Bug: RuntimeError: Event loop is closed when quitting TUI · Issue #558 · cecli-dev/cecli

X Title: Bug: RuntimeError: Event loop is closed when quitting TUI · Issue #558 · cecli-dev/cecli

Description: Description When attempting to quit the cecli TUI, a RuntimeError: Event loop is closed is raised, causing the application to crash. Steps to Reproduce Start cecli TUI Attempt to quit (e.g., by pressing q or Ctrl+C) The following traceba...

Open Graph Description: Description When attempting to quit the cecli TUI, a RuntimeError: Event loop is closed is raised, causing the application to crash. Steps to Reproduce Start cecli TUI Attempt to quit (e.g., by pre...

X Description: Description When attempting to quit the cecli TUI, a RuntimeError: Event loop is closed is raised, causing the application to crash. Steps to Reproduce Start cecli TUI Attempt to quit (e.g., by pre...

Opengraph URL: https://github.com/cecli-dev/cecli/issues/558

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug: RuntimeError: Event loop is closed when quitting TUI","articleBody":"## Description\nWhen attempting to quit the cecli TUI, a `RuntimeError: Event loop is closed` is raised, causing the application to crash.\n\n## Steps to Reproduce\n1. Start cecli TUI\n2. Attempt to quit (e.g., by pressing `q` or Ctrl+C)\n3. The following traceback appears:\n\n```\nWould you like to see what's new in this version? (Y)es/(N)o [Yes]: n\nStarting cecli TUI...\n╭─────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ C:\\Users\\PDitty\\AppData\\Roaming\\uv\\tools\\cecli-dev\\Lib\\site-packages\\cecli\\tui\\app.py:1291 in _do_quit                                                                                                                                                          │\n│                                                                                                                                                                                                                                  │\n│   1288 │                                                                                                                       ╭───────────────────────────────────── locals ──────────────────────────────────────╮                                            │\n│   1289 │   def _do_quit(self):                                                                                                │ self = TUI(title='TUI', classes={'-dark-mode'}, pseudo_classes={'focus', 'dark'}) │                                            │\n│   1290 │   │   \"\"\"Perform the actual quit after UI updates.\"\"\"                                                                 ╰───────────────────────────────────────────────────────────────────────────────────╯                                            │\n│ ❱ 1291 │   │   self.worker.stop()                                                                                                                                                                                                                               │\n│   1292 │   │   self.exit()                                                                                                                                                                                                                                      │\n│   1293 │                                                                                                                                                                                                                                                    │\n│   1294 │   def run_obstructive(self, func, *args, **kwargs):                                                                                                                                                                                                    │\n│                                                                                                                                                                                                                                                                                       │\n│ C:\\Users\\PDitty\\AppData\\Roaming\\uv\\tools\\cecli-dev\\Lib\\site-packages\\cecli\\tui\\worker.py:190 in stop                                                                                                                                                            │\n│                                                                                                                                                                                                                                                                                       │\n│   187 │   │   │   # We'll just pass to allow the thread to exit gracefully                                                                                                                                                                            ╭────────────────────────────── locals ──────────────────────────────╮                                            │\n│   188 │   │   │   # without a scary traceback.                                                                                                                                                                                                         │ self = \u003ccecli.tui.worker.CoderWorker object at 0x000001F2BE3842F0\u003e │                                                            │\n│   189 │   │   │   pass                                                                                                                                                                                                                                   ╰────────────────────────────────────────────────────────────────────╯                                                            │\n│ ❱ 190 │   │   self.interrupt()                                                                                                                                                                                                                                  │\n│                                                                                                                                                                                                                                                                                       │\n│   191 │                                                                                                                                                                                                                                                                                       │\n│   192 │   # Wait for thread to finish                                                                                                                                                                                                                                        │\n│                                                                                                                                                                                                                                                                                       │\n│   193 │   if self.thread and self.thread.is_alive():                                                                                                                                                                                                                                       │\n│                                                                                                                                                                                                                                                                                       │\n│ C:\\Users\\PDitty\\AppData\\Roaming\\uv\\tools\\cecli-dev\\Lib\\site-packages\\cecli\\tui\\worker.py:160 in interrupt                                                                                                                                                       │\n│                                                                                                                                                                                                                                                                                       │\n│   157 │   │   if target_coder and hasattr(target_coder, \"io\") and target_coder.io:                                                                                                                                                                        ╭────────────────────────────────────────── locals ──────────────────────────────────────────╮                                    │\n│   158 │   │   # Cancel the output task if it exists                                                                                                                                                                                                   agent_service = \u003ccecli.helpers.agents.service.AgentService object at 0x000001F2BF46DFD0\u003e   │                                    │\n│   159 │   │   if hasattr(target_coder.io, \"output_task\") and target_coder.io.output_task:  │    foreground = \u003ccecli.coders.editblock_coder.EditBlockCoder object at 0x000001F30126C2D0\u003e │                                    │\n│ ❱ 160 │   │   │   target_coder.io.output_task.cancel()                                                                                                                                                                                                │ self = \u003ccecli.tui.worker.CoderWorker object at 0x000001F2BE3842F0\u003e                                               │\n│   161 │   │   │   # Also set output_running to False to stop the output_task loop          │    target_coder = \u003ccecli.coders.editblock_coder.EditBlockCoder object at 0x000001F30126C2D0\u003e │                                    │\n│   162 │   │   │   if hasattr(target_coder, \"output_running\"):                              ╰────────────────────────────────────────────────────────────────────────────────────────────╯                                                                   │\n│   163 │   │   │   │   target_coder.output_running = False                                                                                                                                                                                                   │\n│                                                                                                                                                                                                                                                                                       │\n│ D:\\Python\\Python3_13_9\\Lib\\asyncio\\base_events.py:833 in call_soon                                                                                                                                                                                                                             │\n│                                                                                                                                                                                                                                                                                                   │\n│    830 │   │   Any positional arguments after the callback will be passed to                    ╭──────────────────────────────────────── locals ────────────────────────────────────────╮                                       │\n│    831 │   │   the callback when it is called.                                                                                                                                                                                                         args = (\u003cFuture cancelled\u003e,)                                                       │\n│    832 │   │   \"\"\"                                                                                                                                                                                                                                        │\n│    833 │   │   callback = \u003cbuilt-in method task_wakeup of _asyncio.Task object at 0x000001F3025E4F70\u003e                                                                                                                                                                   │\n│ ❱ 833 │   │   self._check_closed()                                                                                                                                                                                                                                         │\n│    834 │   │   context = \u003c_contextvars.Context object at 0x000001F3019E3080\u003e                                                                                                                                                                                                │\n│                                                                                                                                                                                                                                                                                                   │\n│    835 │   │   if self._debug:                                                                                                                                                                                                                                              │\n│    836 │   │   │   self._check_thread()                                                                                                                                                                                                                                    │\n│    837 │   │   self = \u003c_WindowsSelectorEventLoop running=False closed=True debug=False\u003e                                                                                                                                                                                   ╰───────────────────────────────────────────────────────────────────────────────────────────╯                                                                      │\n│                                                                                                                                                                                                                                                                                                   │\n│    838 │   │   │   self._check_callback(callback, 'call_soon')                                                                                                                                                                                                             │\n│                                                                                                                                                                                                                                                                                                   │\n│ D:\\Python\\Python3_13_9\\Lib\\asyncio\\base_events.py:556 in _check_closed                                                                                                                                                                                                         │\n│                                                                                                                                                                                                                                                                                                   │\n│    553 │   │                                                                                                                                                                                                                                                                                                   │\n│    554 │   def _check_closed(self):                                                                                                                                                                                                                                                        │\n│    555 │   │   if self._closed:                                                                                                                                                                                                                                                              │\n│    556 │   │   │   raise RuntimeError('Event loop is closed')                                                                                                                                                                                                                               │\n```\n\n## Environment\n- **cecli version**: Latest (from cecli-dev)\n- **Python version**: 3.13.9\n- **OS**: Windows 11\n\n## Additional Context\nThe error occurs in the following call chain:\n1. `TUI._do_quit()` calls `self.worker.stop()`\n2. `CoderWorker.stop()` calls `self.interrupt()`\n3. `CoderWorker.interrupt()` attempts to cancel `target_coder.io.output_task`\n4. This triggers `asyncio.base_events.call_soon()` which calls `_check_closed()`\n5. The event loop is already closed, raising the `RuntimeError`\n\n## Expected Behavior\nThe TUI should quit gracefully without raising an exception.\n\n## Possible Fix\nThe issue appears to be a race condition where the event loop is closed before the output task is properly cancelled. A potential fix would be to check if the event loop is still running before attempting to cancel tasks.\n","author":{"url":"https://github.com/szmania","@type":"Person","name":"szmania"},"datePublished":"2026-06-05T19:52:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/558/cecli/issues/558"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b506cc22-bc9d-c66a-2eb5-68009bb831a2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id84A0:138E47:8AECFC:BE67E5:6A6129B0
html-safe-noncebcb804adcc853c15af59d51f9b2e228df5ce7808f3f622b160eb43ab49160149
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEEwOjEzOEU0Nzo4QUVDRkM6QkU2N0U1OjZBNjEyOUIwIiwidmlzaXRvcl9pZCI6Ijg4NDczMTY4NjEyNTQxODMzNDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac2f97a1b8ce8541e226656c1150ced1ad1d63e3cbc2e187f454cf6f1292c6ed18
hovercard-subject-tagissue:4599706771
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/cecli-dev/cecli/558/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7864a16369b11bdcd3571a9b85cab9b0610effa3487a96032e88dafd586a0110/cecli-dev/cecli/issues/558
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7864a16369b11bdcd3571a9b85cab9b0610effa3487a96032e88dafd586a0110/cecli-dev/cecli/issues/558
og:image:altDescription When attempting to quit the cecli TUI, a RuntimeError: Event loop is closed is raised, causing the application to crash. Steps to Reproduce Start cecli TUI Attempt to quit (e.g., by pre...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameszmania
hostnamegithub.com
expected-hostnamegithub.com
None6896275b704df9b9258326d49c8695aecd98d736cd9eeda7bcbb1790ac97d3ad
turbo-cache-controlno-preview
go-importgithub.com/cecli-dev/cecli git https://github.com/cecli-dev/cecli.git
octolytics-dimension-user_id250452847
octolytics-dimension-user_logincecli-dev
octolytics-dimension-repository_id1030985330
octolytics-dimension-repository_nwocecli-dev/cecli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id638629097
octolytics-dimension-repository_parent_nwoAider-AI/aider
octolytics-dimension-repository_network_root_id638629097
octolytics-dimension-repository_network_root_nwoAider-AI/aider
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
releaseaf89f6cd55841b57fa09b6b0ed9e3f8f2e94b05d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/cecli-dev/cecli/issues/558#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcecli-dev%2Fcecli%2Fissues%2F558
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%2Fcecli-dev%2Fcecli%2Fissues%2F558
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=cecli-dev%2Fcecli
Reloadhttps://github.com/cecli-dev/cecli/issues/558
Reloadhttps://github.com/cecli-dev/cecli/issues/558
Reloadhttps://github.com/cecli-dev/cecli/issues/558
Please reload this pagehttps://github.com/cecli-dev/cecli/issues/558
cecli-dev https://github.com/cecli-dev
ceclihttps://github.com/cecli-dev/cecli
Aider-AI/aiderhttps://github.com/Aider-AI/aider
Notifications https://github.com/login?return_to=%2Fcecli-dev%2Fcecli
Fork 44 https://github.com/login?return_to=%2Fcecli-dev%2Fcecli
Star 385 https://github.com/login?return_to=%2Fcecli-dev%2Fcecli
Code https://github.com/cecli-dev/cecli
Issues 30 https://github.com/cecli-dev/cecli/issues
Pull requests 9 https://github.com/cecli-dev/cecli/pulls
Actions https://github.com/cecli-dev/cecli/actions
Projects https://github.com/cecli-dev/cecli/projects
Security and quality 0 https://github.com/cecli-dev/cecli/security
Insights https://github.com/cecli-dev/cecli/pulse
Code https://github.com/cecli-dev/cecli
Issues https://github.com/cecli-dev/cecli/issues
Pull requests https://github.com/cecli-dev/cecli/pulls
Actions https://github.com/cecli-dev/cecli/actions
Projects https://github.com/cecli-dev/cecli/projects
Security and quality https://github.com/cecli-dev/cecli/security
Insights https://github.com/cecli-dev/cecli/pulse
Bug: RuntimeError: Event loop is closed when quitting TUIhttps://github.com/cecli-dev/cecli/issues/558#top
https://github.com/szmania
szmaniahttps://github.com/szmania
on Jun 5, 2026https://github.com/cecli-dev/cecli/issues/558#issue-4599706771
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.