Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Phases don't sum to total due to mixed timing sources
- Changed spawn calculation to use compiled.install and compiled.build directly instead of installAndBuildMs, ensuring all phases use consistent timing sources and sum to total.
Or push these changes by commenting:
@cursor push 69f5ad6318
Preview (69f5ad6318)
diff --git a/src/index.js b/src/index.js
--- a/src/index.js
+++ b/src/index.js
@@ -48,7 +48,6 @@
try {
total = timeSpan()
const compiled = await compilePromise
- const installAndBuildMs = total()
const subprocess = spawn({
args: JSON.stringify(args),
@@ -69,7 +68,7 @@
phases: {
install: compiled.install,
build: compiled.build,
- spawn: totalMs - installAndBuildMs - run,
+ spawn: totalMs - compiled.install - compiled.build - run,
run,
total: totalMs
}You can send follow-ups to the cloud agent here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Phases property
compileremoved without updating type definition- Updated Phases interface to replace compile property with install and build properties, matching the runtime implementation, and updated tests accordingly.
Or push these changes by commenting:
@cursor push 9bdb9c4ab0
Preview (9bdb9c4ab0)
diff --git a/src/index.d.ts b/src/index.d.ts
--- a/src/index.d.ts
+++ b/src/index.d.ts
@@ -2,8 +2,10 @@
* Profiling information about the isolated function execution
*/
export interface Phases {
- /** Time waiting for compilation in milliseconds (0 if cached) */
- compile: number
+ /** Time spent installing dependencies in milliseconds (0 if cached) */
+ install: number
+ /** Time spent building with esbuild in milliseconds */
+ build: number
/** Process creation + Node.js boot + template setup in milliseconds */
spawn: number
/** User function execution time in milliseconds */
diff --git a/test/index.js b/test/index.js
--- a/test/index.js
+++ b/test/index.js
@@ -122,7 +122,8 @@
t.is(value, undefined)
t.is(typeof profiling.cpu, 'number')
t.is(typeof profiling.memory, 'number')
- t.is(typeof profiling.phases.compile, 'number')
+ t.is(typeof profiling.phases.install, 'number')
+ t.is(typeof profiling.phases.build, 'number')
t.is(typeof profiling.phases.spawn, 'number')
t.is(typeof profiling.phases.run, 'number')
t.is(typeof profiling.phases.total, 'number')
diff --git a/test/index.test-d.ts b/test/index.test-d.ts
--- a/test/index.test-d.ts
+++ b/test/index.test-d.ts
@@ -100,7 +100,8 @@
expectType<number>(profiling.cpu)
expectType<number>(profiling.memory)
- expectType<number>(profiling.phases.compile)
+ expectType<number>(profiling.phases.install)
+ expectType<number>(profiling.phases.build)
expectType<number>(profiling.phases.spawn)
expectType<number>(profiling.phases.run)
expectType<number>(profiling.phases.total)You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit e373623. Configure here.
Coverage Report for CI Build 26130566187Warning No base build found for commit Coverage: 97.215%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
Coverage Report for CI Build 26130165510Warning No base build found for commit Coverage: 97.219%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |


Note
Low Risk
Low risk: only restructures profiling/return values around compilation and updates related tests/logging, without changing sandboxing, permissions, or execution behavior.
Overview
Refines profiling output for compilation.
compile()now measures dependencyinstalltime andesbuildbuildtime separately and returns{ content, phases }instead of a raw string.Runtime execution now consumes
compiled.contentand mergescompiled.phasesinto the reportedprofiling.phases, recalculatingspawnand simplifying debug logging. Tests were updated to assert the newinstall/buildphase fields instead ofcompile.Reviewed by Cursor Bugbot for commit b2df4b9. Bugbot is set up for automated code reviews on this repo. Configure here.