René's URL Explorer Experiment


Title: fix(logs): record how long a cancelled run had been going by waleedlatif1 · Pull Request #6686 · simstudioai/sim · GitHub

Open Graph Title: fix(logs): record how long a cancelled run had been going by waleedlatif1 · Pull Request #6686 · simstudioai/sim

X Title: fix(logs): record how long a cancelled run had been going by waleedlatif1 · Pull Request #6686 · simstudioai/sim

Description: A cancelled run got an end timestamp and no duration. Every other terminal transition writes both — completeWorkflowExecution sets them together, and a paused run already records its elapsed time — but cancellation writes the log row directly rather than going through completion, so it had no in-memory duration to store and simply omitted the column. Why it matters GET /api/v2/logs filters on minDurationMs / maxDurationMs. A null column drops the row out of every such query, so cancellations are invisible to exactly the searches someone runs when investigating cancellations. The published contract also states the end timestamp is null only "while the run is active" — which a cancelled run is not. Two sites, one shared expression Site Before lib/execution/cancel-workflow-execution.ts .set({ status: 'cancelled', endedAt: new Date() }) lib/table/workflow-group-cancellation.ts .set({ status: 'cancelled', endedAt: new Date(), executionDeadlineAt: null }) Both now derive the duration in the same statement from the row's own started_at, through one shared expression — the two drifting apart from the completion path is what produced this bug, so a second copy would just reset the clock on it. The end instant is computed once in JS and reused, so the stamped end and the derived duration describe the same moment rather than two clock reads. Two deliberate details Bound as an explicit ::timestamp, not a Date. started_at is timestamp without time zone holding a UTC wall clock; a driver-bound Date infers timestamptz, which would make the interval depend on the session zone. Given the release just spent effort pinning exactly that, the cast is the safe form. Floored at 1ms, matching Math.max(1, durationMs) in the completion path, so a run cancelled inside its first millisecond still records that it ran — and the value stays a valid integer for the column. Verification Red-then-green, proven: removing the field from both call sites produced exactly one failure per site, with 32 other tests still green — so they fail for the right reason, not incidentally. The helper's SQL is tested by rendering it through the real PgDialect, matching the existing precedent in prune-metadata-sql.test.ts rather than inventing a pattern. Raw sql templates are otherwise hidden by the global drizzle mocks until they run against Postgres. Full suite: 1,864 files / 24,943 tests passed, 0 failed type-check 23/23, biome, check:audits 26/26 — all clean. No contract changed, so no OpenAPI drift. Not changed The paused-cancellation path already records its duration and is deliberately skipped by these writes (!pausedCancelled), so it needed nothing.

Open Graph Description: A cancelled run got an end timestamp and no duration. Every other terminal transition writes both — completeWorkflowExecution sets them together, and a paused run already records its elapsed time —...

