René's URL Explorer Experiment


Title: fix(copilot): stop async chat auto-titling from clobbering an explicit rename by waleedlatif1 · Pull Request #7414 · simstudioai/sim · GitHub

Open Graph Title: fix(copilot): stop async chat auto-titling from clobbering an explicit rename by waleedlatif1 · Pull Request #7414 · simstudioai/sim

X Title: fix(copilot): stop async chat auto-titling from clobbering an explicit rename by waleedlatif1 · Pull Request #7414 · simstudioai/sim

Description: Summary Chat title generation is fired at turn start and resolves asynchronously, but its write was unconditional: await db.update(copilotChats).set({ title }).where(eq(copilotChats.id, chatId)) The guard that decides whether to generate a title (if (!chatId || currentChat?.title || !isNewChat) return) evaluates a snapshot taken at request start. The write then happens much later with no re-check — a classic check-then-write (TOCTOU) race. If a user renames the chat while the title is being generated, the generated title lands afterward and silently overwrites the rename. This is reachable in normal use: rename a chat shortly after sending the first message and the rename can disappear. Fix Make the write conditional on the title still being unset, so a generated title can only ever fill an empty slot: .where(and(eq(copilotChats.id, chatId), isNull(copilotChats.title))) copilotChats.title is nullable with no default, so isNull is exactly the "no title yet" state. The update is atomic, so the explicit rename deterministically wins. When the write loses the race (0 rows), the follow-up title notification is skipped as well — we should not announce a title the row no longer holds. Both auto-title call sites are fixed, since they had the identical unconditional write: lib/copilot/request/lifecycle/start.ts — the interactive turn path lib/mothership/inbox/executor.ts — the inbox task path Why not "eliminate the race" instead The concurrency is inherent — an async background title generator runs alongside user actions, and awaiting it would block the turn on a title LLM call. The race cannot be removed, only made well-defined; a conditional (compare-and-set) update is the standard way to do that, and it makes the outcome deterministic: an explicit title always wins, a generated one only fills a gap. Testing tsc --noEmit and biome clean. Existing unit tests for both changed paths pass (start.test.ts, executor.test.ts — 13 tests). This also removes the root cause of a flaky integration check that asserted a forked chat inherits its parent's renamed title. Type of change Bug fix (non-breaking)

Open Graph Description: Summary Chat title generation is fired at turn start and resolves asynchronously, but its write was unconditional: await db.update(copilotChats).set({ title }).where(eq(copilotChats.id, chatId)) Th...

X Description: Summary Chat title generation is fired at turn start and resolves asynchronously, but its write was unconditional: await db.update(copilotChats).set({ title }).where(eq(copilotChats.id, chatId)) Th...

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

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:410e0e1b-5446-9f68-59aa-5f1a74971427
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA92E:870C9:3A2E50:532114:6AFB3A1E
html-safe-nonce7cb265304316ebb2dac0c77b258baa6a90809a04cb8282aada03dd1fc4b0b3c3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTJFOjg3MEM5OjNBMkU1MDo1MzIxMTQ6NkFGQjNBMUUiLCJ2aXNpdG9yX2lkIjoiODYwNzQ4NjU3NDY1MDQwNzQ1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac35d9f8f955dc50695ff1e6db28cdfcdd17217e6918abff90f8b73ac185b85ef4
hovercard-subject-tagpull_request:4426512168
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/7414/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 Chat title generation is fired at turn start and resolves asynchronously, but its write was unconditional: await db.update(copilotChats).set({ title }).where(eq(copilotChats.id, chatId)) Th...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None2169b0dfbef67ed6b128074a5ed45bb7d5d1859783b10178b09a7765ad5f3693
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
release3b4fc8df5ef1c6757e733a23e6b81b6725021823
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/7414/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7414%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%2F7414%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/7414/files
Reloadhttps://github.com/simstudioai/sim/pull/7414/files
Reloadhttps://github.com/simstudioai/sim/pull/7414/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/copilot-title-no-clobberhttps://github.com/simstudioai/sim/tree/fix/copilot-title-no-clobber
Conversation 4 https://github.com/simstudioai/sim/pull/7414
Commits 1 https://github.com/simstudioai/sim/pull/7414/commits
Checks 29 https://github.com/simstudioai/sim/pull/7414/checks
Files changed https://github.com/simstudioai/sim/pull/7414/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7414/files
fix(copilot): stop async chat auto-titling from clobbering an explicit rename https://github.com/simstudioai/sim/pull/7414/files#top
Show all changes 1 commit https://github.com/simstudioai/sim/pull/7414/files
2e59f3c fix(copilot): stop async chat auto-titling from clobbering an explici… waleedlatif1 Sep 2, 2026 https://github.com/simstudioai/sim/pull/7414/commits/2e59f3c93f6a9742dcfadd143be1e14e9ee34675
Clear filters https://github.com/simstudioai/sim/pull/7414/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7414/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7414/files
start.ts https://github.com/simstudioai/sim/pull/7414/files#diff-6d1d121ff4ddd703b0fe2a11c19ce949a7d3d0532e5e7c84bb0fecb2e8e48f8e
executor.ts https://github.com/simstudioai/sim/pull/7414/files#diff-c33f60778aa0c14a73019c4f39d873ee087fec05114374d21a5914e5376ac91b
apps/sim/lib/copilot/request/lifecycle/start.tshttps://github.com/simstudioai/sim/pull/7414/files#diff-6d1d121ff4ddd703b0fe2a11c19ce949a7d3d0532e5e7c84bb0fecb2e8e48f8e
View file https://github.com/simstudioai/sim/blob/2e59f3c93f6a9742dcfadd143be1e14e9ee34675/apps/sim/lib/copilot/request/lifecycle/start.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7414/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7414/files#diff-6d1d121ff4ddd703b0fe2a11c19ce949a7d3d0532e5e7c84bb0fecb2e8e48f8e
https://github.com/simstudioai/sim/pull/7414/files#diff-6d1d121ff4ddd703b0fe2a11c19ce949a7d3d0532e5e7c84bb0fecb2e8e48f8e
https://github.com/simstudioai/sim/pull/7414/files#diff-6d1d121ff4ddd703b0fe2a11c19ce949a7d3d0532e5e7c84bb0fecb2e8e48f8e
https://github.com/simstudioai/sim/pull/7414/files#diff-6d1d121ff4ddd703b0fe2a11c19ce949a7d3d0532e5e7c84bb0fecb2e8e48f8e
apps/sim/lib/mothership/inbox/executor.tshttps://github.com/simstudioai/sim/pull/7414/files#diff-c33f60778aa0c14a73019c4f39d873ee087fec05114374d21a5914e5376ac91b
View file https://github.com/simstudioai/sim/blob/2e59f3c93f6a9742dcfadd143be1e14e9ee34675/apps/sim/lib/mothership/inbox/executor.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7414/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7414/files#diff-c33f60778aa0c14a73019c4f39d873ee087fec05114374d21a5914e5376ac91b
https://github.com/simstudioai/sim/pull/7414/files#diff-c33f60778aa0c14a73019c4f39d873ee087fec05114374d21a5914e5376ac91b
https://github.com/simstudioai/sim/pull/7414/files#diff-c33f60778aa0c14a73019c4f39d873ee087fec05114374d21a5914e5376ac91b
https://github.com/simstudioai/sim/pull/7414/files#diff-c33f60778aa0c14a73019c4f39d873ee087fec05114374d21a5914e5376ac91b
Please reload this pagehttps://github.com/simstudioai/sim/pull/7414/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.