René's URL Explorer Experiment


Title: fix(runtime-core): avoid MCP tool discovery after agent cancellation (#450) by tkislan · Pull Request #457 · deepnote/deepnote · GitHub

Open Graph Title: fix(runtime-core): avoid MCP tool discovery after agent cancellation (#450) by tkislan · Pull Request #457 · deepnote/deepnote

X Title: fix(runtime-core): avoid MCP tool discovery after agent cancellation (#450) by tkislan · Pull Request #457 · deepnote/deepnote

Description: Fixes #450 Problem When an agent run is cancelled while MCP clients are still being created or while client.tools() is in flight, the handler continued into tool discovery and/or model streaming after the abort signal had already fired. Changes agent-handler.ts Add context.signal?.throwIfAborted() after retaining fulfilled MCP clients from Promise.allSettled, before checking for creation failures (abort wins over spawn errors). Add a second guard after client.tools() completes, before constructing the agent and starting the model stream. Existing finally cleanup is unchanged. execution-engine.ts Add optional ExecutionOptions.signal forwarded only to AgentBlockContext.signal. Does not interrupt code/SQL/kernel blocks; runProject / runFile still resolve with a failed agent block when the signal aborts. Tests Race tests for abort during pending createMCPClient and pending client.tools(). Engine forwarding tests and behavioral test that abort resolves with failedBlocks === 1. Docs Document signal in packages/runtime-core/README.md. Verification pnpm exec vitest run packages/runtime-core/src/execute-agent-block.test.ts packages/runtime-core/src/execution-engine.test.ts pnpm test pnpm typecheck pnpm biome:check Summary by CodeRabbit New Features Added cancellation support for agent block execution. Agent setup now stops promptly when cancellation occurs during initialization or tool discovery. Aborted agents report the cancellation reason and are recorded as failed blocks without rejecting the overall run. Code and SQL blocks continue to completion when an agent cancellation signal is triggered. Documentation Clarified cancellation scope and behavior for execution signals.

Open Graph Description: Fixes #450 Problem When an agent run is cancelled while MCP clients are still being created or while client.tools() is in flight, the handler continued into tool discovery and/or model streaming af...

X Description: Fixes #450 Problem When an agent run is cancelled while MCP clients are still being created or while client.tools() is in flight, the handler continued into tool discovery and/or model streaming af...

Opengraph URL: https://github.com/deepnote/deepnote/pull/457

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files/:range(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:648d949f-5034-34f1-4888-6764ae5ed0ad
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA250:1A7505:5D3177:7C90A9:6AEDBD66
html-safe-nonce4ab3254c16fb9816159fc5862cf172b673b4954fbb251848ba4146bede996b7f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjUwOjFBNzUwNTo1RDMxNzc6N0M5MEE5OjZBRURCRDY2IiwidmlzaXRvcl9pZCI6IjU4OTM2Njk1MzU0MzEzNzYyMzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc1217de60f4e8629caf99e837367a5b255f37893193460d282b7f5c0769aa6d2
hovercard-subject-tagpull_request:4277597220
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/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1
twitter:imagehttps://avatars.githubusercontent.com/u/5370798?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/5370798?s=400&v=4
og:image:altFixes #450 Problem When an agent run is cancelled while MCP clients are still being created or while client.tools() is in flight, the handler continued into tool discovery and/or model streaming af...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None1eb5f7cedbc707472687eab1a30e6c4619c00791815622ceaba9694eb161930f
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/deepnote/deepnote git https://github.com/deepnote/deepnote.git
octolytics-dimension-user_id45339858
octolytics-dimension-user_logindeepnote
octolytics-dimension-repository_id1066509034
octolytics-dimension-repository_nwodeepnote/deepnote
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1066509034
octolytics-dimension-repository_network_root_nwodeepnote/deepnote
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
releasef31f9c89203c022acdb651c34ae048cf41764208
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeepnote%2Fdeepnote%2Fpull%2F457%2Ffiles%2Fb1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1
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%2Fdeepnote%2Fdeepnote%2Fpull%2F457%2Ffiles%2Fb1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1
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=deepnote%2Fdeepnote
Reloadhttps://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1
Reloadhttps://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1
Reloadhttps://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1
deepnotehttps://github.com/deepnote
deepnotehttps://github.com/deepnote/deepnote
Codehttps://github.com/deepnote/deepnote
Issues14 (14)https://github.com/deepnote/deepnote/issues
Pull requests24 (24)https://github.com/deepnote/deepnote/pulls
Discussionshttps://github.com/deepnote/deepnote/discussions
Actionshttps://github.com/deepnote/deepnote/actions
Security and qualityhttps://github.com/deepnote/deepnote/security
Insightshttps://github.com/deepnote/deepnote/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fdeepnote%2Fdeepnote%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fdeepnote%2Fdeepnote%2Fissues%2Fnew%2Fchoose
tkislanhttps://github.com/tkislan
mainhttps://github.com/deepnote/deepnote/tree/main
cursor/avoid-mcp-tool-discovery-after-cancel-7f81https://github.com/deepnote/deepnote/tree/cursor/avoid-mcp-tool-discovery-after-cancel-7f81
Conversation 9 https://github.com/deepnote/deepnote/pull/457
Commits 5 https://github.com/deepnote/deepnote/pull/457/commits
Checks 20 https://github.com/deepnote/deepnote/pull/457/checks
Files changed https://github.com/deepnote/deepnote/pull/457/files
Please reload this pagehttps://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1
fix(runtime-core): avoid MCP tool discovery after agent cancellation (#450) https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#top
Show all changes 5 commits https://github.com/deepnote/deepnote/pull/457/files
3175207 feat(runtime-core): forward abort signal to agent block execution tkislan Aug 14, 2026 https://github.com/deepnote/deepnote/pull/457/commits/31752078909a12b26bc429387eff08cb567f5873
b1ec9db test(runtime-core): add abort guards and signal forwarding tests for … tkislan Aug 14, 2026 https://github.com/deepnote/deepnote/pull/457/commits/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1
8e08f16 refactor(runtime-core): tighten abort signal docs and tests tkislan Aug 27, 2026 https://github.com/deepnote/deepnote/pull/457/commits/8e08f16a6814f8652eeee6e2aa26d711d8eae1fc
6c08710 test(runtime-core): pin abort precedence over MCP startup failure tkislan Aug 27, 2026 https://github.com/deepnote/deepnote/pull/457/commits/6c0871017c82bd1020a256c2bbcdc476b594c416
07ac0d1 Merge branch 'main' into cursor/avoid-mcp-tool-discovery-after-cancel… tkislan Aug 28, 2026 https://github.com/deepnote/deepnote/pull/457/commits/07ac0d1746f42d90bb04a3ba4c4339c5dc53aab5
Clear filters https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1
Please reload this pagehttps://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1
Please reload this pagehttps://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1
README.md https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-1c89fe77575a901793d9b914d741b3393dc48162a2960b6f940d6018a4b13f41
agent-handler.ts https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-12157a650aa515e0db0ec6087599ad868f33fc1a1af2bf32c7242e1c1219004f
execute-agent-block.test.ts https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-aa15f6bbe9e7ae933cb339a6dd2ed7618c50828de9c5a2fc5584bbb52fb534a7
execution-engine.test.ts https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-0b627d37726333e896c042864adff1322f8bb6d41faa228b1a5f357d1ce805c0
execution-engine.ts https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-a98a106038f750a12d33bc3ad1423bcbe1a622f45ebff6a7655e10ed0b4489ed
https://github.com/deepnote/deepnote/blob/main/.github/CODEOWNERS#L2
packages/runtime-core/README.mdhttps://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-1c89fe77575a901793d9b914d741b3393dc48162a2960b6f940d6018a4b13f41
View file https://github.com/deepnote/deepnote/blob/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1/packages/runtime-core/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/deepnote/deepnote/pull/457/files/{{ revealButtonHref }}
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-1c89fe77575a901793d9b914d741b3393dc48162a2960b6f940d6018a4b13f41
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-1c89fe77575a901793d9b914d741b3393dc48162a2960b6f940d6018a4b13f41
https://github.com/deepnote/deepnote/blob/main/.github/CODEOWNERS#L2
packages/runtime-core/src/agent-handler.tshttps://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-12157a650aa515e0db0ec6087599ad868f33fc1a1af2bf32c7242e1c1219004f
View file https://github.com/deepnote/deepnote/blob/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1/packages/runtime-core/src/agent-handler.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/deepnote/deepnote/pull/457/files/{{ revealButtonHref }}
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-12157a650aa515e0db0ec6087599ad868f33fc1a1af2bf32c7242e1c1219004f
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-12157a650aa515e0db0ec6087599ad868f33fc1a1af2bf32c7242e1c1219004f
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-12157a650aa515e0db0ec6087599ad868f33fc1a1af2bf32c7242e1c1219004f
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-12157a650aa515e0db0ec6087599ad868f33fc1a1af2bf32c7242e1c1219004f
https://github.com/deepnote/deepnote/blob/main/.github/CODEOWNERS#L2
packages/runtime-core/src/execute-agent-block.test.tshttps://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-aa15f6bbe9e7ae933cb339a6dd2ed7618c50828de9c5a2fc5584bbb52fb534a7
View file https://github.com/deepnote/deepnote/blob/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1/packages/runtime-core/src/execute-agent-block.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/deepnote/deepnote/pull/457/files/{{ revealButtonHref }}
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-aa15f6bbe9e7ae933cb339a6dd2ed7618c50828de9c5a2fc5584bbb52fb534a7
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-aa15f6bbe9e7ae933cb339a6dd2ed7618c50828de9c5a2fc5584bbb52fb534a7
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-aa15f6bbe9e7ae933cb339a6dd2ed7618c50828de9c5a2fc5584bbb52fb534a7
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-aa15f6bbe9e7ae933cb339a6dd2ed7618c50828de9c5a2fc5584bbb52fb534a7
https://github.com/deepnote/deepnote/blob/main/.github/CODEOWNERS#L2
packages/runtime-core/src/execution-engine.test.tshttps://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-0b627d37726333e896c042864adff1322f8bb6d41faa228b1a5f357d1ce805c0
View file https://github.com/deepnote/deepnote/blob/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1/packages/runtime-core/src/execution-engine.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/deepnote/deepnote/pull/457/files/{{ revealButtonHref }}
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-0b627d37726333e896c042864adff1322f8bb6d41faa228b1a5f357d1ce805c0
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-0b627d37726333e896c042864adff1322f8bb6d41faa228b1a5f357d1ce805c0
https://github.com/deepnote/deepnote/blob/main/.github/CODEOWNERS#L2
packages/runtime-core/src/execution-engine.tshttps://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-a98a106038f750a12d33bc3ad1423bcbe1a622f45ebff6a7655e10ed0b4489ed
View file https://github.com/deepnote/deepnote/blob/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1/packages/runtime-core/src/execution-engine.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/deepnote/deepnote/pull/457/files/{{ revealButtonHref }}
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-a98a106038f750a12d33bc3ad1423bcbe1a622f45ebff6a7655e10ed0b4489ed
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-a98a106038f750a12d33bc3ad1423bcbe1a622f45ebff6a7655e10ed0b4489ed
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-a98a106038f750a12d33bc3ad1423bcbe1a622f45ebff6a7655e10ed0b4489ed
https://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1#diff-a98a106038f750a12d33bc3ad1423bcbe1a622f45ebff6a7655e10ed0b4489ed
Please reload this pagehttps://github.com/deepnote/deepnote/pull/457/files/b1ec9dbf6bcf2dbf3f1bfff66f3f4433e29596c1
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.