René's URL Explorer Experiment


Title: fix(mothership): bound every handed tool call by the deadline its frame names by waleedlatif1 · Pull Request #9090 · simstudioai/sim · GitHub

Open Graph Title: fix(mothership): bound every handed tool call by the deadline its frame names by waleedlatif1 · Pull Request #9090 · simstudioai/sim

X Title: fix(mothership): bound every handed tool call by the deadline its frame names by waleedlatif1 · Pull Request #9090 · simstudioai/sim

Description: Summary The bug: the resume gate waits on a long-running tool for up to 60 minutes, but the worker fails the same handed call after 15. When a handler hangs, the worker asks for its next tool, but Sim posts no resume until every pending tool settles, so that call never reaches Sim and the run ends detached. The fal queue client made a hang likely: no abort signal on any fetch or sleep, and a poll budget of the 7-day workflow maximum. Deadline on the frame: a tool-call frame may now carry deadlineMs, how long the worker waits. Sim fixes the call's deadline at receipt (less TOOL_DEADLINE_SETTLE_MARGIN_MS), stores it in the new copilot_async_tool_calls.execution_deadline_at column, and ends every wait for the call by it: the executor watchdog the resume-gate budget and its desktop-lease ceiling the approval wait client, desktop and workflow-pickup waits Sim's own shorter budgets still apply. A frame without the field keeps today's bounds, which leaves workflow tools unchanged. Takeover re-runs: a re-run gets only what remains of the deadline recorded at first hand-off, and runs only if at least 60 s remain. Otherwise the call fails with a clear "interrupted, too little time to run again" result. Capability token: chat payloads declare tool-deadline in clientCapabilities, so the worker knows this Sim honors the field. fal fix: runFalQueue takes the tool's abort signal through every fetch and sleep, has its own 30-minute ceiling, sends X-Fal-Request-Timeout, and cancels the queued request on abort. generate_audio and generate_video pass their abort signal down. Release order This PR and its contracts PR simstudioai/mothership#701 merge together. generated/protocol.ts is synced from that branch. This Sim release ships. On its own, only the fal bound changes behavior: current workers send no deadlineMs. The worker PR follows. It stamps deadlineMs and keeps waiting through the old 60-minute bound for Sims that do not declare tool-deadline. Type of Change Bug fix Testing Each new test fails on staging and passes with this change: falai.test.ts: a request that never finishes stops polling and is cancelled when its caller aborts; a poll that never answers ends on abort; with nothing aborting it, the request fails and is cancelled at the 30-minute ceiling; submit sends X-Fal-Request-Timeout. model-boundaries.test.ts: aborting a generate_audio / generate_video call ends the generation. executor.test.ts: wait budgets (long tool, approval, desktop) end at the call deadline, and shorter Sim budgets stay; a hung generate_audio is aborted at the deadline, not after 60 minutes; a re-run uses the stored deadline. run.test.ts: a desktop import whose lease keeps renewing is failed at the deadline. permission.test.ts: an unanswered approval times out at the deadline. handlers.test.ts: the frame deadline is read at receipt; a client call keeps the deadline recorded at first hand-off. abandoned-runs.integration.ts: a takeover fails an interrupted tool with under 60 s left and re-runs one with time left, keeping its recorded deadline. payload.test.ts: payloads declare the token. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary The bug: the resume gate waits on a long-running tool for up to 60 minutes, but the worker fails the same handed call after 15. When a handler hangs, the worker asks for its next tool, but...

