René's URL Explorer Experiment


Title: feat(desktop): keep the machine awake for background chats and yield the page to the user by waleedlatif1 · Pull Request #8671 · simstudioai/sim · GitHub

Open Graph Title: feat(desktop): keep the machine awake for background chats and yield the page to the user by waleedlatif1 · Pull Request #8671 · simstudioai/sim

X Title: feat(desktop): keep the machine awake for background chats and yield the page to the user by waleedlatif1 · Pull Request #8671 · simstudioai/sim

Description: Summary Phase 2c of the desktop background executor. #8668 and #8670 are on staging. Prevent sleep while a chat is running While any chat has desktop work claimed on this machine, the app holds a prevent-app-suspension power blocker. It releases the blocker as soon as the last result is delivered. It never holds one while idle. The behaviour is on by default, with a switch in Settings → Desktop. A one-line note says a closed lid still puts the computer to sleep, because the switch can't prevent that. The switch shows only when Sim runs chats on this device in the background. A result that keeps failing to reach Sim holds the machine awake for at most 10 minutes. Delivery keeps retrying after that. The switch is a new optional bridge method, settings.setPreventSleepWhileRunning, so older desktop builds don't show it. The agent yields the page to the user (takeover) Only calls from the background executor yield. A call from the chat view the user is watching behaves exactly as on staging, because there the user steers the agent directly. A background call that only reads the page (snapshot, read text, list tabs) never waits, since it cannot collide with the user. When the user clicks, scrolls or types in the page a background chat's agent is driving, that chat's next acting browser action waits. While it waits, the tab is marked as needing attention. The action resumes in the same page once the user has left it alone for 4 seconds. The wait is bounded at 30 seconds, or half the action's watchdog if that is shorter. A user who keeps working past that gets a clear "not run" rather than a timeout. A user who starts working mid-action (between a batch's steps, or during a click's target probes) stops it before its next input. The result says earlier steps may have taken effect. The activity counts only on the tab the user acted in. A Stop still cancels an action while it waits. browser_request_takeover keeps its own explicit hand-back flow. Other chats' browsers are unaffected. Not in this PR: a background chat's page dialog can still take focus A page in a hidden chat that calls confirm() or alert() still takes focus from the user's window. Electron shows its native message box before the driver's CDP handler answers the dialog. This happens whether or not the executor runs the chat, and it overlaps with #8432's dialog work. Suppressing native dialogs (disableDialogs) would also break the agent's dialog: {accept: true} answers. I reproduced it in a packaged-app E2E and left it out of this PR so it can be decided with #8432. Test plan Unit tests (sleep-blocker.test.ts): one blocker is held only while work runs; the switch is followed live; an idle machine never starts one. Packaged-app E2E (background-executor.spec.ts): I: synthetic user input in the agent's tab holds a background browser_click until 4 s of quiet. The click then runs exactly once. J: the blocker is taken when a background command starts and released once its result is delivered. Both fail with the change reverted (mutation-checked). The full suite, A to J, passes in 1.1 min. type-check, check:audits, check:desktop-ipc, check:desktop-bridge, and the desktop Vitest suite (931 tests).

Open Graph Description: Summary Phase 2c of the desktop background executor. #8668 and #8670 are on staging. Prevent sleep while a chat is running While any chat has desktop work claimed on this machine, the app holds a ...

