René's URL Explorer Experiment


Title: feat(copilot): add copilot_chat_messages table with dual-write rollout by waleedlatif1 · Pull Request #4726 · simstudioai/sim · GitHub

Open Graph Title: feat(copilot): add copilot_chat_messages table with dual-write rollout by waleedlatif1 · Pull Request #4726 · simstudioai/sim

X Title: feat(copilot): add copilot_chat_messages table with dual-write rollout by waleedlatif1 · Pull Request #4726 · simstudioai/sim

Description: Summary Introduces dedicated copilot_chat_messages table to replace the JSONB messages array on copilot_chats. The JSONB column is preserved indefinitely as the source of truth during rollout — no breaking schema change. Migration 0212_cynical_jack_murdock.sql runs an inline jsonb_array_elements ... ON CONFLICT DO NOTHING backfill. bun run db:migrate does everything; no scripts required. Follows existing migration precedent (0091_backfill_user_stats.sql, 0192_invitation_unification.sql): multi-statement with gen_random_uuid(), FK with CASCADE, inline INSERT ... SELECT ... ON CONFLICT DO NOTHING. Dual-write helpers (lib/copilot/chat/messages-dual-write.ts) wired into every JSONB-mutation callsite (post, terminal-state, inbox, fork, update-messages, superuser-import). Best-effort — errors logged, never thrown. Catch-up sweep on server boot closes the rolling-deploy gap. Bounded 7-day window, idempotent. Indexes UNIQUE (chat_id, message_id) — idempotent appends, dedup streaming retries (chat_id, created_at, id) WHERE deleted_at IS NULL — transcript load, last-N (chat_id, stream_id) WHERE stream_id IS NOT NULL — stream replay/resume Type of Change New feature Testing Tested manually. Lint passes. 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 Introduces dedicated copilot_chat_messages table to replace the JSONB messages array on copilot_chats. The JSONB column is preserved indefinitely as the source of truth during rollout — no...