X Description: A cancelled run got an end timestamp and no duration. Every other terminal transition writes both — completeWorkflowExecution sets them together, and a paused run already records its elapsed time —...

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

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:bf714b0a-9da9-e989-739f-1779c9203528
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCB84:267719:C31B7F:10B81CE:6AFB5688
html-safe-nonce0f43ce79906956e3b20cc5ad4459e342ccfacf31c50d86e5e05dabc457eb7a69
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjg0OjI2NzcxOTpDMzFCN0Y6MTBCODFDRTo2QUZCNTY4OCIsInZpc2l0b3JfaWQiOiIzMzM3MzU4NTMzMzI1NDQ0NzQ0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac609067b8506a41d13730757a20a52f136b5446420a9930e6ecf296223b55a64d
hovercard-subject-tagpull_request:4275842592
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/6686/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:altA cancelled run got an end timestamp and no duration. Every other terminal transition writes both — completeWorkflowExecution sets them together, and a paused run already records its elapsed time —...
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/6686/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6686%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%2F6686%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/6686/files
Reloadhttps://github.com/simstudioai/sim/pull/6686/files
Reloadhttps://github.com/simstudioai/sim/pull/6686/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/cancel-run-durationhttps://github.com/simstudioai/sim/tree/fix/cancel-run-duration
Conversation 18 https://github.com/simstudioai/sim/pull/6686
Commits 5 https://github.com/simstudioai/sim/pull/6686/commits
Checks 30 https://github.com/simstudioai/sim/pull/6686/checks
Files changed https://github.com/simstudioai/sim/pull/6686/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6686/files
fix(logs): record how long a cancelled run had been going https://github.com/simstudioai/sim/pull/6686/files#top
Show all changes 5 commits https://github.com/simstudioai/sim/pull/6686/files
8af5877 fix(logs): record how long a cancelled run had been going waleedlatif1 Aug 14, 2026 https://github.com/simstudioai/sim/pull/6686/commits/8af5877713e9aa6ad2b34c15b618940c321dbfcb
d4e33ae fix(logs): saturate the cancelled-run duration at the column ceiling waleedlatif1 Aug 14, 2026 https://github.com/simstudioai/sim/pull/6686/commits/d4e33ae8ce97e05e004b4a0a3eb18f6fe7013f4d
d903a3e fix(logs): record the duration on the other two cancellation writes waleedlatif1 Aug 14, 2026 https://github.com/simstudioai/sim/pull/6686/commits/d903a3ea7559316af2f45d04998dda28ae562956
7aa0850 fix(logs): let a recorded duration outlive a later cancellation waleedlatif1 Aug 14, 2026 https://github.com/simstudioai/sim/pull/6686/commits/7aa08509d314d80ae7f3cc7241f254f8a9fe2311
c744245 fix(logs): only a paused run keeps the duration it recorded waleedlatif1 Aug 14, 2026 https://github.com/simstudioai/sim/pull/6686/commits/c74424599d78530f4b83de76090932c712ec0232
Clear filters https://github.com/simstudioai/sim/pull/6686/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6686/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6686/files
cancel-workflow-execution.test.ts https://github.com/simstudioai/sim/pull/6686/files#diff-a71da39fdb4d6534f028dd1f0532f7ccc75908fa235903ff769ab3b9920548d2
cancel-workflow-execution.ts https://github.com/simstudioai/sim/pull/6686/files#diff-9d9920803ab82adaed6a74e928462a1f717dca01c69da3757d211c0cdb215637
duration.test.ts https://github.com/simstudioai/sim/pull/6686/files#diff-bc6c7fbf010082293c353c7cfb2ad5e2097b86c5e5fec8e04fe86530ed5928ed
duration.ts https://github.com/simstudioai/sim/pull/6686/files#diff-39bf98e2295f07dc0911577e19e7d349415170f21031fb2bf17037a5f449b326
workflow-group-cancellation.test.ts https://github.com/simstudioai/sim/pull/6686/files#diff-f59c50ec7b1055c76142c62dfdfa52aedaddbfe5648be5b72d9f820734a7f35c
workflow-group-cancellation.ts https://github.com/simstudioai/sim/pull/6686/files#diff-abfdce77a0e1b3f5eefc68a78b21d07d2dcd9c1ee6f9f7bc494373af5720a8d5
human-in-the-loop-manager.test.ts https://github.com/simstudioai/sim/pull/6686/files#diff-72580e5e18315802c8260c3c01abd48ff8de248edd72c9890764c158e0e52478
human-in-the-loop-manager.ts https://github.com/simstudioai/sim/pull/6686/files#diff-bb1129b15dc9783d16371ddc2f8992d36e41c60787a458e77e1c59a7e721d292
apps/sim/lib/execution/cancel-workflow-execution.test.tshttps://github.com/simstudioai/sim/pull/6686/files#diff-a71da39fdb4d6534f028dd1f0532f7ccc75908fa235903ff769ab3b9920548d2
View file https://github.com/simstudioai/sim/blob/c74424599d78530f4b83de76090932c712ec0232/apps/sim/lib/execution/cancel-workflow-execution.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6686/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6686/files#diff-a71da39fdb4d6534f028dd1f0532f7ccc75908fa235903ff769ab3b9920548d2
apps/sim/lib/execution/cancel-workflow-execution.tshttps://github.com/simstudioai/sim/pull/6686/files#diff-9d9920803ab82adaed6a74e928462a1f717dca01c69da3757d211c0cdb215637
View file https://github.com/simstudioai/sim/blob/c74424599d78530f4b83de76090932c712ec0232/apps/sim/lib/execution/cancel-workflow-execution.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6686/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6686/files#diff-9d9920803ab82adaed6a74e928462a1f717dca01c69da3757d211c0cdb215637
https://github.com/simstudioai/sim/pull/6686/files#diff-9d9920803ab82adaed6a74e928462a1f717dca01c69da3757d211c0cdb215637
https://github.com/simstudioai/sim/pull/6686/files#diff-9d9920803ab82adaed6a74e928462a1f717dca01c69da3757d211c0cdb215637
https://github.com/simstudioai/sim/pull/6686/files#diff-9d9920803ab82adaed6a74e928462a1f717dca01c69da3757d211c0cdb215637
apps/sim/lib/logs/execution/duration.test.tshttps://github.com/simstudioai/sim/pull/6686/files#diff-bc6c7fbf010082293c353c7cfb2ad5e2097b86c5e5fec8e04fe86530ed5928ed
View file https://github.com/simstudioai/sim/blob/c74424599d78530f4b83de76090932c712ec0232/apps/sim/lib/logs/execution/duration.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6686/{{ revealButtonHref }}
apps/sim/lib/logs/execution/duration.tshttps://github.com/simstudioai/sim/pull/6686/files#diff-39bf98e2295f07dc0911577e19e7d349415170f21031fb2bf17037a5f449b326
View file https://github.com/simstudioai/sim/blob/c74424599d78530f4b83de76090932c712ec0232/apps/sim/lib/logs/execution/duration.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6686/{{ revealButtonHref }}
apps/sim/lib/table/workflow-group-cancellation.test.tshttps://github.com/simstudioai/sim/pull/6686/files#diff-f59c50ec7b1055c76142c62dfdfa52aedaddbfe5648be5b72d9f820734a7f35c
View file https://github.com/simstudioai/sim/blob/c74424599d78530f4b83de76090932c712ec0232/apps/sim/lib/table/workflow-group-cancellation.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6686/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6686/files#diff-f59c50ec7b1055c76142c62dfdfa52aedaddbfe5648be5b72d9f820734a7f35c
https://github.com/simstudioai/sim/pull/6686/files#diff-f59c50ec7b1055c76142c62dfdfa52aedaddbfe5648be5b72d9f820734a7f35c
https://github.com/simstudioai/sim/pull/6686/files#diff-f59c50ec7b1055c76142c62dfdfa52aedaddbfe5648be5b72d9f820734a7f35c
https://github.com/simstudioai/sim/pull/6686/files#diff-f59c50ec7b1055c76142c62dfdfa52aedaddbfe5648be5b72d9f820734a7f35c
apps/sim/lib/table/workflow-group-cancellation.tshttps://github.com/simstudioai/sim/pull/6686/files#diff-abfdce77a0e1b3f5eefc68a78b21d07d2dcd9c1ee6f9f7bc494373af5720a8d5
View file https://github.com/simstudioai/sim/blob/c74424599d78530f4b83de76090932c712ec0232/apps/sim/lib/table/workflow-group-cancellation.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6686/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6686/files#diff-abfdce77a0e1b3f5eefc68a78b21d07d2dcd9c1ee6f9f7bc494373af5720a8d5
https://github.com/simstudioai/sim/pull/6686/files#diff-abfdce77a0e1b3f5eefc68a78b21d07d2dcd9c1ee6f9f7bc494373af5720a8d5
https://github.com/simstudioai/sim/pull/6686/files#diff-abfdce77a0e1b3f5eefc68a78b21d07d2dcd9c1ee6f9f7bc494373af5720a8d5
Please reload this pagehttps://github.com/simstudioai/sim/pull/6686/files
https://github.com/simstudioai/sim/pull/6686/files#diff-abfdce77a0e1b3f5eefc68a78b21d07d2dcd9c1ee6f9f7bc494373af5720a8d5
https://github.com/simstudioai/sim/pull/6686/files#diff-abfdce77a0e1b3f5eefc68a78b21d07d2dcd9c1ee6f9f7bc494373af5720a8d5
https://github.com/simstudioai/sim/pull/6686/files#diff-abfdce77a0e1b3f5eefc68a78b21d07d2dcd9c1ee6f9f7bc494373af5720a8d5
apps/sim/lib/workflows/executor/human-in-the-loop-manager.test.tshttps://github.com/simstudioai/sim/pull/6686/files#diff-72580e5e18315802c8260c3c01abd48ff8de248edd72c9890764c158e0e52478
View file https://github.com/simstudioai/sim/blob/c74424599d78530f4b83de76090932c712ec0232/apps/sim/lib/workflows/executor/human-in-the-loop-manager.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6686/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6686/files#diff-72580e5e18315802c8260c3c01abd48ff8de248edd72c9890764c158e0e52478
https://github.com/simstudioai/sim/pull/6686/files#diff-72580e5e18315802c8260c3c01abd48ff8de248edd72c9890764c158e0e52478
apps/sim/lib/workflows/executor/human-in-the-loop-manager.tshttps://github.com/simstudioai/sim/pull/6686/files#diff-bb1129b15dc9783d16371ddc2f8992d36e41c60787a458e77e1c59a7e721d292
View file https://github.com/simstudioai/sim/blob/c74424599d78530f4b83de76090932c712ec0232/apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6686/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6686/files#diff-bb1129b15dc9783d16371ddc2f8992d36e41c60787a458e77e1c59a7e721d292
https://github.com/simstudioai/sim/pull/6686/files#diff-bb1129b15dc9783d16371ddc2f8992d36e41c60787a458e77e1c59a7e721d292
https://github.com/simstudioai/sim/pull/6686/files#diff-bb1129b15dc9783d16371ddc2f8992d36e41c60787a458e77e1c59a7e721d292
Please reload this pagehttps://github.com/simstudioai/sim/pull/6686/files
https://github.com/simstudioai/sim/pull/6686/files#diff-bb1129b15dc9783d16371ddc2f8992d36e41c60787a458e77e1c59a7e721d292
Please reload this pagehttps://github.com/simstudioai/sim/pull/6686/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.