René's URL Explorer Experiment


Title: fix(mothership): report a browser-claimed workflow tool from its settled execution by waleedlatif1 · Pull Request #8481 · simstudioai/sim · GitHub

Open Graph Title: fix(mothership): report a browser-claimed workflow tool from its settled execution by waleedlatif1 · Pull Request #8481 · simstudioai/sim

X Title: fix(mothership): report a browser-claimed workflow tool from its settled execution by waleedlatif1 · Pull Request #8481 · simstudioai/sim

Description: Summary Problem. When the browser claims a Chat workflow tool (run_workflow and friends), a tab that closes, loses its network, or drops its pagehide beacon leaves the Chat turn waiting for the full client wait, even though the workflow itself finished. Root cause. /api/workflows/[id]/execute takes the single-winner execution claim for the tool call and keeps running the workflow after the browser detaches. Only the browser's confirmation marked the tool call complete, though. With no confirmation, the call stayed running under the execution's claim until the worker swept it. Fix. Once a claimed execution settles, the execute route reports its outcome. reportSettledClientWorkflowTool reads the trusted execution log, builds the same structural completion the browser would send, and records it through a new completeClientWorkflowToolCall. That write only applies while the call is still running under this execution's claim (completeClaimedAsyncToolCall). A confirmation is published only when this write wins, so a browser report or background detach that lands first is kept and the waiting turn never gets two deliveries. If the report fails, the route logs a warning and leaves the call to the existing client path. Behaviour changes A browser-claimed workflow tool now reaches the waiting Chat turn as soon as its execution settles, whether or not the browser is still there. A browser report or a pagehide background detach that lands first still wins. The settled-execution report does nothing in that case. A queued async run (async: true) is moved to the background by the route once it is queued, the same report the browser sends after the 202. A bound execution that ended before it wrote any log is reported as failed, matching the browser's stream-error report. A paused run (non-terminal log) is still left to the client. A call claimed by a different execution is never completed by a stray execution. Workflows that were not claimed for a Copilot tool call run exactly as before. Test plan workflow-client-settlement.integration.ts against real Postgres: a completed, failed, or cancelled run reaches the waiting turn when the browser never reports; an earlier browser report is kept; a pagehide detach is kept; a stray execution cannot complete another execution's call; an execution with no log is reported failed while a paused one is left alone; a queued async run is moved to the background, and a browser report that landed first is kept Related unit suites (app/api/workflows, lib/mothership/request/tools, lib/mothership/async-runs) pass bun run type-check, biome, check:test-patterns, check:api-validation:strict Staging: close the tab mid-run on a Chat run_workflow call and confirm the turn continues when the run settles

Open Graph Description: Summary Problem. When the browser claims a Chat workflow tool (run_workflow and friends), a tab that closes, loses its network, or drops its pagehide beacon leaves the Chat turn waiting for the ful...

X Description: Summary Problem. When the browser claims a Chat workflow tool (run_workflow and friends), a tab that closes, loses its network, or drops its pagehide beacon leaves the Chat turn waiting for the ful...