X Description: Summary Introduces dedicated copilot_chat_messages table to replace the JSONB messages array on copilot_chats. The JSONB column is preserved indefinitely as the source of truth during rollout — no...

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

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:ba9ec167-856f-10c4-7f38-55d91e9209dd
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idADDA:14467D:4FF8AC:702392:6AFB5E8C
html-safe-noncea70a42d0e7d3b7a068690fc78ef5673ccb80415091f5ff53d6dce09593ec6d5f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRERBOjE0NDY3RDo0RkY4QUM6NzAyMzkyOjZBRkI1RThDIiwidmlzaXRvcl9pZCI6IjM3MTcwMDQwMDcwMTc1MDQzOTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7153a0d6516fe9a357f50fc7a154a0a03f7e18c5dfb61adeb0ffd51b04f0a3d0
hovercard-subject-tagpull_request:3731843478
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/4726/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 Introduces dedicated copilot_chat_messages table to replace the JSONB messages array on copilot_chats. The JSONB column is preserved indefinitely as the source of truth during rollout — no...
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/4726/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F4726%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%2F4726%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/4726/files
Reloadhttps://github.com/simstudioai/sim/pull/4726/files
Reloadhttps://github.com/simstudioai/sim/pull/4726/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
waleedlatif1/copilot-chat-messages-tablehttps://github.com/simstudioai/sim/tree/waleedlatif1/copilot-chat-messages-table
Conversation 22 https://github.com/simstudioai/sim/pull/4726
Commits 1 https://github.com/simstudioai/sim/pull/4726/commits
Checks 12 https://github.com/simstudioai/sim/pull/4726/checks
Files changed https://github.com/simstudioai/sim/pull/4726/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4726/files
feat(copilot): add copilot_chat_messages table with dual-write rollout https://github.com/simstudioai/sim/pull/4726/files#top
Show all changes 1 commit https://github.com/simstudioai/sim/pull/4726/files
2b478fb feat(copilot): add copilot_messages table with dual-write rollout waleedlatif1 May 28, 2026 https://github.com/simstudioai/sim/pull/4726/commits/2b478fb5a5022fda15ad1d63b051618d52d8e85e
Clear filters https://github.com/simstudioai/sim/pull/4726/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4726/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4726/files
route.test.ts https://github.com/simstudioai/sim/pull/4726/files#diff-e415967311ffc3f6144c1bf2d54171ab6cc70375714e1ceabe72cf7551a36aa5
route.ts https://github.com/simstudioai/sim/pull/4726/files#diff-1fc82781f04a771c0e797fdfffa287878513e66a20221ed7824bba5452ef6815
route.ts https://github.com/simstudioai/sim/pull/4726/files#diff-a04216e13d00e9bc1ee9824423e5939fa5827a4f85b85b27e2eb70eafa7aa356
route.ts https://github.com/simstudioai/sim/pull/4726/files#diff-17224a587e3c734694d017a97afa42e2c10f56ebf328c69aff7dc32bd8a12aa0
messages-dual-write.test.ts https://github.com/simstudioai/sim/pull/4726/files#diff-725e94c28c52caebdac4c1b05959b164ef8f5a879170890a25e407e3ac4c3623
messages-dual-write.ts https://github.com/simstudioai/sim/pull/4726/files#diff-c88821bdf6c05569ca4a4598cd05e693e1ab106f86aa27e9288906d80c8909fa
post.ts https://github.com/simstudioai/sim/pull/4726/files#diff-60de90a5f54e09f0885aef9b2ced6b38c99d9cee23fd9ca290313eca4923b729
terminal-state.ts https://github.com/simstudioai/sim/pull/4726/files#diff-1c6b98f109e1409147f1c0f312d6c165d3d40062bc9dc1329455a9fbbcc6a539
executor.ts https://github.com/simstudioai/sim/pull/4726/files#diff-c33f60778aa0c14a73019c4f39d873ee087fec05114374d21a5914e5376ac91b
copilot-messages-reconcile.ts https://github.com/simstudioai/sim/pull/4726/files#diff-ecb04b129fc023e636797104dacb0439cd6aa0867d2af7dfcddb37c67df164b9
0217_lovely_iron_fist.sql https://github.com/simstudioai/sim/pull/4726/files#diff-10ab1bdd981091e1a6285565accb28a5dfb401dce64cf6f8f294e4fc827fae93
0217_snapshot.json https://github.com/simstudioai/sim/pull/4726/files#diff-ea929c1c813e525b6b25c898615e239a7e7346e56bef781bb6be613097c93567
_journal.json https://github.com/simstudioai/sim/pull/4726/files#diff-37150cc65ad16ee6fbc5fa318fc096be7730e16d63eaf863e3df5521b7030649
schema.ts https://github.com/simstudioai/sim/pull/4726/files#diff-9a959e2ce3cb4c86957bbae021d06eae364f7b0cb18964f5873bab53220af928
schema.mock.ts https://github.com/simstudioai/sim/pull/4726/files#diff-3b648ee44a059e5fc069169fdfd7c32c89200a3e79b5d0dc25227d3470da73af
apps/sim/app/api/copilot/chat/update-messages/route.test.tshttps://github.com/simstudioai/sim/pull/4726/files#diff-e415967311ffc3f6144c1bf2d54171ab6cc70375714e1ceabe72cf7551a36aa5
View file https://github.com/simstudioai/sim/blob/2b478fb5a5022fda15ad1d63b051618d52d8e85e/apps/sim/app/api/copilot/chat/update-messages/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4726/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4726/files#diff-e415967311ffc3f6144c1bf2d54171ab6cc70375714e1ceabe72cf7551a36aa5
https://github.com/simstudioai/sim/pull/4726/files#diff-e415967311ffc3f6144c1bf2d54171ab6cc70375714e1ceabe72cf7551a36aa5
https://github.com/simstudioai/sim/pull/4726/files#diff-e415967311ffc3f6144c1bf2d54171ab6cc70375714e1ceabe72cf7551a36aa5
https://github.com/simstudioai/sim/pull/4726/files#diff-e415967311ffc3f6144c1bf2d54171ab6cc70375714e1ceabe72cf7551a36aa5
apps/sim/app/api/copilot/chat/update-messages/route.tshttps://github.com/simstudioai/sim/pull/4726/files#diff-1fc82781f04a771c0e797fdfffa287878513e66a20221ed7824bba5452ef6815
View file https://github.com/simstudioai/sim/blob/2b478fb5a5022fda15ad1d63b051618d52d8e85e/apps/sim/app/api/copilot/chat/update-messages/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4726/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4726/files#diff-1fc82781f04a771c0e797fdfffa287878513e66a20221ed7824bba5452ef6815
https://github.com/simstudioai/sim/pull/4726/files#diff-1fc82781f04a771c0e797fdfffa287878513e66a20221ed7824bba5452ef6815
https://github.com/simstudioai/sim/pull/4726/files#diff-1fc82781f04a771c0e797fdfffa287878513e66a20221ed7824bba5452ef6815
https://github.com/simstudioai/sim/pull/4726/files#diff-1fc82781f04a771c0e797fdfffa287878513e66a20221ed7824bba5452ef6815
apps/sim/app/api/mothership/chats/[chatId]/fork/route.tshttps://github.com/simstudioai/sim/pull/4726/files#diff-a04216e13d00e9bc1ee9824423e5939fa5827a4f85b85b27e2eb70eafa7aa356
View file https://github.com/simstudioai/sim/blob/2b478fb5a5022fda15ad1d63b051618d52d8e85e/apps/sim/app/api/mothership/chats/%5BchatId%5D/fork/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4726/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4726/files#diff-a04216e13d00e9bc1ee9824423e5939fa5827a4f85b85b27e2eb70eafa7aa356
https://github.com/simstudioai/sim/pull/4726/files#diff-a04216e13d00e9bc1ee9824423e5939fa5827a4f85b85b27e2eb70eafa7aa356
https://github.com/simstudioai/sim/pull/4726/files#diff-a04216e13d00e9bc1ee9824423e5939fa5827a4f85b85b27e2eb70eafa7aa356
https://github.com/simstudioai/sim/pull/4726/files#diff-a04216e13d00e9bc1ee9824423e5939fa5827a4f85b85b27e2eb70eafa7aa356
apps/sim/app/api/superuser/import-workflow/route.tshttps://github.com/simstudioai/sim/pull/4726/files#diff-17224a587e3c734694d017a97afa42e2c10f56ebf328c69aff7dc32bd8a12aa0
View file https://github.com/simstudioai/sim/blob/2b478fb5a5022fda15ad1d63b051618d52d8e85e/apps/sim/app/api/superuser/import-workflow/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4726/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4726/files#diff-17224a587e3c734694d017a97afa42e2c10f56ebf328c69aff7dc32bd8a12aa0
https://github.com/simstudioai/sim/pull/4726/files#diff-17224a587e3c734694d017a97afa42e2c10f56ebf328c69aff7dc32bd8a12aa0
https://github.com/simstudioai/sim/pull/4726/files#diff-17224a587e3c734694d017a97afa42e2c10f56ebf328c69aff7dc32bd8a12aa0
https://github.com/simstudioai/sim/pull/4726/files#diff-17224a587e3c734694d017a97afa42e2c10f56ebf328c69aff7dc32bd8a12aa0
apps/sim/lib/copilot/chat/messages-dual-write.test.tshttps://github.com/simstudioai/sim/pull/4726/files#diff-725e94c28c52caebdac4c1b05959b164ef8f5a879170890a25e407e3ac4c3623
View file https://github.com/simstudioai/sim/blob/2b478fb5a5022fda15ad1d63b051618d52d8e85e/apps/sim/lib/copilot/chat/messages-dual-write.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4726/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/4726/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4726/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.