X Description: Summary The bug: the resume gate waits on a long-running tool for up to 60 minutes, but the worker fails the same handed call after 15. When a handler hangs, the worker asks for its next tool, but...

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

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(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:a2cb8543-3807-1de7-a7b5-5b13819fd18a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCA0A:5A439:26F73B:36ACAD:6AFB528E
html-safe-nonce529492ba008dcf2090980bbab4d6fc0b50cd0bbfeb7806cb660d9049446f95f9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTBBOjVBNDM5OjI2RjczQjozNkFDQUQ6NkFGQjUyOEUiLCJ2aXNpdG9yX2lkIjoiNjY3Nzg5MDk4NTU1ODIzMzc0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaca0969546c5bef248f116751c30f4a6f208cf3047b2cbf1d3c50cc44983801123
hovercard-subject-tagpull_request:4879696579
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/9090/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 The bug: the resume gate waits on a long-running tool for up to 60 minutes, but the worker fails the same handed call after 15. When a handler hangs, the worker asks for its next tool, but...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1
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
releasecbf66c024bb6d10e6955baa7413c54cf13a201bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/9090/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F9090%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%2F9090%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/9090/files
Reloadhttps://github.com/simstudioai/sim/pull/9090/files
Reloadhttps://github.com/simstudioai/sim/pull/9090/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)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/tool-call-deadlineshttps://github.com/simstudioai/sim/tree/fix/tool-call-deadlines
Conversation 54 https://github.com/simstudioai/sim/pull/9090
Commits 6 https://github.com/simstudioai/sim/pull/9090/commits
Checks 52 https://github.com/simstudioai/sim/pull/9090/checks
Files changed https://github.com/simstudioai/sim/pull/9090/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9090/files
fix(mothership): bound every handed tool call by the deadline its frame names https://github.com/simstudioai/sim/pull/9090/files#top
Show all changes 6 commits https://github.com/simstudioai/sim/pull/9090/files
97042a3 fix(mothership): bound every handed tool call by the deadline its fra… waleedlatif1 Oct 15, 2026 https://github.com/simstudioai/sim/pull/9090/commits/97042a34996063cd5d3a919a10c0ee6152f5c662
043ac00 fix(mothership): start nothing for a tool call once its deadline has … waleedlatif1 Oct 15, 2026 https://github.com/simstudioai/sim/pull/9090/commits/043ac009379e26cb58dba9cbf7688b2e9c41b090
65574b8 test(mothership): type the client deadline waiter mock waleedlatif1 Oct 15, 2026 https://github.com/simstudioai/sim/pull/9090/commits/65574b8e6f9bc24e84ecd37961b1df41d3b2fc5a
834b47d fix(mothership): report a past-deadline client call as not run only w… waleedlatif1 Oct 15, 2026 https://github.com/simstudioai/sim/pull/9090/commits/834b47db2b010499cbade9c7af4dba5959bbf32b
bcec4a5 fix(media): submit no fal request for a caller that already gave up waleedlatif1 Oct 15, 2026 https://github.com/simstudioai/sim/pull/9090/commits/bcec4a5b68c9a94be3986750cb572252bb8af314
1c05f21 fix(media): flag a refused fal cancellation and stop an aborted inlin… waleedlatif1 Oct 15, 2026 https://github.com/simstudioai/sim/pull/9090/commits/1c05f210509805797e87dc199626172ad32f9696
Clear filters https://github.com/simstudioai/sim/pull/9090/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9090/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9090/files
falai-audio.ts https://github.com/simstudioai/sim/pull/9090/files#diff-81aaeaeff54ed6522195f74bf31322906c8a5ccc3d9550b7110ebfe73ec383ad
falai-video.ts https://github.com/simstudioai/sim/pull/9090/files#diff-248b25b56fcae12a9ac859c3803ea07aa890e868ae254bd151c6ea396f865d40
falai.test.ts https://github.com/simstudioai/sim/pull/9090/files#diff-877f7081cfb1235e890b96aca58d2202e5bfc19b2965140ab15bfd4e624cb60f
falai.ts https://github.com/simstudioai/sim/pull/9090/files#diff-c077a3538059a85cadfbb40e3e8ca623a7ddf7a2a87dce07d59357130ebda678
browser-download-claim.integration.ts https://github.com/simstudioai/sim/pull/9090/files#diff-f7908a0d8667d473761a1c9eaea17af69a43b2f4b1aeccb403d62ebf22f883f7
execution-lease.ts https://github.com/simstudioai/sim/pull/9090/files#diff-198f614006998d8c2275f46619ca3103f4276ef280998d548008f8bb4a0a7436
repository.ts https://github.com/simstudioai/sim/pull/9090/files#diff-bdd330821217c2b7b7e64b969c999f2d2d57e7cb2f0cd376efcdc1bea63f95fa
payload.test.ts https://github.com/simstudioai/sim/pull/9090/files#diff-78d0a8a5ae81d1e517d06e48910b6d3c02e3e01b2a16ee127ffe3b6bd1a498f0
payload.ts https://github.com/simstudioai/sim/pull/9090/files#diff-c44cea7f933347399d8d8c3afb1e59a0a144297731650a7e6ba0277ed910c2a9
protocol.ts https://github.com/simstudioai/sim/pull/9090/files#diff-98d014569e6afdda0c3092e10be84a0b9e9d2cd20bc52211691a3848dc0d7b16
abandoned-runs.integration.ts https://github.com/simstudioai/sim/pull/9090/files#diff-9158d9dd86d1effa351a658ce93dd4fa5c417ff8129c0b25a5a55036cb0d6283
handlers.test.ts https://github.com/simstudioai/sim/pull/9090/files#diff-f0cea1f1a04f5cbc9494e9a7047c476a612feb78c3d54e67f6c8cd1b967da796
tool.ts https://github.com/simstudioai/sim/pull/9090/files#diff-47a3a73474ab6d2584224561f1bffcfa95ba11f16716887b3230099298041540
run.test.ts https://github.com/simstudioai/sim/pull/9090/files#diff-0391696e45945f80cdf49dc490d5bed440504197fb63965c30be6871e2eed616
run.ts https://github.com/simstudioai/sim/pull/9090/files#diff-42286b1c13539c62ff83806b87ad5eb1669e4ce1e893862f952cf81cdc440573
contract.ts https://github.com/simstudioai/sim/pull/9090/files#diff-8b9aacb1079750af38cc5e77c03d4cdbb0a7efda18b604a26c38bae9687c62c5
deadline.ts https://github.com/simstudioai/sim/pull/9090/files#diff-e771804d5e17932cc496a6f5f45b6b3159497f1f77302086a2394b276aa61654
executor.test.ts https://github.com/simstudioai/sim/pull/9090/files#diff-5c0149489977e70711d949724f46e8bcd43162b7fbd3928da59a33aa935af5e7
executor.ts https://github.com/simstudioai/sim/pull/9090/files#diff-42b57bff4502cb04d3c049cc5137e7208b20a861400af267c0f15f773633f6ab
permission.test.ts https://github.com/simstudioai/sim/pull/9090/files#diff-704c1f6c3e5c90de1c7ef6d18f516fff324c5f539b26585bb0a26df2de1cf1d4
permission.ts https://github.com/simstudioai/sim/pull/9090/files#diff-8e6376c674c2288d67bafcd70487b757ffc749b1d2873a0936838b6289904c62
workflow-client-fallback.test.ts https://github.com/simstudioai/sim/pull/9090/files#diff-6de0e3b5284980fbe51aae675e2c23fc0cef1478336bc671b32a3ed094c67379
workflow-client-fallback.ts https://github.com/simstudioai/sim/pull/9090/files#diff-266fad709823c9273832c652a6d5324cc1473b2ec4a48bd811e76637e34ebc23
types.ts https://github.com/simstudioai/sim/pull/9090/files#diff-55c4bdb35909c847ec3bfbeb875a9e4913d9df1038245f52949d0aa969b0a4f4
generate-audio.ts https://github.com/simstudioai/sim/pull/9090/files#diff-3e3a066155517b7cc494ebfe01c36acbd2b76d01668e54d398a56c62733b17d7
generate-video.ts https://github.com/simstudioai/sim/pull/9090/files#diff-6b1eba7743f92e8a30c890523faa24ac801e5704df4a11eeca90187b3bdb0afd
model-boundaries.test.ts https://github.com/simstudioai/sim/pull/9090/files#diff-caf0ae31ed7b76089b52cd616aa9e68808c6e195e5099ff7ace57861ad35aae3
0432_tool_execution_deadline.sql https://github.com/simstudioai/sim/pull/9090/files#diff-f3742ac969eb77d76bccf2b10af378db378581aa18d4a25c53e0bf41d653c227
0432_snapshot.json https://github.com/simstudioai/sim/pull/9090/files#diff-2d71304882a19b61b112b423411c86659b7a47ffe73d91f1a3ce468f6027366b
_journal.json https://github.com/simstudioai/sim/pull/9090/files#diff-37150cc65ad16ee6fbc5fa318fc096be7730e16d63eaf863e3df5521b7030649
schema.ts https://github.com/simstudioai/sim/pull/9090/files#diff-9a959e2ce3cb4c86957bbae021d06eae364f7b0cb18964f5873bab53220af928
schema-tables.generated.ts https://github.com/simstudioai/sim/pull/9090/files#diff-e0edf0f56682cbbb36446389d81ccd7516f377568a0c09cd8e9c1c87b0b1850e
apps/sim/lib/media/falai-audio.tshttps://github.com/simstudioai/sim/pull/9090/files#diff-81aaeaeff54ed6522195f74bf31322906c8a5ccc3d9550b7110ebfe73ec383ad
View file https://github.com/simstudioai/sim/blob/1c05f210509805797e87dc199626172ad32f9696/apps/sim/lib/media/falai-audio.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9090/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9090/files#diff-81aaeaeff54ed6522195f74bf31322906c8a5ccc3d9550b7110ebfe73ec383ad
https://github.com/simstudioai/sim/pull/9090/files#diff-81aaeaeff54ed6522195f74bf31322906c8a5ccc3d9550b7110ebfe73ec383ad
https://github.com/simstudioai/sim/pull/9090/files#diff-81aaeaeff54ed6522195f74bf31322906c8a5ccc3d9550b7110ebfe73ec383ad
https://github.com/simstudioai/sim/pull/9090/files#diff-81aaeaeff54ed6522195f74bf31322906c8a5ccc3d9550b7110ebfe73ec383ad
https://github.com/simstudioai/sim/pull/9090/files#diff-81aaeaeff54ed6522195f74bf31322906c8a5ccc3d9550b7110ebfe73ec383ad
apps/sim/lib/media/falai-video.tshttps://github.com/simstudioai/sim/pull/9090/files#diff-248b25b56fcae12a9ac859c3803ea07aa890e868ae254bd151c6ea396f865d40
View file https://github.com/simstudioai/sim/blob/1c05f210509805797e87dc199626172ad32f9696/apps/sim/lib/media/falai-video.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9090/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9090/files#diff-248b25b56fcae12a9ac859c3803ea07aa890e868ae254bd151c6ea396f865d40
https://github.com/simstudioai/sim/pull/9090/files#diff-248b25b56fcae12a9ac859c3803ea07aa890e868ae254bd151c6ea396f865d40
https://github.com/simstudioai/sim/pull/9090/files#diff-248b25b56fcae12a9ac859c3803ea07aa890e868ae254bd151c6ea396f865d40
Please reload this pagehttps://github.com/simstudioai/sim/pull/9090/files
https://github.com/simstudioai/sim/pull/9090/files#diff-248b25b56fcae12a9ac859c3803ea07aa890e868ae254bd151c6ea396f865d40
apps/sim/lib/media/falai.test.tshttps://github.com/simstudioai/sim/pull/9090/files#diff-877f7081cfb1235e890b96aca58d2202e5bfc19b2965140ab15bfd4e624cb60f
View file https://github.com/simstudioai/sim/blob/1c05f210509805797e87dc199626172ad32f9696/apps/sim/lib/media/falai.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9090/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/9090/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9090/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.