Opengraph URL: https://github.com/simstudioai/sim/pull/8481

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:60e52fe3-4d40-f2d9-d4da-9dc2d30d0f58
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA2A8:3743C5:39C296:4F4FED:6AFB994B
html-safe-noncec6d8f7c6770f5e812c148e61a65b0ac4121f537b52984a5992759c7ff641c002
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkE4OjM3NDNDNTozOUMyOTY6NEY0RkVEOjZBRkI5OTRCIiwidmlzaXRvcl9pZCI6IjYxMTY4NDAwODYyODY2MDQ2MTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac634e5ec3aca6549f29831d7de619723978525884a7d062372eb5fca14d7ea306
hovercard-subject-tagpull_request:4696583919
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/simstudioai/sim/pull/8481/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary Problem. When the browser claims a Chat workflow tool (run_workflow and friends), a tab that closes, loses its network, or drops its pagehide beacon leaves the Chat turn waiting for the ful...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None3cefd19a936819d82cfb5279d50fb56fe79cb9ec30f0f807e04e89b0c58ffae1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
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
release606800bdb1b81d125fc845bdcc262c9fe063fc8f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/8481/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8481%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%2Fsimstudioai%2Fsim%2Fpull%2F8481%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=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/8481/files
Reloadhttps://github.com/simstudioai/sim/pull/8481/files
Reloadhttps://github.com/simstudioai/sim/pull/8481/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests199 (199)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
fix/client-claimed-tool-livenesshttps://github.com/simstudioai/sim/tree/fix/client-claimed-tool-liveness
Conversation 31 https://github.com/simstudioai/sim/pull/8481
Commits 6 https://github.com/simstudioai/sim/pull/8481/commits
Checks 31 https://github.com/simstudioai/sim/pull/8481/checks
Files changed https://github.com/simstudioai/sim/pull/8481/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8481/files
fix(mothership): report a browser-claimed workflow tool from its settled execution https://github.com/simstudioai/sim/pull/8481/files#top
Show all changes 6 commits https://github.com/simstudioai/sim/pull/8481/files
cc7fc81 fix(mothership): report a browser-claimed workflow tool from its sett… waleedlatif1 Sep 30, 2026 https://github.com/simstudioai/sim/pull/8481/commits/cc7fc81b7e27c246e0c3b28322ff48aece5253f3
3b8825a fix(mothership): report queued async runs and pre-log failures of a b… waleedlatif1 Sep 30, 2026 https://github.com/simstudioai/sim/pull/8481/commits/3b8825a4adb0fa2af70d6bc3024ed1d047069d83
8ae2f01 refactor(mothership): settle a browser-claimed workflow tool from its… waleedlatif1 Sep 30, 2026 https://github.com/simstudioai/sim/pull/8481/commits/8ae2f012c9c78a0b6f274579222da20eebd75a4b
0e8e447 Merge remote-tracking branch 'origin/staging' into fix/client-claimed… waleedlatif1 Sep 30, 2026 https://github.com/simstudioai/sim/pull/8481/commits/0e8e44739f16eebd85b1bb291cc931b3196e2de6
048bd3c test(mothership): prove a losing settlement report publishes no confi… waleedlatif1 Sep 30, 2026 https://github.com/simstudioai/sim/pull/8481/commits/048bd3c81fbcee0fd28c981f307b24f2cf34c239
6e9ee1b Merge remote-tracking branch 'origin/staging' into fix/client-claimed… waleedlatif1 Sep 30, 2026 https://github.com/simstudioai/sim/pull/8481/commits/6e9ee1b3488571325a9c5bdf856cc04b361b62a4
Clear filters https://github.com/simstudioai/sim/pull/8481/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8481/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8481/files
route.ts https://github.com/simstudioai/sim/pull/8481/files#diff-66f204feb589208a932d4b6c514237d545b8f1e9746092bbc35345f49570a9be
repository.ts https://github.com/simstudioai/sim/pull/8481/files#diff-bdd330821217c2b7b7e64b969c999f2d2d57e7cb2f0cd376efcdc1bea63f95fa
workflow-client-fallback.ts https://github.com/simstudioai/sim/pull/8481/files#diff-266fad709823c9273832c652a6d5324cc1473b2ec4a48bd811e76637e34ebc23
workflow-client-settlement.integration.ts https://github.com/simstudioai/sim/pull/8481/files#diff-6a39db06a36dd0cf836f92d639e1440aa1478de64363b8da264c8d45cee948bb
workflow-client-settlement.ts https://github.com/simstudioai/sim/pull/8481/files#diff-81afb1b39dd08883dd38ec16eae0c7b18081a55cd5651bcfca36166365d7f80d
execution-state.ts https://github.com/simstudioai/sim/pull/8481/files#diff-6509a75d061f5abaa1ad68145ab01392ac3f2b8415fe25505bea7a8268de8a39
apps/sim/app/api/workflows/[id]/execute/route.tshttps://github.com/simstudioai/sim/pull/8481/files#diff-66f204feb589208a932d4b6c514237d545b8f1e9746092bbc35345f49570a9be
View file https://github.com/simstudioai/sim/blob/6e9ee1b3488571325a9c5bdf856cc04b361b62a4/apps/sim/app/api/workflows/%5Bid%5D/execute/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8481/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8481/files#diff-66f204feb589208a932d4b6c514237d545b8f1e9746092bbc35345f49570a9be
https://github.com/simstudioai/sim/pull/8481/files#diff-66f204feb589208a932d4b6c514237d545b8f1e9746092bbc35345f49570a9be
https://github.com/simstudioai/sim/pull/8481/files#diff-66f204feb589208a932d4b6c514237d545b8f1e9746092bbc35345f49570a9be
Please reload this pagehttps://github.com/simstudioai/sim/pull/8481/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8481/files
https://github.com/simstudioai/sim/pull/8481/files#diff-66f204feb589208a932d4b6c514237d545b8f1e9746092bbc35345f49570a9be
https://github.com/simstudioai/sim/pull/8481/files#diff-66f204feb589208a932d4b6c514237d545b8f1e9746092bbc35345f49570a9be
Please reload this pagehttps://github.com/simstudioai/sim/pull/8481/files
https://github.com/simstudioai/sim/pull/8481/files#diff-66f204feb589208a932d4b6c514237d545b8f1e9746092bbc35345f49570a9be
apps/sim/lib/mothership/async-runs/repository.tshttps://github.com/simstudioai/sim/pull/8481/files#diff-bdd330821217c2b7b7e64b969c999f2d2d57e7cb2f0cd376efcdc1bea63f95fa
View file https://github.com/simstudioai/sim/blob/6e9ee1b3488571325a9c5bdf856cc04b361b62a4/apps/sim/lib/mothership/async-runs/repository.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8481/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8481/files#diff-bdd330821217c2b7b7e64b969c999f2d2d57e7cb2f0cd376efcdc1bea63f95fa
https://github.com/simstudioai/sim/pull/8481/files#diff-bdd330821217c2b7b7e64b969c999f2d2d57e7cb2f0cd376efcdc1bea63f95fa
apps/sim/lib/mothership/request/tools/workflow-client-fallback.tshttps://github.com/simstudioai/sim/pull/8481/files#diff-266fad709823c9273832c652a6d5324cc1473b2ec4a48bd811e76637e34ebc23
View file https://github.com/simstudioai/sim/blob/6e9ee1b3488571325a9c5bdf856cc04b361b62a4/apps/sim/lib/mothership/request/tools/workflow-client-fallback.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8481/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8481/files#diff-266fad709823c9273832c652a6d5324cc1473b2ec4a48bd811e76637e34ebc23
https://github.com/simstudioai/sim/pull/8481/files#diff-266fad709823c9273832c652a6d5324cc1473b2ec4a48bd811e76637e34ebc23
Please reload this pagehttps://github.com/simstudioai/sim/pull/8481/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8481/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.