X Description: Summary Phase 2c of the desktop background executor. #8668 and #8670 are on staging. Prevent sleep while a chat is running While any chat has desktop work claimed on this machine, the app holds a ...

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

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:b563f3f9-635b-cb08-b190-6747d73baf0a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD1BE:1AE782:4C9841:6AE38C:6AFB5D95
html-safe-nonceabec4ebe18ebaa292cdd046b30ea054bf62e6dd916bfff7e4c15dea62480f49f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMUJFOjFBRTc4Mjo0Qzk4NDE6NkFFMzhDOjZBRkI1RDk1IiwidmlzaXRvcl9pZCI6IjQ3NTkzMzc4NjQ3NTgyNTQ5OTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaccd1342edc147e5b567433913f48640ff2bc8719913e91e47175c4a5c4cf80359
hovercard-subject-tagpull_request:4755129841
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/8671/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 Phase 2c of the desktop background executor. #8668 and #8670 are on staging. Prevent sleep while a chat is running While any chat has desktop work claimed on this machine, the app holds a ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94
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
release59ef97164c52cf59bd10558ddec9c4f482763988
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/8671/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8671%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%2F8671%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/8671/files
Reloadhttps://github.com/simstudioai/sim/pull/8671/files
Reloadhttps://github.com/simstudioai/sim/pull/8671/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
feat/desktop-executor-takeoverhttps://github.com/simstudioai/sim/tree/feat/desktop-executor-takeover
Conversation 91 https://github.com/simstudioai/sim/pull/8671
Commits 6 https://github.com/simstudioai/sim/pull/8671/commits
Checks 36 https://github.com/simstudioai/sim/pull/8671/checks
Files changed https://github.com/simstudioai/sim/pull/8671/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8671/files
feat(desktop): keep the machine awake for background chats and yield the page to the user https://github.com/simstudioai/sim/pull/8671/files#top
Show all changes 6 commits https://github.com/simstudioai/sim/pull/8671/files
b05971d feat(desktop): keep the machine awake for background chats and yield … waleedlatif1 Oct 6, 2026 https://github.com/simstudioai/sim/pull/8671/commits/b05971da575e4012467a19a7d9c9dd0348f17613
168421c fix(desktop): give the page back to the user mid-action waleedlatif1 Oct 6, 2026 https://github.com/simstudioai/sim/pull/8671/commits/168421cc7568fc6866ce5715827529c96e88fcdb
dc952f1 test(desktop): read the blockers the OS holds instead of asserting th… waleedlatif1 Oct 6, 2026 https://github.com/simstudioai/sim/pull/8671/commits/dc952f1afc9dcab927f3ac2ece3629e7b12b8342
7dd5b05 fix(desktop): yield the page only for background calls that act on it waleedlatif1 Oct 6, 2026 https://github.com/simstudioai/sim/pull/8671/commits/7dd5b05bce96205d1a8d56962914c1f91dc53f76
d6e0938 test(desktop): give the notification tests the prevent-sleep setter t… waleedlatif1 Oct 6, 2026 https://github.com/simstudioai/sim/pull/8671/commits/d6e0938aa4d382feafd3e022185ea4093779d833
8a624c9 test(desktop): show the prevent-sleep switch only on a device that ru… waleedlatif1 Oct 6, 2026 https://github.com/simstudioai/sim/pull/8671/commits/8a624c911f711661323c9778f27c3a846478e2f2
Clear filters https://github.com/simstudioai/sim/pull/8671/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8671/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8671/files
background-executor.spec.ts https://github.com/simstudioai/sim/pull/8671/files#diff-4332bb9fbb86c853395301498b2e8eb627bbc7c6b68c498ae343555109ea5d3b
driver.test.ts https://github.com/simstudioai/sim/pull/8671/files#diff-e3f3e254574c9ace38cf400e9ef8600989b25e602629bb7e6c7e4927a27830c5
driver.ts https://github.com/simstudioai/sim/pull/8671/files#diff-515694ac7beaa3b13cb8b2224e3c5ec946ddc589bf9d8c294986e76a8c270ed6
session.ts https://github.com/simstudioai/sim/pull/8671/files#diff-4950875424919c3217a0b1f974e08ec2f97fe2cd318916f610158e3cf09db3c7
config.ts https://github.com/simstudioai/sim/pull/8671/files#diff-02e7bf746fb599140284984877377fbcca00ca42a333475a9fb959de43043eae
service.test.ts https://github.com/simstudioai/sim/pull/8671/files#diff-bb870d6cdaadc893c82c9b02921605ea6aee1db801f3434d850e1fd7cd2dbd94
service.ts https://github.com/simstudioai/sim/pull/8671/files#diff-b1278501073652f766c12e4b75a1cc24571a04e46e4c4539bb52a80ed6df5f4d
sleep-blocker.test.ts https://github.com/simstudioai/sim/pull/8671/files#diff-e23409ba9857cc3a694a3353b42a5a33bb120f92d4a6fe1a4c4471bc5a8ba311
sleep-blocker.ts https://github.com/simstudioai/sim/pull/8671/files#diff-a8dff4cb6724562149196231021e8fefd9c608f26ddea9229224773da4a1af71
desktop-settings.test.ts https://github.com/simstudioai/sim/pull/8671/files#diff-b4128fae90ed93968a88a8c80498de2bbebb96e534589f4b5fa661d86f201071
desktop-settings.ts https://github.com/simstudioai/sim/pull/8671/files#diff-1eaa70bf44d6e5794bf68b92a7cf27805bf95950b8c398a60fdd47f0a36bd7d8
index.ts https://github.com/simstudioai/sim/pull/8671/files#diff-5bf7db7b15749c034541a4a70a0cacf9816b4e214fd11cb5735c5ddb7ca4b1d8
ipc.test.ts https://github.com/simstudioai/sim/pull/8671/files#diff-99b75f363352285b31a5126e14f02639f69bec3d740d21e1a5f2a25d400618d3
ipc.ts https://github.com/simstudioai/sim/pull/8671/files#diff-a471b27e653d39114f9a737b0741f68dc1a6f36f3830e9454fd4e00704e24727
index.ts https://github.com/simstudioai/sim/pull/8671/files#diff-fecf2d7e27201df1f0e00156c44faaa274e5dd37dfb485582ce3b2271ce5558c
desktop.test.tsx https://github.com/simstudioai/sim/pull/8671/files#diff-14e3842ecb68139a6ad3b2fd849609901cdc1574a812f119f655581e13ce2575
desktop.tsx https://github.com/simstudioai/sim/pull/8671/files#diff-93feb862a1d022cb36a7041456b0f1f2a5af983e1062ca5c0c1d73f1ff212aad
browser-tool-execution.ts https://github.com/simstudioai/sim/pull/8671/files#diff-8f905f5e874cb0a596f2b1d94ccaaf419d995620aec1a4a5d7e677e6190cbd8d
index.ts https://github.com/simstudioai/sim/pull/8671/files#diff-7bf024cc51a5498c6b4d087358740c2011c9d5ea86c03391bd1d4623026224d3
index.ts https://github.com/simstudioai/sim/pull/8671/files#diff-f0f54c2e774a675c783c4e7a289d3218ca6d1ef3cdf5158b05acc79cd742afec
apps/desktop/e2e/background-executor.spec.tshttps://github.com/simstudioai/sim/pull/8671/files#diff-4332bb9fbb86c853395301498b2e8eb627bbc7c6b68c498ae343555109ea5d3b
View file https://github.com/simstudioai/sim/blob/8a624c911f711661323c9778f27c3a846478e2f2/apps/desktop/e2e/background-executor.spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8671/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8671/files#diff-4332bb9fbb86c853395301498b2e8eb627bbc7c6b68c498ae343555109ea5d3b
https://github.com/simstudioai/sim/pull/8671/files#diff-4332bb9fbb86c853395301498b2e8eb627bbc7c6b68c498ae343555109ea5d3b
https://github.com/simstudioai/sim/pull/8671/files#diff-4332bb9fbb86c853395301498b2e8eb627bbc7c6b68c498ae343555109ea5d3b
https://github.com/simstudioai/sim/pull/8671/files#diff-4332bb9fbb86c853395301498b2e8eb627bbc7c6b68c498ae343555109ea5d3b
apps/desktop/src/main/browser-agent/driver.test.tshttps://github.com/simstudioai/sim/pull/8671/files#diff-e3f3e254574c9ace38cf400e9ef8600989b25e602629bb7e6c7e4927a27830c5
View file https://github.com/simstudioai/sim/blob/8a624c911f711661323c9778f27c3a846478e2f2/apps/desktop/src/main/browser-agent/driver.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8671/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8671/files#diff-e3f3e254574c9ace38cf400e9ef8600989b25e602629bb7e6c7e4927a27830c5
https://github.com/simstudioai/sim/pull/8671/files#diff-e3f3e254574c9ace38cf400e9ef8600989b25e602629bb7e6c7e4927a27830c5
apps/desktop/src/main/browser-agent/driver.tshttps://github.com/simstudioai/sim/pull/8671/files#diff-515694ac7beaa3b13cb8b2224e3c5ec946ddc589bf9d8c294986e76a8c270ed6
View file https://github.com/simstudioai/sim/blob/8a624c911f711661323c9778f27c3a846478e2f2/apps/desktop/src/main/browser-agent/driver.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8671/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8671/files#diff-515694ac7beaa3b13cb8b2224e3c5ec946ddc589bf9d8c294986e76a8c270ed6
https://github.com/simstudioai/sim/pull/8671/files#diff-515694ac7beaa3b13cb8b2224e3c5ec946ddc589bf9d8c294986e76a8c270ed6
https://github.com/simstudioai/sim/pull/8671/files#diff-515694ac7beaa3b13cb8b2224e3c5ec946ddc589bf9d8c294986e76a8c270ed6
https://github.com/simstudioai/sim/pull/8671/files#diff-515694ac7beaa3b13cb8b2224e3c5ec946ddc589bf9d8c294986e76a8c270ed6
https://github.com/simstudioai/sim/pull/8671/files#diff-515694ac7beaa3b13cb8b2224e3c5ec946ddc589bf9d8c294986e76a8c270ed6
https://github.com/simstudioai/sim/pull/8671/files#diff-515694ac7beaa3b13cb8b2224e3c5ec946ddc589bf9d8c294986e76a8c270ed6
https://github.com/simstudioai/sim/pull/8671/files#diff-515694ac7beaa3b13cb8b2224e3c5ec946ddc589bf9d8c294986e76a8c270ed6
Please reload this pagehttps://github.com/simstudioai/sim/pull/8671/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8671/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.