[core] Support negative startIndex for streaming - #1460

Merged
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start
Mar 20, 2026
Merged

[core] Support negative startIndex for streaming#1460
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Negative startIndex values (e.g. -3) resolve to n chunks before the known end of the stream. All world implementations (local, postgres, vercel) support this. Includes unit tests, e2e test, and doc updates.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7a2ee25

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
NameType
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
@workflow/corePatch
@workflow/cliPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/world-testingPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.043s (-4.9%)1.005s (~)0.962s101.00x
💻 LocalNitro0.043s (-8.4% 🟢)1.005s (~)0.962s101.02x
🐘 PostgresExpress0.048s (-32.2% 🟢)1.011s (-0.6%)0.963s101.13x
💻 LocalNext.js (Turbopack)0.050s1.005s0.955s101.18x
🌐 RedisNext.js (Turbopack)0.055s1.005s0.949s101.30x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.953s101.38x
🐘 PostgresNitro0.063s (-8.8% 🟢)1.013s (~)0.949s101.48x
🌐 MongoDBNext.js (Turbopack)0.114s1.008s0.893s102.68x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.464s (-35.6% 🟢)2.116s (-18.2% 🟢)1.651s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.114s (-2.2%)2.012s (~)0.898s101.00x
💻 LocalNext.js (Turbopack)1.119s2.005s0.886s101.00x
🌐 RedisNext.js (Turbopack)1.125s2.006s0.882s101.01x
💻 LocalExpress1.126s (~)2.006s (~)0.880s101.01x
💻 LocalNitro1.134s (~)2.005s (~)0.871s101.02x
🐘 PostgresNext.js (Turbopack)1.147s2.012s0.865s101.03x
🐘 PostgresNitro1.152s (+0.8%)2.014s (~)0.862s101.03x
🌐 MongoDBNext.js (Turbopack)1.310s2.009s0.698s101.18x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.083s (-10.3% 🟢)3.346s (-12.2% 🟢)1.263s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.739s (-1.5%)11.043s (~)0.304s31.00x
🌐 RedisNext.js (Turbopack)10.778s11.023s0.245s31.00x
💻 LocalNext.js (Turbopack)10.804s11.023s0.219s31.01x
🐘 PostgresNext.js (Turbopack)10.905s11.042s0.137s31.02x
💻 LocalNitro10.910s (~)11.023s (~)0.113s31.02x
💻 LocalExpress10.914s (~)11.023s (~)0.108s31.02x
🐘 PostgresNitro11.001s (~)11.046s (~)0.046s31.02x
🌐 MongoDBNext.js (Turbopack)12.213s13.016s0.803s31.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)17.063s (-3.9%)18.514s (-6.5% 🟢)1.451s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express14.176s (-2.7%)15.041s (~)0.865s41.00x
🌐 RedisNext.js (Turbopack)14.263s15.030s0.766s41.01x
🐘 PostgresNext.js (Turbopack)14.531s15.044s0.513s41.03x
💻 LocalNext.js (Turbopack)14.559s15.030s0.471s41.03x
🐘 PostgresNitro14.800s (~)15.044s (~)0.243s41.04x
💻 LocalNitro14.895s (~)15.029s (~)0.133s41.05x
💻 LocalExpress14.928s (~)15.027s (-3.2%)0.099s41.05x
🌐 MongoDBNext.js (Turbopack)17.872s18.026s0.154s41.26x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.853s (+1.2%)34.473s (-0.6%)1.620s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.190s (-5.9% 🟢)14.038s (-3.0%)0.847s71.00x
🌐 RedisNext.js (Turbopack)13.302s14.026s0.723s71.01x
🐘 PostgresNext.js (Turbopack)14.132s14.613s0.481s71.07x
🐘 PostgresNitro14.413s (~)15.041s (~)0.628s61.09x
💻 LocalNext.js (Turbopack)15.756s16.029s0.273s61.19x
💻 LocalExpress16.483s (-1.2%)17.031s (~)0.548s61.25x
💻 LocalNitro16.489s (~)17.029s (~)0.539s61.25x
🌐 MongoDBNext.js (Turbopack)20.399s21.025s0.625s51.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)56.806s (-9.5% 🟢)57.958s (-10.1% 🟢)1.153s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-4.3%)2.011s (~)0.800s151.00x
🐘 PostgresNext.js (Turbopack)1.266s2.013s0.746s151.05x
🐘 PostgresNitro1.281s (-0.9%)2.011s (~)0.730s151.06x
🌐 RedisNext.js (Turbopack)1.300s2.006s0.706s151.07x
💻 LocalNext.js (Turbopack)1.489s2.005s0.516s151.23x
💻 LocalNitro1.509s (+1.7%)2.006s (~)0.497s151.25x
💻 LocalExpress1.520s (+0.9%)2.006s (~)0.486s151.25x
🌐 MongoDBNext.js (Turbopack)2.156s3.008s0.852s101.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.664s (+6.9% 🔺)3.854s (-1.2%)1.189s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.366s (-3.8%)3.012s (~)0.646s101.00x
🐘 PostgresNitro2.459s (~)3.013s (~)0.553s101.04x
🐘 PostgresNext.js (Turbopack)2.515s3.012s0.497s101.06x
🌐 RedisNext.js (Turbopack)2.523s3.008s0.485s101.07x
💻 LocalNext.js (Turbopack)2.655s3.007s0.353s101.12x
💻 LocalNitro2.909s (+1.3%)3.107s (~)0.198s101.23x
💻 LocalExpress2.929s (-2.3%)3.308s (-7.2% 🟢)0.379s101.24x
🌐 MongoDBNext.js (Turbopack)4.824s5.345s0.521s62.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.892s (+10.0% 🔺)4.180s (+3.8%)1.287s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.522s (-1.9%)4.014s (~)0.492s81.00x
🐘 PostgresNitro3.609s (-0.6%)4.014s (~)0.405s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.014s0.246s81.07x
🌐 RedisNext.js (Turbopack)4.125s5.012s0.887s61.17x
💻 LocalNext.js (Turbopack)7.055s7.767s0.712s42.00x
💻 LocalNitro8.305s (+2.2%)8.770s (~)0.465s42.36x
💻 LocalExpress8.379s (-1.1%)9.020s (~)0.641s42.38x
🌐 MongoDBNext.js (Turbopack)10.095s10.680s0.585s32.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.478s (+3.7%)4.771s (-4.8%)1.293s71.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.202s (-4.6%)2.010s (~)0.809s151.00x
🐘 PostgresNext.js (Turbopack)1.253s2.011s0.758s151.04x
🐘 PostgresNitro1.273s (~)2.011s (~)0.738s151.06x
🌐 RedisNext.js (Turbopack)1.319s2.006s0.688s151.10x
💻 LocalNext.js (Turbopack)1.529s2.006s0.477s151.27x
💻 LocalNitro1.540s (-1.3%)2.005s (~)0.465s151.28x
💻 LocalExpress1.547s (+0.7%)2.005s (~)0.458s151.29x
🌐 MongoDBNext.js (Turbopack)2.181s3.008s0.827s101.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.572s (-1.1%)3.643s (-9.2% 🟢)1.070s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.341s (-4.5%)3.012s (~)0.671s101.00x
🐘 PostgresNitro2.454s (~)3.013s (~)0.559s101.05x
🐘 PostgresNext.js (Turbopack)2.470s3.011s0.541s101.06x
🌐 RedisNext.js (Turbopack)2.569s3.008s0.439s101.10x
💻 LocalNext.js (Turbopack)2.818s3.109s0.291s101.20x
💻 LocalNitro2.963s (-2.1%)3.676s (~)0.713s91.27x
💻 LocalExpress2.990s (-1.4%)3.676s (-2.2%)0.686s91.28x
🌐 MongoDBNext.js (Turbopack)4.746s5.178s0.432s62.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.766s (+16.2% 🔺)3.783s (+3.3%)1.017s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.517s (-2.3%)4.013s (~)0.496s81.00x
🐘 PostgresNitro3.651s (+1.0%)4.015s (~)0.363s81.04x
🐘 PostgresNext.js (Turbopack)3.735s4.014s0.279s81.06x
🌐 RedisNext.js (Turbopack)4.147s4.726s0.579s71.18x
💻 LocalNext.js (Turbopack)8.126s8.773s0.647s42.31x
💻 LocalNitro8.728s (+1.0%)9.019s (~)0.291s42.48x
💻 LocalExpress8.804s (-2.8%)9.025s (-7.7% 🟢)0.220s42.50x
🌐 MongoDBNext.js (Turbopack)9.951s10.684s0.732s32.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.848s (-1.8%)5.484s (~)1.636s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.652s (-24.7% 🟢)1.009s (-1.7%)0.357s601.00x
🌐 RedisNext.js (Turbopack)0.687s1.004s0.318s601.05x
🐘 PostgresNext.js (Turbopack)0.835s1.026s0.191s591.28x
💻 LocalNext.js (Turbopack)0.850s1.004s0.154s601.30x
🐘 PostgresNitro0.873s (-2.6%)1.009s (-3.3%)0.136s601.34x
💻 LocalNitro0.980s (+2.6%)1.136s (+11.3% 🔺)0.156s531.50x
💻 LocalExpress0.980s (~)1.158s (+5.7% 🔺)0.178s521.50x
🌐 MongoDBNext.js (Turbopack)2.158s3.008s0.851s203.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)10.623s (+1.2%)11.948s (-3.1%)1.325s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.572s (-25.7% 🟢)2.010s (-33.3% 🟢)0.438s451.00x
🌐 RedisNext.js (Turbopack)1.678s2.006s0.328s451.07x
🐘 PostgresNext.js (Turbopack)2.027s2.511s0.484s361.29x
🐘 PostgresNitro2.148s (-0.6%)3.012s (+1.1%)0.864s301.37x
💻 LocalNext.js (Turbopack)2.666s3.007s0.341s301.70x
💻 LocalNitro2.974s (+0.6%)3.330s (+7.0% 🔺)0.355s281.89x
💻 LocalExpress2.987s (-0.9%)3.329s (-6.1% 🟢)0.342s281.90x
🌐 MongoDBNext.js (Turbopack)5.273s6.011s0.739s153.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.443s (-0.6%)33.373s (-2.3%)0.929s31.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.263s (-23.5% 🟢)4.013s (-19.3% 🟢)0.750s301.00x
🌐 RedisNext.js (Turbopack)3.293s4.008s0.716s301.01x
🐘 PostgresNext.js (Turbopack)4.106s4.975s0.868s251.26x
🐘 PostgresNitro4.367s (+0.7%)5.015s (~)0.648s241.34x
💻 LocalNext.js (Turbopack)8.417s9.016s0.599s142.58x
💻 LocalNitro8.989s (~)9.479s (~)0.490s132.75x
💻 LocalExpress9.106s (~)9.710s (-0.8%)0.604s132.79x
🌐 MongoDBNext.js (Turbopack)10.535s11.019s0.484s113.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)89.160s (-8.5% 🟢)90.435s (-9.0% 🟢)1.274s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.243s (-19.5% 🟢)1.009s (~)0.766s601.00x
🐘 PostgresNext.js (Turbopack)0.265s1.009s0.744s601.09x
🐘 PostgresNitro0.298s (+1.1%)1.009s (~)0.711s601.22x
🌐 RedisNext.js (Turbopack)0.401s1.021s0.620s591.65x
💻 LocalNext.js (Turbopack)0.558s1.021s0.464s592.29x
💻 LocalNitro0.589s (-1.5%)1.004s (~)0.416s602.42x
💻 LocalExpress0.606s (+0.5%)1.004s (~)0.398s602.49x
🌐 MongoDBNext.js (Turbopack)1.655s2.149s0.494s286.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.914s (+0.7%)3.311s (-7.5% 🟢)1.397s191.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.419s (-20.5% 🟢)1.009s (~)0.590s901.00x
🐘 PostgresNitro0.540s (~)1.009s (~)0.469s901.29x
🐘 PostgresNext.js (Turbopack)0.569s1.021s0.451s891.36x
🌐 RedisNext.js (Turbopack)1.171s2.006s0.835s452.79x
💻 LocalNext.js (Turbopack)2.377s3.008s0.632s305.67x
💻 LocalNitro2.495s (+0.8%)3.008s (~)0.513s305.95x
💻 LocalExpress2.545s (-1.4%)3.009s (~)0.464s306.07x
🌐 MongoDBNext.js (Turbopack)4.756s5.287s0.532s1811.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.221s (-6.3% 🟢)4.527s (-5.8% 🟢)1.306s211.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.605s (-32.6% 🟢)1.009s (-3.1%)0.404s1191.00x
🐘 PostgresNitro0.919s (-2.1%)1.216s (+2.0%)0.297s991.52x
🐘 PostgresNext.js (Turbopack)0.964s1.345s0.381s901.59x
🌐 RedisNext.js (Turbopack)2.741s3.007s0.267s404.53x
🌐 MongoDBNext.js (Turbopack)9.862s10.432s0.570s1216.29x
💻 LocalNext.js (Turbopack)10.107s10.606s0.499s1216.70x
💻 LocalNitro10.955s (-1.4%)11.571s (-0.8%)0.616s1118.10x
💻 LocalExpress11.174s (-1.0%)11.846s (-1.5%)0.671s1118.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)6.960s (-11.2% 🟢)8.087s (-13.7% 🟢)1.127s151.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.168s (-22.4% 🟢)0.996s (~)0.001s (+16.7% 🔺)1.012s (~)0.844s101.00x
🌐 RedisNext.js (Turbopack)0.178s1.000s0.002s1.007s0.829s101.06x
💻 LocalNext.js (Turbopack)0.185s1.002s0.010s1.016s0.831s101.10x
💻 LocalNitro0.198s (+0.7%)1.003s (~)0.011s (-5.9% 🟢)1.017s (~)0.819s101.18x
💻 LocalExpress0.201s (-1.7%)1.003s (~)0.012s (-2.5%)1.017s (~)0.816s101.20x
🐘 PostgresNext.js (Turbopack)0.218s1.002s0.001s1.014s0.796s101.30x
🐘 PostgresNitro0.241s (+0.8%)0.993s (~)0.002s (+7.1% 🔺)1.013s (~)0.772s101.43x
🌐 MongoDBNext.js (Turbopack)0.493s0.960s0.001s1.009s0.516s102.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.656s (-4.3%)2.778s (-7.0% 🟢)0.004s (-29.5% 🟢)3.267s (-9.1% 🟢)1.611s101.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.555s1.000s0.003s1.011s0.456s601.00x
🐘 PostgresExpress0.616s (-11.2% 🟢)1.022s (+1.8%)0.003s (-18.6% 🟢)1.042s (+1.4%)0.425s591.11x
💻 LocalNext.js (Turbopack)0.669s1.008s0.010s1.024s0.355s591.20x
💻 LocalNitro0.722s (-0.7%)1.009s (~)0.010s (+3.3%)1.023s (~)0.301s591.30x
💻 LocalExpress0.731s (-5.9% 🟢)1.009s (-1.7%)0.010s (-2.2%)1.023s (-1.8%)0.292s591.32x
🐘 PostgresNitro0.733s (+1.5%)1.021s (+1.6%)0.004s (+11.7% 🔺)1.044s (+1.8%)0.311s591.32x
🐘 PostgresNext.js (Turbopack)0.751s1.010s0.004s1.027s0.276s591.35x
🌐 MongoDBNext.js (Turbopack)1.329s1.950s0.003s2.013s0.685s302.39x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.008s (+10.1% 🔺)5.891s (+1.8%)0.481s (+140.2% 🔺)6.857s (+5.0% 🔺)1.849s91.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.802s1.000s0.000s1.005s0.203s601.00x
🐘 PostgresExpress0.814s (-8.9% 🟢)1.043s (-3.7%)0.000s (+89.7% 🔺)1.071s (-3.1%)0.257s581.02x
🐘 PostgresNitro0.933s (+1.3%)1.150s (+8.3% 🔺)0.000s (+64.7% 🔺)1.180s (+9.2% 🔺)0.247s511.16x
🐘 PostgresNext.js (Turbopack)0.985s1.177s0.000s1.188s0.203s511.23x
💻 LocalNitro1.236s (+0.9%)2.020s (~)0.000s (-23.1% 🟢)2.023s (~)0.786s301.54x
💻 LocalNext.js (Turbopack)1.237s2.018s0.000s2.022s0.785s301.54x
💻 LocalExpress1.239s (-1.5%)2.020s (~)0.000s (-35.3% 🟢)2.023s (~)0.783s301.55x
🌐 MongoDBNext.js (Turbopack)2.360s2.946s0.000s3.008s0.648s202.94x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.692s (+26.0% 🔺)4.603s (+15.4% 🔺)0.000s (-41.7% 🟢)5.065s (+10.4% 🔺)1.373s121.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.529s2.034s0.000s2.040s0.510s301.00x
🐘 PostgresExpress1.686s (-6.6% 🟢)2.104s (~)0.000s (NaN%)2.133s (+0.5%)0.447s291.10x
🐘 PostgresNitro1.858s (-1.7%)2.098s (-5.5% 🟢)0.000s (-6.9% 🟢)2.117s (-5.5% 🟢)0.258s291.22x
🐘 PostgresNext.js (Turbopack)2.000s2.349s0.000s2.360s0.360s261.31x
💻 LocalNitro3.382s (+1.6%)4.033s (+1.6%)0.000s (-14.7% 🟢)4.037s (+1.6%)0.655s152.21x
💻 LocalNext.js (Turbopack)3.482s4.030s0.001s4.036s0.554s152.28x
💻 LocalExpress3.498s (+1.6%)4.098s (~)0.001s (+75.0% 🔺)4.102s (~)0.604s152.29x
🌐 MongoDBNext.js (Turbopack)4.395s4.976s0.000s5.011s0.616s122.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.869s (-11.4% 🟢)4.515s (-16.3% 🟢)0.000s (-100.0% 🟢)5.038s (-15.5% 🟢)1.169s131.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)18/21
🐘 PostgresExpress21/21
▲ VercelNext.js (Turbopack)21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres20/21
Next.js (Turbopack)🌐 Redis10/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production779167847
✅ 💻 Local Development7820142924
✅ 📦 Local Production7820142924
✅ 🐘 Local Postgres7270120847
✅ 🪟 Windows720577
❌ 🌍 Community Worlds1225821201
✅ 📋 Other198033231
Total3462595304051

❌ Failed Tests

▲ Vercel Production (1 failed)

example (1 failed):

🌍 Community Worlds (58 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

turso (53 failed):

  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KM6EQMFSSRJS76FW2VKYFC6X
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KM6EPGB5MHJ8YKVRWV2GKBEZ
  • promiseRaceWorkflow | wrun_01KM6EPKKCXKBHS77F1SN43AMM
  • promiseAnyWorkflow | wrun_01KM6EPNQB22J6R6YRY6NM84FM
  • importedStepOnlyWorkflow | wrun_01KM6ER2CBE39PF8CGSM5VP0JD
  • hookWorkflow | wrun_01KM6EQ25HJT2YYHAAJ3XADSAM
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • sleepingWorkflow | wrun_01KM6EQWAX2WSGW45X18BZM48A
  • parallelSleepWorkflow | wrun_01KM6ER8X111T19990VHTDFHXS
  • nullByteWorkflow | wrun_01KM6EREKA8MP390A0MWFDPKXY
  • workflowAndStepMetadataWorkflow | wrun_01KM6ERGYD1SHFWFEJBT7G0GT5
  • fetchWorkflow | wrun_01KM6ETBHPJ888CCD6008X0900
  • promiseRaceStressTestWorkflow | wrun_01KM6ETEZ9YDMFT5D1SWPJ6F4B
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KM6EXEX6EBHWZPDYABKM366M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KM6EYQZ9Q9GVYM8CVTMW9YEX
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KM6EZBGY895Q2T0QB7R3CWYR
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KM6EZMBHD3WX0SF21M07MJXY
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KM6EZV14JAWSMACBS0M0N4D1
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KM6EZX6CXS0CFYSDT2BWRHQ7
  • startFromWorkflow - calling start() directly inside a workflow function with hook communication
  • fibonacciWorkflow - recursive workflow composition via start()
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KM6F0CERY0X2RQKHYVV0M8CN
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KM6F0J8FCDZQ68EA8PWB8GJF
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KM6F0RZ6RFJP7415J3S6BTNR
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KM6F10P79TYKACWGFVXHKPEE
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KM6F178G30Z4VDETWFV53JPJ
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KM6F1DVYE9TNCTP39V71912Q
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KM6F1PTC83D0SYRWJA2XTXTP
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KM6F21X21AEBYXFSBTS5V6M7
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KM6F2A1JP11Z8KGDAWNB2GK3
  • cancelRun - cancelling a running workflow | wrun_01KM6F2GTPDS6HKWM3X5YQF41H
  • cancelRun via CLI - cancelling a running workflow | wrun_01KM6F2T3Z4YFC0NXTB3JXJQZ9
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01KM6F375GH61TFF6G0YZSM0KA
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KM6F3V6D7PN667T48JCEY8E7
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KM6F45ZYNS8T1RP0HNEJNGZ7

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro7007
❌ example6917
✅ express7007
✅ fastify7007
✅ hono7007
✅ nextjs-turbopack7502
✅ nextjs-webpack7502
✅ nitro7007
✅ nuxt7007
✅ sveltekit7007
✅ vite7007
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7205
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5435
✅ redis-dev302
❌ redis5525
✅ turso-dev302
❌ turso4535
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable66011
✅ e2e-local-postgres-nest-stable66011
✅ e2e-local-prod-nest-stable66011

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: failure
  • Windows: success

Check the workflow run for details.

VaguelySeriousand others added 2 commits March 19, 2026 19:17
Negative startIndex values (e.g. -3) resolve to n chunks before the
known end of the stream. All world implementations (local, postgres,
vercel) support this. Includes unit tests, e2e test, and doc updates.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threadpackages/world-vercel/src/utils.ts Outdated
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is a clean, well-tested feature. The implementation is consistent across worlds and the clamping behavior is solid. A few comments inline — the main concern is the docs could better call out the live-stream caveat, and the skill file could mention negative startIndex.

```

The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received.
The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received. Negative values are also supported (e.g. `-5` starts 5 chunks before the end), which is useful for showing the most recent output without replaying the full stream.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence mentions negative values as useful for "showing the most recent output without replaying the full stream" — but in the context of WorkflowChatTransport, the transport itself never uses negative startIndex (it tracks chunkIndex incrementally). The mention here might confuse readers into thinking the transport automatically leverages this.

Consider clarifying that this is useful for custom stream consumption (e.g., a dashboard showing recent output), not something WorkflowChatTransport does internally.


This allows clients to reconnect and continue receiving data from where they left off, rather than restarting from the beginning.

`startIndex` also supports **negative values** to read relative to the end of the stream. For example, `startIndex: -5` starts 5 chunks before the current end. This is useful when you want to show the most recent output without reading the entire stream history:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting that on a live (not-yet-closed) stream, the negative startIndex resolves at connection time — so -5 means "5 before the current end at the time of connecting", and any chunks written afterward will still be delivered. This is an important subtlety the e2e test handles (via waitForCompletion: true) but the docs do not mention.

A short note like: "On an active stream, the index resolves relative to the chunk count at connection time; subsequent chunks are still delivered." would prevent misunderstanding.

Comment threadpackages/world-local/src/streamer.ts Outdated
// Resolve negative startIndex relative to the number of data chunks
// (excluding the trailing EOF marker chunk, if present).
let dataChunkCount = chunkFiles.length;
if (startIndex < 0 && chunkFiles.length > 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: startIndex is typed as number | undefined (from the startIndex?: number parameter). The startIndex < 0 check works because undefined < 0 is false in JS, but it reads a bit fragile. Consider an explicit typeof startIndex === 'number' && startIndex < 0 guard to match the style used in world-vercel/src/streamer.ts:127.

if (startIndex < 0 && chunkFiles.length > 0) {
const lastFile = chunkFiles[chunkFiles.length - 1];
const lastExt = fileExtMap.get(lastFile) ?? '.bin';
const lastChunk = deserializeChunk(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads and deserializes the last chunk file just to check eof. On the hot path for a stream with many chunks, this is an extra disk read every time a reader connects with a negative startIndex. Not blocking, but worth a comment noting the cost, or consider whether the EOF state could be tracked more cheaply (e.g., checking for a sentinel file).


// Resolve negative offset relative to the data chunk count
// (excluding the trailing EOF marker, if present)
if (offset < 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nit as the local streamer: offset starts as startIndex ?? 0, so it can never be undefined here — but an explicit typeof guard would make the intent clearer at a glance.

{/* @skip-typecheck: incomplete code sample */}
```typescript
// Read only the last 10 chunks
const stream = run.getReadable({ startIndex: -10 });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add some note/callout to be careful about paginating on this. Because streams are live and will continue enqueueing chunks, relative numbers will map to different absolute chunk "IDs" on subsequent calls. I think accurate pagination is only possible when cursor based, and streams don't support cursor based pagination yet so clients should account for that limitation

@VaguelySeriousVaguelySeriousMar 20, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a problem when using run.getReadable directly, but it is a big problem for resumption, i.e. WorkflowChatTransport. I'm working on this in a follow-up PR together with a metadata/tail endpoint, and cursor-based pagination. I'll add a comment in this PR to mention the limitation

// and 2 chunks to the "test" named stream:
// chunk 0: binary "Hello, named stream!"
// chunk 1: object { foo: 'bar' }
describe.skipIf(isLocalDeployment())('outputStreamWorkflow', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we skipping this test in local deployment? 🤔 this might be outdated and we should probably re-enable streaming tests in local deployments

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already being done so this PR isn't changing it. I might try re-enabling in the next PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah just fly by noticed this

// Negative startIndex resolves at connection time using knownChunkCount,
// so the stream must be fully written before connecting the reader.
waitForCompletion: true,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The e2e coverage for negative startIndex only tests -1 (last chunk). The unit tests in world-local/src/streamer.test.ts are more thorough (covering -2 and clamping with -100), but consider adding a clamping case to this data-driven loop too — e.g., startIndex: -100 expecting all chunks — so the full resolution path is exercised end-to-end across all worlds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add a broader test in the next PR

- Clarify that negative startIndex is for custom consumers, not WorkflowChatTransport
- Add live-stream caveat for negative startIndex resolution timing
- Add pagination limitation callout for live streams
- Use explicit typeof guards for negative startIndex checks (world-local, world-postgres)
- Add cost comment for EOF marker disk read in world-local
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threaddocs/content/docs/ai/resumable-streams.mdx Outdated
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@ghostghost mentioned this pull request Mar 20, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

[core] Support negative startIndex for streaming - #1460

Merged
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start
Mar 20, 2026
Merged

[core] Support negative startIndex for streaming#1460
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Negative startIndex values (e.g. -3) resolve to n chunks before the known end of the stream. All world implementations (local, postgres, vercel) support this. Includes unit tests, e2e test, and doc updates.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7a2ee25

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
NameType
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
@workflow/corePatch
@workflow/cliPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/world-testingPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.043s (-4.9%)1.005s (~)0.962s101.00x
💻 LocalNitro0.043s (-8.4% 🟢)1.005s (~)0.962s101.02x
🐘 PostgresExpress0.048s (-32.2% 🟢)1.011s (-0.6%)0.963s101.13x
💻 LocalNext.js (Turbopack)0.050s1.005s0.955s101.18x
🌐 RedisNext.js (Turbopack)0.055s1.005s0.949s101.30x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.953s101.38x
🐘 PostgresNitro0.063s (-8.8% 🟢)1.013s (~)0.949s101.48x
🌐 MongoDBNext.js (Turbopack)0.114s1.008s0.893s102.68x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.464s (-35.6% 🟢)2.116s (-18.2% 🟢)1.651s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.114s (-2.2%)2.012s (~)0.898s101.00x
💻 LocalNext.js (Turbopack)1.119s2.005s0.886s101.00x
🌐 RedisNext.js (Turbopack)1.125s2.006s0.882s101.01x
💻 LocalExpress1.126s (~)2.006s (~)0.880s101.01x
💻 LocalNitro1.134s (~)2.005s (~)0.871s101.02x
🐘 PostgresNext.js (Turbopack)1.147s2.012s0.865s101.03x
🐘 PostgresNitro1.152s (+0.8%)2.014s (~)0.862s101.03x
🌐 MongoDBNext.js (Turbopack)1.310s2.009s0.698s101.18x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.083s (-10.3% 🟢)3.346s (-12.2% 🟢)1.263s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.739s (-1.5%)11.043s (~)0.304s31.00x
🌐 RedisNext.js (Turbopack)10.778s11.023s0.245s31.00x
💻 LocalNext.js (Turbopack)10.804s11.023s0.219s31.01x
🐘 PostgresNext.js (Turbopack)10.905s11.042s0.137s31.02x
💻 LocalNitro10.910s (~)11.023s (~)0.113s31.02x
💻 LocalExpress10.914s (~)11.023s (~)0.108s31.02x
🐘 PostgresNitro11.001s (~)11.046s (~)0.046s31.02x
🌐 MongoDBNext.js (Turbopack)12.213s13.016s0.803s31.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)17.063s (-3.9%)18.514s (-6.5% 🟢)1.451s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express14.176s (-2.7%)15.041s (~)0.865s41.00x
🌐 RedisNext.js (Turbopack)14.263s15.030s0.766s41.01x
🐘 PostgresNext.js (Turbopack)14.531s15.044s0.513s41.03x
💻 LocalNext.js (Turbopack)14.559s15.030s0.471s41.03x
🐘 PostgresNitro14.800s (~)15.044s (~)0.243s41.04x
💻 LocalNitro14.895s (~)15.029s (~)0.133s41.05x
💻 LocalExpress14.928s (~)15.027s (-3.2%)0.099s41.05x
🌐 MongoDBNext.js (Turbopack)17.872s18.026s0.154s41.26x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.853s (+1.2%)34.473s (-0.6%)1.620s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.190s (-5.9% 🟢)14.038s (-3.0%)0.847s71.00x
🌐 RedisNext.js (Turbopack)13.302s14.026s0.723s71.01x
🐘 PostgresNext.js (Turbopack)14.132s14.613s0.481s71.07x
🐘 PostgresNitro14.413s (~)15.041s (~)0.628s61.09x
💻 LocalNext.js (Turbopack)15.756s16.029s0.273s61.19x
💻 LocalExpress16.483s (-1.2%)17.031s (~)0.548s61.25x
💻 LocalNitro16.489s (~)17.029s (~)0.539s61.25x
🌐 MongoDBNext.js (Turbopack)20.399s21.025s0.625s51.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)56.806s (-9.5% 🟢)57.958s (-10.1% 🟢)1.153s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-4.3%)2.011s (~)0.800s151.00x
🐘 PostgresNext.js (Turbopack)1.266s2.013s0.746s151.05x
🐘 PostgresNitro1.281s (-0.9%)2.011s (~)0.730s151.06x
🌐 RedisNext.js (Turbopack)1.300s2.006s0.706s151.07x
💻 LocalNext.js (Turbopack)1.489s2.005s0.516s151.23x
💻 LocalNitro1.509s (+1.7%)2.006s (~)0.497s151.25x
💻 LocalExpress1.520s (+0.9%)2.006s (~)0.486s151.25x
🌐 MongoDBNext.js (Turbopack)2.156s3.008s0.852s101.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.664s (+6.9% 🔺)3.854s (-1.2%)1.189s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.366s (-3.8%)3.012s (~)0.646s101.00x
🐘 PostgresNitro2.459s (~)3.013s (~)0.553s101.04x
🐘 PostgresNext.js (Turbopack)2.515s3.012s0.497s101.06x
🌐 RedisNext.js (Turbopack)2.523s3.008s0.485s101.07x
💻 LocalNext.js (Turbopack)2.655s3.007s0.353s101.12x
💻 LocalNitro2.909s (+1.3%)3.107s (~)0.198s101.23x
💻 LocalExpress2.929s (-2.3%)3.308s (-7.2% 🟢)0.379s101.24x
🌐 MongoDBNext.js (Turbopack)4.824s5.345s0.521s62.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.892s (+10.0% 🔺)4.180s (+3.8%)1.287s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.522s (-1.9%)4.014s (~)0.492s81.00x
🐘 PostgresNitro3.609s (-0.6%)4.014s (~)0.405s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.014s0.246s81.07x
🌐 RedisNext.js (Turbopack)4.125s5.012s0.887s61.17x
💻 LocalNext.js (Turbopack)7.055s7.767s0.712s42.00x
💻 LocalNitro8.305s (+2.2%)8.770s (~)0.465s42.36x
💻 LocalExpress8.379s (-1.1%)9.020s (~)0.641s42.38x
🌐 MongoDBNext.js (Turbopack)10.095s10.680s0.585s32.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.478s (+3.7%)4.771s (-4.8%)1.293s71.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.202s (-4.6%)2.010s (~)0.809s151.00x
🐘 PostgresNext.js (Turbopack)1.253s2.011s0.758s151.04x
🐘 PostgresNitro1.273s (~)2.011s (~)0.738s151.06x
🌐 RedisNext.js (Turbopack)1.319s2.006s0.688s151.10x
💻 LocalNext.js (Turbopack)1.529s2.006s0.477s151.27x
💻 LocalNitro1.540s (-1.3%)2.005s (~)0.465s151.28x
💻 LocalExpress1.547s (+0.7%)2.005s (~)0.458s151.29x
🌐 MongoDBNext.js (Turbopack)2.181s3.008s0.827s101.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.572s (-1.1%)3.643s (-9.2% 🟢)1.070s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.341s (-4.5%)3.012s (~)0.671s101.00x
🐘 PostgresNitro2.454s (~)3.013s (~)0.559s101.05x
🐘 PostgresNext.js (Turbopack)2.470s3.011s0.541s101.06x
🌐 RedisNext.js (Turbopack)2.569s3.008s0.439s101.10x
💻 LocalNext.js (Turbopack)2.818s3.109s0.291s101.20x
💻 LocalNitro2.963s (-2.1%)3.676s (~)0.713s91.27x
💻 LocalExpress2.990s (-1.4%)3.676s (-2.2%)0.686s91.28x
🌐 MongoDBNext.js (Turbopack)4.746s5.178s0.432s62.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.766s (+16.2% 🔺)3.783s (+3.3%)1.017s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.517s (-2.3%)4.013s (~)0.496s81.00x
🐘 PostgresNitro3.651s (+1.0%)4.015s (~)0.363s81.04x
🐘 PostgresNext.js (Turbopack)3.735s4.014s0.279s81.06x
🌐 RedisNext.js (Turbopack)4.147s4.726s0.579s71.18x
💻 LocalNext.js (Turbopack)8.126s8.773s0.647s42.31x
💻 LocalNitro8.728s (+1.0%)9.019s (~)0.291s42.48x
💻 LocalExpress8.804s (-2.8%)9.025s (-7.7% 🟢)0.220s42.50x
🌐 MongoDBNext.js (Turbopack)9.951s10.684s0.732s32.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.848s (-1.8%)5.484s (~)1.636s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.652s (-24.7% 🟢)1.009s (-1.7%)0.357s601.00x
🌐 RedisNext.js (Turbopack)0.687s1.004s0.318s601.05x
🐘 PostgresNext.js (Turbopack)0.835s1.026s0.191s591.28x
💻 LocalNext.js (Turbopack)0.850s1.004s0.154s601.30x
🐘 PostgresNitro0.873s (-2.6%)1.009s (-3.3%)0.136s601.34x
💻 LocalNitro0.980s (+2.6%)1.136s (+11.3% 🔺)0.156s531.50x
💻 LocalExpress0.980s (~)1.158s (+5.7% 🔺)0.178s521.50x
🌐 MongoDBNext.js (Turbopack)2.158s3.008s0.851s203.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)10.623s (+1.2%)11.948s (-3.1%)1.325s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.572s (-25.7% 🟢)2.010s (-33.3% 🟢)0.438s451.00x
🌐 RedisNext.js (Turbopack)1.678s2.006s0.328s451.07x
🐘 PostgresNext.js (Turbopack)2.027s2.511s0.484s361.29x
🐘 PostgresNitro2.148s (-0.6%)3.012s (+1.1%)0.864s301.37x
💻 LocalNext.js (Turbopack)2.666s3.007s0.341s301.70x
💻 LocalNitro2.974s (+0.6%)3.330s (+7.0% 🔺)0.355s281.89x
💻 LocalExpress2.987s (-0.9%)3.329s (-6.1% 🟢)0.342s281.90x
🌐 MongoDBNext.js (Turbopack)5.273s6.011s0.739s153.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.443s (-0.6%)33.373s (-2.3%)0.929s31.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.263s (-23.5% 🟢)4.013s (-19.3% 🟢)0.750s301.00x
🌐 RedisNext.js (Turbopack)3.293s4.008s0.716s301.01x
🐘 PostgresNext.js (Turbopack)4.106s4.975s0.868s251.26x
🐘 PostgresNitro4.367s (+0.7%)5.015s (~)0.648s241.34x
💻 LocalNext.js (Turbopack)8.417s9.016s0.599s142.58x
💻 LocalNitro8.989s (~)9.479s (~)0.490s132.75x
💻 LocalExpress9.106s (~)9.710s (-0.8%)0.604s132.79x
🌐 MongoDBNext.js (Turbopack)10.535s11.019s0.484s113.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)89.160s (-8.5% 🟢)90.435s (-9.0% 🟢)1.274s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.243s (-19.5% 🟢)1.009s (~)0.766s601.00x
🐘 PostgresNext.js (Turbopack)0.265s1.009s0.744s601.09x
🐘 PostgresNitro0.298s (+1.1%)1.009s (~)0.711s601.22x
🌐 RedisNext.js (Turbopack)0.401s1.021s0.620s591.65x
💻 LocalNext.js (Turbopack)0.558s1.021s0.464s592.29x
💻 LocalNitro0.589s (-1.5%)1.004s (~)0.416s602.42x
💻 LocalExpress0.606s (+0.5%)1.004s (~)0.398s602.49x
🌐 MongoDBNext.js (Turbopack)1.655s2.149s0.494s286.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.914s (+0.7%)3.311s (-7.5% 🟢)1.397s191.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.419s (-20.5% 🟢)1.009s (~)0.590s901.00x
🐘 PostgresNitro0.540s (~)1.009s (~)0.469s901.29x
🐘 PostgresNext.js (Turbopack)0.569s1.021s0.451s891.36x
🌐 RedisNext.js (Turbopack)1.171s2.006s0.835s452.79x
💻 LocalNext.js (Turbopack)2.377s3.008s0.632s305.67x
💻 LocalNitro2.495s (+0.8%)3.008s (~)0.513s305.95x
💻 LocalExpress2.545s (-1.4%)3.009s (~)0.464s306.07x
🌐 MongoDBNext.js (Turbopack)4.756s5.287s0.532s1811.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.221s (-6.3% 🟢)4.527s (-5.8% 🟢)1.306s211.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.605s (-32.6% 🟢)1.009s (-3.1%)0.404s1191.00x
🐘 PostgresNitro0.919s (-2.1%)1.216s (+2.0%)0.297s991.52x
🐘 PostgresNext.js (Turbopack)0.964s1.345s0.381s901.59x
🌐 RedisNext.js (Turbopack)2.741s3.007s0.267s404.53x
🌐 MongoDBNext.js (Turbopack)9.862s10.432s0.570s1216.29x
💻 LocalNext.js (Turbopack)10.107s10.606s0.499s1216.70x
💻 LocalNitro10.955s (-1.4%)11.571s (-0.8%)0.616s1118.10x
💻 LocalExpress11.174s (-1.0%)11.846s (-1.5%)0.671s1118.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)6.960s (-11.2% 🟢)8.087s (-13.7% 🟢)1.127s151.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.168s (-22.4% 🟢)0.996s (~)0.001s (+16.7% 🔺)1.012s (~)0.844s101.00x
🌐 RedisNext.js (Turbopack)0.178s1.000s0.002s1.007s0.829s101.06x
💻 LocalNext.js (Turbopack)0.185s1.002s0.010s1.016s0.831s101.10x
💻 LocalNitro0.198s (+0.7%)1.003s (~)0.011s (-5.9% 🟢)1.017s (~)0.819s101.18x
💻 LocalExpress0.201s (-1.7%)1.003s (~)0.012s (-2.5%)1.017s (~)0.816s101.20x
🐘 PostgresNext.js (Turbopack)0.218s1.002s0.001s1.014s0.796s101.30x
🐘 PostgresNitro0.241s (+0.8%)0.993s (~)0.002s (+7.1% 🔺)1.013s (~)0.772s101.43x
🌐 MongoDBNext.js (Turbopack)0.493s0.960s0.001s1.009s0.516s102.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.656s (-4.3%)2.778s (-7.0% 🟢)0.004s (-29.5% 🟢)3.267s (-9.1% 🟢)1.611s101.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.555s1.000s0.003s1.011s0.456s601.00x
🐘 PostgresExpress0.616s (-11.2% 🟢)1.022s (+1.8%)0.003s (-18.6% 🟢)1.042s (+1.4%)0.425s591.11x
💻 LocalNext.js (Turbopack)0.669s1.008s0.010s1.024s0.355s591.20x
💻 LocalNitro0.722s (-0.7%)1.009s (~)0.010s (+3.3%)1.023s (~)0.301s591.30x
💻 LocalExpress0.731s (-5.9% 🟢)1.009s (-1.7%)0.010s (-2.2%)1.023s (-1.8%)0.292s591.32x
🐘 PostgresNitro0.733s (+1.5%)1.021s (+1.6%)0.004s (+11.7% 🔺)1.044s (+1.8%)0.311s591.32x
🐘 PostgresNext.js (Turbopack)0.751s1.010s0.004s1.027s0.276s591.35x
🌐 MongoDBNext.js (Turbopack)1.329s1.950s0.003s2.013s0.685s302.39x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.008s (+10.1% 🔺)5.891s (+1.8%)0.481s (+140.2% 🔺)6.857s (+5.0% 🔺)1.849s91.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.802s1.000s0.000s1.005s0.203s601.00x
🐘 PostgresExpress0.814s (-8.9% 🟢)1.043s (-3.7%)0.000s (+89.7% 🔺)1.071s (-3.1%)0.257s581.02x
🐘 PostgresNitro0.933s (+1.3%)1.150s (+8.3% 🔺)0.000s (+64.7% 🔺)1.180s (+9.2% 🔺)0.247s511.16x
🐘 PostgresNext.js (Turbopack)0.985s1.177s0.000s1.188s0.203s511.23x
💻 LocalNitro1.236s (+0.9%)2.020s (~)0.000s (-23.1% 🟢)2.023s (~)0.786s301.54x
💻 LocalNext.js (Turbopack)1.237s2.018s0.000s2.022s0.785s301.54x
💻 LocalExpress1.239s (-1.5%)2.020s (~)0.000s (-35.3% 🟢)2.023s (~)0.783s301.55x
🌐 MongoDBNext.js (Turbopack)2.360s2.946s0.000s3.008s0.648s202.94x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.692s (+26.0% 🔺)4.603s (+15.4% 🔺)0.000s (-41.7% 🟢)5.065s (+10.4% 🔺)1.373s121.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.529s2.034s0.000s2.040s0.510s301.00x
🐘 PostgresExpress1.686s (-6.6% 🟢)2.104s (~)0.000s (NaN%)2.133s (+0.5%)0.447s291.10x
🐘 PostgresNitro1.858s (-1.7%)2.098s (-5.5% 🟢)0.000s (-6.9% 🟢)2.117s (-5.5% 🟢)0.258s291.22x
🐘 PostgresNext.js (Turbopack)2.000s2.349s0.000s2.360s0.360s261.31x
💻 LocalNitro3.382s (+1.6%)4.033s (+1.6%)0.000s (-14.7% 🟢)4.037s (+1.6%)0.655s152.21x
💻 LocalNext.js (Turbopack)3.482s4.030s0.001s4.036s0.554s152.28x
💻 LocalExpress3.498s (+1.6%)4.098s (~)0.001s (+75.0% 🔺)4.102s (~)0.604s152.29x
🌐 MongoDBNext.js (Turbopack)4.395s4.976s0.000s5.011s0.616s122.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.869s (-11.4% 🟢)4.515s (-16.3% 🟢)0.000s (-100.0% 🟢)5.038s (-15.5% 🟢)1.169s131.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)18/21
🐘 PostgresExpress21/21
▲ VercelNext.js (Turbopack)21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres20/21
Next.js (Turbopack)🌐 Redis10/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production779167847
✅ 💻 Local Development7820142924
✅ 📦 Local Production7820142924
✅ 🐘 Local Postgres7270120847
✅ 🪟 Windows720577
❌ 🌍 Community Worlds1225821201
✅ 📋 Other198033231
Total3462595304051

❌ Failed Tests

▲ Vercel Production (1 failed)

example (1 failed):

🌍 Community Worlds (58 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

turso (53 failed):

  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KM6EQMFSSRJS76FW2VKYFC6X
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KM6EPGB5MHJ8YKVRWV2GKBEZ
  • promiseRaceWorkflow | wrun_01KM6EPKKCXKBHS77F1SN43AMM
  • promiseAnyWorkflow | wrun_01KM6EPNQB22J6R6YRY6NM84FM
  • importedStepOnlyWorkflow | wrun_01KM6ER2CBE39PF8CGSM5VP0JD
  • hookWorkflow | wrun_01KM6EQ25HJT2YYHAAJ3XADSAM
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • sleepingWorkflow | wrun_01KM6EQWAX2WSGW45X18BZM48A
  • parallelSleepWorkflow | wrun_01KM6ER8X111T19990VHTDFHXS
  • nullByteWorkflow | wrun_01KM6EREKA8MP390A0MWFDPKXY
  • workflowAndStepMetadataWorkflow | wrun_01KM6ERGYD1SHFWFEJBT7G0GT5
  • fetchWorkflow | wrun_01KM6ETBHPJ888CCD6008X0900
  • promiseRaceStressTestWorkflow | wrun_01KM6ETEZ9YDMFT5D1SWPJ6F4B
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KM6EXEX6EBHWZPDYABKM366M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KM6EYQZ9Q9GVYM8CVTMW9YEX
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KM6EZBGY895Q2T0QB7R3CWYR
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KM6EZMBHD3WX0SF21M07MJXY
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KM6EZV14JAWSMACBS0M0N4D1
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KM6EZX6CXS0CFYSDT2BWRHQ7
  • startFromWorkflow - calling start() directly inside a workflow function with hook communication
  • fibonacciWorkflow - recursive workflow composition via start()
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KM6F0CERY0X2RQKHYVV0M8CN
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KM6F0J8FCDZQ68EA8PWB8GJF
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KM6F0RZ6RFJP7415J3S6BTNR
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KM6F10P79TYKACWGFVXHKPEE
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KM6F178G30Z4VDETWFV53JPJ
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KM6F1DVYE9TNCTP39V71912Q
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KM6F1PTC83D0SYRWJA2XTXTP
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KM6F21X21AEBYXFSBTS5V6M7
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KM6F2A1JP11Z8KGDAWNB2GK3
  • cancelRun - cancelling a running workflow | wrun_01KM6F2GTPDS6HKWM3X5YQF41H
  • cancelRun via CLI - cancelling a running workflow | wrun_01KM6F2T3Z4YFC0NXTB3JXJQZ9
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01KM6F375GH61TFF6G0YZSM0KA
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KM6F3V6D7PN667T48JCEY8E7
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KM6F45ZYNS8T1RP0HNEJNGZ7

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro7007
❌ example6917
✅ express7007
✅ fastify7007
✅ hono7007
✅ nextjs-turbopack7502
✅ nextjs-webpack7502
✅ nitro7007
✅ nuxt7007
✅ sveltekit7007
✅ vite7007
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7205
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5435
✅ redis-dev302
❌ redis5525
✅ turso-dev302
❌ turso4535
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable66011
✅ e2e-local-postgres-nest-stable66011
✅ e2e-local-prod-nest-stable66011

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: failure
  • Windows: success

Check the workflow run for details.

VaguelySeriousand others added 2 commits March 19, 2026 19:17
Negative startIndex values (e.g. -3) resolve to n chunks before the
known end of the stream. All world implementations (local, postgres,
vercel) support this. Includes unit tests, e2e test, and doc updates.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threadpackages/world-vercel/src/utils.ts Outdated
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is a clean, well-tested feature. The implementation is consistent across worlds and the clamping behavior is solid. A few comments inline — the main concern is the docs could better call out the live-stream caveat, and the skill file could mention negative startIndex.

```

The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received.
The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received. Negative values are also supported (e.g. `-5` starts 5 chunks before the end), which is useful for showing the most recent output without replaying the full stream.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence mentions negative values as useful for "showing the most recent output without replaying the full stream" — but in the context of WorkflowChatTransport, the transport itself never uses negative startIndex (it tracks chunkIndex incrementally). The mention here might confuse readers into thinking the transport automatically leverages this.

Consider clarifying that this is useful for custom stream consumption (e.g., a dashboard showing recent output), not something WorkflowChatTransport does internally.


This allows clients to reconnect and continue receiving data from where they left off, rather than restarting from the beginning.

`startIndex` also supports **negative values** to read relative to the end of the stream. For example, `startIndex: -5` starts 5 chunks before the current end. This is useful when you want to show the most recent output without reading the entire stream history:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting that on a live (not-yet-closed) stream, the negative startIndex resolves at connection time — so -5 means "5 before the current end at the time of connecting", and any chunks written afterward will still be delivered. This is an important subtlety the e2e test handles (via waitForCompletion: true) but the docs do not mention.

A short note like: "On an active stream, the index resolves relative to the chunk count at connection time; subsequent chunks are still delivered." would prevent misunderstanding.

Comment threadpackages/world-local/src/streamer.ts Outdated
// Resolve negative startIndex relative to the number of data chunks
// (excluding the trailing EOF marker chunk, if present).
let dataChunkCount = chunkFiles.length;
if (startIndex < 0 && chunkFiles.length > 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: startIndex is typed as number | undefined (from the startIndex?: number parameter). The startIndex < 0 check works because undefined < 0 is false in JS, but it reads a bit fragile. Consider an explicit typeof startIndex === 'number' && startIndex < 0 guard to match the style used in world-vercel/src/streamer.ts:127.

if (startIndex < 0 && chunkFiles.length > 0) {
const lastFile = chunkFiles[chunkFiles.length - 1];
const lastExt = fileExtMap.get(lastFile) ?? '.bin';
const lastChunk = deserializeChunk(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads and deserializes the last chunk file just to check eof. On the hot path for a stream with many chunks, this is an extra disk read every time a reader connects with a negative startIndex. Not blocking, but worth a comment noting the cost, or consider whether the EOF state could be tracked more cheaply (e.g., checking for a sentinel file).


// Resolve negative offset relative to the data chunk count
// (excluding the trailing EOF marker, if present)
if (offset < 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nit as the local streamer: offset starts as startIndex ?? 0, so it can never be undefined here — but an explicit typeof guard would make the intent clearer at a glance.

{/* @skip-typecheck: incomplete code sample */}
```typescript
// Read only the last 10 chunks
const stream = run.getReadable({ startIndex: -10 });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add some note/callout to be careful about paginating on this. Because streams are live and will continue enqueueing chunks, relative numbers will map to different absolute chunk "IDs" on subsequent calls. I think accurate pagination is only possible when cursor based, and streams don't support cursor based pagination yet so clients should account for that limitation

@VaguelySeriousVaguelySeriousMar 20, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a problem when using run.getReadable directly, but it is a big problem for resumption, i.e. WorkflowChatTransport. I'm working on this in a follow-up PR together with a metadata/tail endpoint, and cursor-based pagination. I'll add a comment in this PR to mention the limitation

// and 2 chunks to the "test" named stream:
// chunk 0: binary "Hello, named stream!"
// chunk 1: object { foo: 'bar' }
describe.skipIf(isLocalDeployment())('outputStreamWorkflow', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we skipping this test in local deployment? 🤔 this might be outdated and we should probably re-enable streaming tests in local deployments

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already being done so this PR isn't changing it. I might try re-enabling in the next PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah just fly by noticed this

// Negative startIndex resolves at connection time using knownChunkCount,
// so the stream must be fully written before connecting the reader.
waitForCompletion: true,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The e2e coverage for negative startIndex only tests -1 (last chunk). The unit tests in world-local/src/streamer.test.ts are more thorough (covering -2 and clamping with -100), but consider adding a clamping case to this data-driven loop too — e.g., startIndex: -100 expecting all chunks — so the full resolution path is exercised end-to-end across all worlds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add a broader test in the next PR

- Clarify that negative startIndex is for custom consumers, not WorkflowChatTransport
- Add live-stream caveat for negative startIndex resolution timing
- Add pagination limitation callout for live streams
- Use explicit typeof guards for negative startIndex checks (world-local, world-postgres)
- Add cost comment for EOF marker disk read in world-local
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threaddocs/content/docs/ai/resumable-streams.mdx Outdated
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@ghostghost mentioned this pull request Mar 20, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[core] Support negative startIndex for streaming - #1460

Merged
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start
Mar 20, 2026
Merged

[core] Support negative startIndex for streaming#1460
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Negative startIndex values (e.g. -3) resolve to n chunks before the known end of the stream. All world implementations (local, postgres, vercel) support this. Includes unit tests, e2e test, and doc updates.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7a2ee25

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
NameType
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
@workflow/corePatch
@workflow/cliPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/world-testingPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.043s (-4.9%)1.005s (~)0.962s101.00x
💻 LocalNitro0.043s (-8.4% 🟢)1.005s (~)0.962s101.02x
🐘 PostgresExpress0.048s (-32.2% 🟢)1.011s (-0.6%)0.963s101.13x
💻 LocalNext.js (Turbopack)0.050s1.005s0.955s101.18x
🌐 RedisNext.js (Turbopack)0.055s1.005s0.949s101.30x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.953s101.38x
🐘 PostgresNitro0.063s (-8.8% 🟢)1.013s (~)0.949s101.48x
🌐 MongoDBNext.js (Turbopack)0.114s1.008s0.893s102.68x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.464s (-35.6% 🟢)2.116s (-18.2% 🟢)1.651s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.114s (-2.2%)2.012s (~)0.898s101.00x
💻 LocalNext.js (Turbopack)1.119s2.005s0.886s101.00x
🌐 RedisNext.js (Turbopack)1.125s2.006s0.882s101.01x
💻 LocalExpress1.126s (~)2.006s (~)0.880s101.01x
💻 LocalNitro1.134s (~)2.005s (~)0.871s101.02x
🐘 PostgresNext.js (Turbopack)1.147s2.012s0.865s101.03x
🐘 PostgresNitro1.152s (+0.8%)2.014s (~)0.862s101.03x
🌐 MongoDBNext.js (Turbopack)1.310s2.009s0.698s101.18x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.083s (-10.3% 🟢)3.346s (-12.2% 🟢)1.263s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.739s (-1.5%)11.043s (~)0.304s31.00x
🌐 RedisNext.js (Turbopack)10.778s11.023s0.245s31.00x
💻 LocalNext.js (Turbopack)10.804s11.023s0.219s31.01x
🐘 PostgresNext.js (Turbopack)10.905s11.042s0.137s31.02x
💻 LocalNitro10.910s (~)11.023s (~)0.113s31.02x
💻 LocalExpress10.914s (~)11.023s (~)0.108s31.02x
🐘 PostgresNitro11.001s (~)11.046s (~)0.046s31.02x
🌐 MongoDBNext.js (Turbopack)12.213s13.016s0.803s31.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)17.063s (-3.9%)18.514s (-6.5% 🟢)1.451s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express14.176s (-2.7%)15.041s (~)0.865s41.00x
🌐 RedisNext.js (Turbopack)14.263s15.030s0.766s41.01x
🐘 PostgresNext.js (Turbopack)14.531s15.044s0.513s41.03x
💻 LocalNext.js (Turbopack)14.559s15.030s0.471s41.03x
🐘 PostgresNitro14.800s (~)15.044s (~)0.243s41.04x
💻 LocalNitro14.895s (~)15.029s (~)0.133s41.05x
💻 LocalExpress14.928s (~)15.027s (-3.2%)0.099s41.05x
🌐 MongoDBNext.js (Turbopack)17.872s18.026s0.154s41.26x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.853s (+1.2%)34.473s (-0.6%)1.620s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.190s (-5.9% 🟢)14.038s (-3.0%)0.847s71.00x
🌐 RedisNext.js (Turbopack)13.302s14.026s0.723s71.01x
🐘 PostgresNext.js (Turbopack)14.132s14.613s0.481s71.07x
🐘 PostgresNitro14.413s (~)15.041s (~)0.628s61.09x
💻 LocalNext.js (Turbopack)15.756s16.029s0.273s61.19x
💻 LocalExpress16.483s (-1.2%)17.031s (~)0.548s61.25x
💻 LocalNitro16.489s (~)17.029s (~)0.539s61.25x
🌐 MongoDBNext.js (Turbopack)20.399s21.025s0.625s51.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)56.806s (-9.5% 🟢)57.958s (-10.1% 🟢)1.153s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-4.3%)2.011s (~)0.800s151.00x
🐘 PostgresNext.js (Turbopack)1.266s2.013s0.746s151.05x
🐘 PostgresNitro1.281s (-0.9%)2.011s (~)0.730s151.06x
🌐 RedisNext.js (Turbopack)1.300s2.006s0.706s151.07x
💻 LocalNext.js (Turbopack)1.489s2.005s0.516s151.23x
💻 LocalNitro1.509s (+1.7%)2.006s (~)0.497s151.25x
💻 LocalExpress1.520s (+0.9%)2.006s (~)0.486s151.25x
🌐 MongoDBNext.js (Turbopack)2.156s3.008s0.852s101.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.664s (+6.9% 🔺)3.854s (-1.2%)1.189s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.366s (-3.8%)3.012s (~)0.646s101.00x
🐘 PostgresNitro2.459s (~)3.013s (~)0.553s101.04x
🐘 PostgresNext.js (Turbopack)2.515s3.012s0.497s101.06x
🌐 RedisNext.js (Turbopack)2.523s3.008s0.485s101.07x
💻 LocalNext.js (Turbopack)2.655s3.007s0.353s101.12x
💻 LocalNitro2.909s (+1.3%)3.107s (~)0.198s101.23x
💻 LocalExpress2.929s (-2.3%)3.308s (-7.2% 🟢)0.379s101.24x
🌐 MongoDBNext.js (Turbopack)4.824s5.345s0.521s62.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.892s (+10.0% 🔺)4.180s (+3.8%)1.287s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.522s (-1.9%)4.014s (~)0.492s81.00x
🐘 PostgresNitro3.609s (-0.6%)4.014s (~)0.405s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.014s0.246s81.07x
🌐 RedisNext.js (Turbopack)4.125s5.012s0.887s61.17x
💻 LocalNext.js (Turbopack)7.055s7.767s0.712s42.00x
💻 LocalNitro8.305s (+2.2%)8.770s (~)0.465s42.36x
💻 LocalExpress8.379s (-1.1%)9.020s (~)0.641s42.38x
🌐 MongoDBNext.js (Turbopack)10.095s10.680s0.585s32.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.478s (+3.7%)4.771s (-4.8%)1.293s71.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.202s (-4.6%)2.010s (~)0.809s151.00x
🐘 PostgresNext.js (Turbopack)1.253s2.011s0.758s151.04x
🐘 PostgresNitro1.273s (~)2.011s (~)0.738s151.06x
🌐 RedisNext.js (Turbopack)1.319s2.006s0.688s151.10x
💻 LocalNext.js (Turbopack)1.529s2.006s0.477s151.27x
💻 LocalNitro1.540s (-1.3%)2.005s (~)0.465s151.28x
💻 LocalExpress1.547s (+0.7%)2.005s (~)0.458s151.29x
🌐 MongoDBNext.js (Turbopack)2.181s3.008s0.827s101.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.572s (-1.1%)3.643s (-9.2% 🟢)1.070s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.341s (-4.5%)3.012s (~)0.671s101.00x
🐘 PostgresNitro2.454s (~)3.013s (~)0.559s101.05x
🐘 PostgresNext.js (Turbopack)2.470s3.011s0.541s101.06x
🌐 RedisNext.js (Turbopack)2.569s3.008s0.439s101.10x
💻 LocalNext.js (Turbopack)2.818s3.109s0.291s101.20x
💻 LocalNitro2.963s (-2.1%)3.676s (~)0.713s91.27x
💻 LocalExpress2.990s (-1.4%)3.676s (-2.2%)0.686s91.28x
🌐 MongoDBNext.js (Turbopack)4.746s5.178s0.432s62.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.766s (+16.2% 🔺)3.783s (+3.3%)1.017s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.517s (-2.3%)4.013s (~)0.496s81.00x
🐘 PostgresNitro3.651s (+1.0%)4.015s (~)0.363s81.04x
🐘 PostgresNext.js (Turbopack)3.735s4.014s0.279s81.06x
🌐 RedisNext.js (Turbopack)4.147s4.726s0.579s71.18x
💻 LocalNext.js (Turbopack)8.126s8.773s0.647s42.31x
💻 LocalNitro8.728s (+1.0%)9.019s (~)0.291s42.48x
💻 LocalExpress8.804s (-2.8%)9.025s (-7.7% 🟢)0.220s42.50x
🌐 MongoDBNext.js (Turbopack)9.951s10.684s0.732s32.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.848s (-1.8%)5.484s (~)1.636s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.652s (-24.7% 🟢)1.009s (-1.7%)0.357s601.00x
🌐 RedisNext.js (Turbopack)0.687s1.004s0.318s601.05x
🐘 PostgresNext.js (Turbopack)0.835s1.026s0.191s591.28x
💻 LocalNext.js (Turbopack)0.850s1.004s0.154s601.30x
🐘 PostgresNitro0.873s (-2.6%)1.009s (-3.3%)0.136s601.34x
💻 LocalNitro0.980s (+2.6%)1.136s (+11.3% 🔺)0.156s531.50x
💻 LocalExpress0.980s (~)1.158s (+5.7% 🔺)0.178s521.50x
🌐 MongoDBNext.js (Turbopack)2.158s3.008s0.851s203.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)10.623s (+1.2%)11.948s (-3.1%)1.325s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.572s (-25.7% 🟢)2.010s (-33.3% 🟢)0.438s451.00x
🌐 RedisNext.js (Turbopack)1.678s2.006s0.328s451.07x
🐘 PostgresNext.js (Turbopack)2.027s2.511s0.484s361.29x
🐘 PostgresNitro2.148s (-0.6%)3.012s (+1.1%)0.864s301.37x
💻 LocalNext.js (Turbopack)2.666s3.007s0.341s301.70x
💻 LocalNitro2.974s (+0.6%)3.330s (+7.0% 🔺)0.355s281.89x
💻 LocalExpress2.987s (-0.9%)3.329s (-6.1% 🟢)0.342s281.90x
🌐 MongoDBNext.js (Turbopack)5.273s6.011s0.739s153.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.443s (-0.6%)33.373s (-2.3%)0.929s31.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.263s (-23.5% 🟢)4.013s (-19.3% 🟢)0.750s301.00x
🌐 RedisNext.js (Turbopack)3.293s4.008s0.716s301.01x
🐘 PostgresNext.js (Turbopack)4.106s4.975s0.868s251.26x
🐘 PostgresNitro4.367s (+0.7%)5.015s (~)0.648s241.34x
💻 LocalNext.js (Turbopack)8.417s9.016s0.599s142.58x
💻 LocalNitro8.989s (~)9.479s (~)0.490s132.75x
💻 LocalExpress9.106s (~)9.710s (-0.8%)0.604s132.79x
🌐 MongoDBNext.js (Turbopack)10.535s11.019s0.484s113.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)89.160s (-8.5% 🟢)90.435s (-9.0% 🟢)1.274s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.243s (-19.5% 🟢)1.009s (~)0.766s601.00x
🐘 PostgresNext.js (Turbopack)0.265s1.009s0.744s601.09x
🐘 PostgresNitro0.298s (+1.1%)1.009s (~)0.711s601.22x
🌐 RedisNext.js (Turbopack)0.401s1.021s0.620s591.65x
💻 LocalNext.js (Turbopack)0.558s1.021s0.464s592.29x
💻 LocalNitro0.589s (-1.5%)1.004s (~)0.416s602.42x
💻 LocalExpress0.606s (+0.5%)1.004s (~)0.398s602.49x
🌐 MongoDBNext.js (Turbopack)1.655s2.149s0.494s286.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.914s (+0.7%)3.311s (-7.5% 🟢)1.397s191.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.419s (-20.5% 🟢)1.009s (~)0.590s901.00x
🐘 PostgresNitro0.540s (~)1.009s (~)0.469s901.29x
🐘 PostgresNext.js (Turbopack)0.569s1.021s0.451s891.36x
🌐 RedisNext.js (Turbopack)1.171s2.006s0.835s452.79x
💻 LocalNext.js (Turbopack)2.377s3.008s0.632s305.67x
💻 LocalNitro2.495s (+0.8%)3.008s (~)0.513s305.95x
💻 LocalExpress2.545s (-1.4%)3.009s (~)0.464s306.07x
🌐 MongoDBNext.js (Turbopack)4.756s5.287s0.532s1811.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.221s (-6.3% 🟢)4.527s (-5.8% 🟢)1.306s211.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.605s (-32.6% 🟢)1.009s (-3.1%)0.404s1191.00x
🐘 PostgresNitro0.919s (-2.1%)1.216s (+2.0%)0.297s991.52x
🐘 PostgresNext.js (Turbopack)0.964s1.345s0.381s901.59x
🌐 RedisNext.js (Turbopack)2.741s3.007s0.267s404.53x
🌐 MongoDBNext.js (Turbopack)9.862s10.432s0.570s1216.29x
💻 LocalNext.js (Turbopack)10.107s10.606s0.499s1216.70x
💻 LocalNitro10.955s (-1.4%)11.571s (-0.8%)0.616s1118.10x
💻 LocalExpress11.174s (-1.0%)11.846s (-1.5%)0.671s1118.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)6.960s (-11.2% 🟢)8.087s (-13.7% 🟢)1.127s151.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.168s (-22.4% 🟢)0.996s (~)0.001s (+16.7% 🔺)1.012s (~)0.844s101.00x
🌐 RedisNext.js (Turbopack)0.178s1.000s0.002s1.007s0.829s101.06x
💻 LocalNext.js (Turbopack)0.185s1.002s0.010s1.016s0.831s101.10x
💻 LocalNitro0.198s (+0.7%)1.003s (~)0.011s (-5.9% 🟢)1.017s (~)0.819s101.18x
💻 LocalExpress0.201s (-1.7%)1.003s (~)0.012s (-2.5%)1.017s (~)0.816s101.20x
🐘 PostgresNext.js (Turbopack)0.218s1.002s0.001s1.014s0.796s101.30x
🐘 PostgresNitro0.241s (+0.8%)0.993s (~)0.002s (+7.1% 🔺)1.013s (~)0.772s101.43x
🌐 MongoDBNext.js (Turbopack)0.493s0.960s0.001s1.009s0.516s102.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.656s (-4.3%)2.778s (-7.0% 🟢)0.004s (-29.5% 🟢)3.267s (-9.1% 🟢)1.611s101.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.555s1.000s0.003s1.011s0.456s601.00x
🐘 PostgresExpress0.616s (-11.2% 🟢)1.022s (+1.8%)0.003s (-18.6% 🟢)1.042s (+1.4%)0.425s591.11x
💻 LocalNext.js (Turbopack)0.669s1.008s0.010s1.024s0.355s591.20x
💻 LocalNitro0.722s (-0.7%)1.009s (~)0.010s (+3.3%)1.023s (~)0.301s591.30x
💻 LocalExpress0.731s (-5.9% 🟢)1.009s (-1.7%)0.010s (-2.2%)1.023s (-1.8%)0.292s591.32x
🐘 PostgresNitro0.733s (+1.5%)1.021s (+1.6%)0.004s (+11.7% 🔺)1.044s (+1.8%)0.311s591.32x
🐘 PostgresNext.js (Turbopack)0.751s1.010s0.004s1.027s0.276s591.35x
🌐 MongoDBNext.js (Turbopack)1.329s1.950s0.003s2.013s0.685s302.39x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.008s (+10.1% 🔺)5.891s (+1.8%)0.481s (+140.2% 🔺)6.857s (+5.0% 🔺)1.849s91.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.802s1.000s0.000s1.005s0.203s601.00x
🐘 PostgresExpress0.814s (-8.9% 🟢)1.043s (-3.7%)0.000s (+89.7% 🔺)1.071s (-3.1%)0.257s581.02x
🐘 PostgresNitro0.933s (+1.3%)1.150s (+8.3% 🔺)0.000s (+64.7% 🔺)1.180s (+9.2% 🔺)0.247s511.16x
🐘 PostgresNext.js (Turbopack)0.985s1.177s0.000s1.188s0.203s511.23x
💻 LocalNitro1.236s (+0.9%)2.020s (~)0.000s (-23.1% 🟢)2.023s (~)0.786s301.54x
💻 LocalNext.js (Turbopack)1.237s2.018s0.000s2.022s0.785s301.54x
💻 LocalExpress1.239s (-1.5%)2.020s (~)0.000s (-35.3% 🟢)2.023s (~)0.783s301.55x
🌐 MongoDBNext.js (Turbopack)2.360s2.946s0.000s3.008s0.648s202.94x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.692s (+26.0% 🔺)4.603s (+15.4% 🔺)0.000s (-41.7% 🟢)5.065s (+10.4% 🔺)1.373s121.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.529s2.034s0.000s2.040s0.510s301.00x
🐘 PostgresExpress1.686s (-6.6% 🟢)2.104s (~)0.000s (NaN%)2.133s (+0.5%)0.447s291.10x
🐘 PostgresNitro1.858s (-1.7%)2.098s (-5.5% 🟢)0.000s (-6.9% 🟢)2.117s (-5.5% 🟢)0.258s291.22x
🐘 PostgresNext.js (Turbopack)2.000s2.349s0.000s2.360s0.360s261.31x
💻 LocalNitro3.382s (+1.6%)4.033s (+1.6%)0.000s (-14.7% 🟢)4.037s (+1.6%)0.655s152.21x
💻 LocalNext.js (Turbopack)3.482s4.030s0.001s4.036s0.554s152.28x
💻 LocalExpress3.498s (+1.6%)4.098s (~)0.001s (+75.0% 🔺)4.102s (~)0.604s152.29x
🌐 MongoDBNext.js (Turbopack)4.395s4.976s0.000s5.011s0.616s122.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.869s (-11.4% 🟢)4.515s (-16.3% 🟢)0.000s (-100.0% 🟢)5.038s (-15.5% 🟢)1.169s131.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)18/21
🐘 PostgresExpress21/21
▲ VercelNext.js (Turbopack)21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres20/21
Next.js (Turbopack)🌐 Redis10/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production779167847
✅ 💻 Local Development7820142924
✅ 📦 Local Production7820142924
✅ 🐘 Local Postgres7270120847
✅ 🪟 Windows720577
❌ 🌍 Community Worlds1225821201
✅ 📋 Other198033231
Total3462595304051

❌ Failed Tests

▲ Vercel Production (1 failed)

example (1 failed):

🌍 Community Worlds (58 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

turso (53 failed):

  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KM6EQMFSSRJS76FW2VKYFC6X
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KM6EPGB5MHJ8YKVRWV2GKBEZ
  • promiseRaceWorkflow | wrun_01KM6EPKKCXKBHS77F1SN43AMM
  • promiseAnyWorkflow | wrun_01KM6EPNQB22J6R6YRY6NM84FM
  • importedStepOnlyWorkflow | wrun_01KM6ER2CBE39PF8CGSM5VP0JD
  • hookWorkflow | wrun_01KM6EQ25HJT2YYHAAJ3XADSAM
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • sleepingWorkflow | wrun_01KM6EQWAX2WSGW45X18BZM48A
  • parallelSleepWorkflow | wrun_01KM6ER8X111T19990VHTDFHXS
  • nullByteWorkflow | wrun_01KM6EREKA8MP390A0MWFDPKXY
  • workflowAndStepMetadataWorkflow | wrun_01KM6ERGYD1SHFWFEJBT7G0GT5
  • fetchWorkflow | wrun_01KM6ETBHPJ888CCD6008X0900
  • promiseRaceStressTestWorkflow | wrun_01KM6ETEZ9YDMFT5D1SWPJ6F4B
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KM6EXEX6EBHWZPDYABKM366M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KM6EYQZ9Q9GVYM8CVTMW9YEX
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KM6EZBGY895Q2T0QB7R3CWYR
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KM6EZMBHD3WX0SF21M07MJXY
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KM6EZV14JAWSMACBS0M0N4D1
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KM6EZX6CXS0CFYSDT2BWRHQ7
  • startFromWorkflow - calling start() directly inside a workflow function with hook communication
  • fibonacciWorkflow - recursive workflow composition via start()
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KM6F0CERY0X2RQKHYVV0M8CN
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KM6F0J8FCDZQ68EA8PWB8GJF
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KM6F0RZ6RFJP7415J3S6BTNR
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KM6F10P79TYKACWGFVXHKPEE
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KM6F178G30Z4VDETWFV53JPJ
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KM6F1DVYE9TNCTP39V71912Q
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KM6F1PTC83D0SYRWJA2XTXTP
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KM6F21X21AEBYXFSBTS5V6M7
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KM6F2A1JP11Z8KGDAWNB2GK3
  • cancelRun - cancelling a running workflow | wrun_01KM6F2GTPDS6HKWM3X5YQF41H
  • cancelRun via CLI - cancelling a running workflow | wrun_01KM6F2T3Z4YFC0NXTB3JXJQZ9
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01KM6F375GH61TFF6G0YZSM0KA
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KM6F3V6D7PN667T48JCEY8E7
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KM6F45ZYNS8T1RP0HNEJNGZ7

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro7007
❌ example6917
✅ express7007
✅ fastify7007
✅ hono7007
✅ nextjs-turbopack7502
✅ nextjs-webpack7502
✅ nitro7007
✅ nuxt7007
✅ sveltekit7007
✅ vite7007
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7205
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5435
✅ redis-dev302
❌ redis5525
✅ turso-dev302
❌ turso4535
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable66011
✅ e2e-local-postgres-nest-stable66011
✅ e2e-local-prod-nest-stable66011

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: failure
  • Windows: success

Check the workflow run for details.

VaguelySeriousand others added 2 commits March 19, 2026 19:17
Negative startIndex values (e.g. -3) resolve to n chunks before the
known end of the stream. All world implementations (local, postgres,
vercel) support this. Includes unit tests, e2e test, and doc updates.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threadpackages/world-vercel/src/utils.ts Outdated
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is a clean, well-tested feature. The implementation is consistent across worlds and the clamping behavior is solid. A few comments inline — the main concern is the docs could better call out the live-stream caveat, and the skill file could mention negative startIndex.

```

The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received.
The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received. Negative values are also supported (e.g. `-5` starts 5 chunks before the end), which is useful for showing the most recent output without replaying the full stream.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence mentions negative values as useful for "showing the most recent output without replaying the full stream" — but in the context of WorkflowChatTransport, the transport itself never uses negative startIndex (it tracks chunkIndex incrementally). The mention here might confuse readers into thinking the transport automatically leverages this.

Consider clarifying that this is useful for custom stream consumption (e.g., a dashboard showing recent output), not something WorkflowChatTransport does internally.


This allows clients to reconnect and continue receiving data from where they left off, rather than restarting from the beginning.

`startIndex` also supports **negative values** to read relative to the end of the stream. For example, `startIndex: -5` starts 5 chunks before the current end. This is useful when you want to show the most recent output without reading the entire stream history:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting that on a live (not-yet-closed) stream, the negative startIndex resolves at connection time — so -5 means "5 before the current end at the time of connecting", and any chunks written afterward will still be delivered. This is an important subtlety the e2e test handles (via waitForCompletion: true) but the docs do not mention.

A short note like: "On an active stream, the index resolves relative to the chunk count at connection time; subsequent chunks are still delivered." would prevent misunderstanding.

Comment threadpackages/world-local/src/streamer.ts Outdated
// Resolve negative startIndex relative to the number of data chunks
// (excluding the trailing EOF marker chunk, if present).
let dataChunkCount = chunkFiles.length;
if (startIndex < 0 && chunkFiles.length > 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: startIndex is typed as number | undefined (from the startIndex?: number parameter). The startIndex < 0 check works because undefined < 0 is false in JS, but it reads a bit fragile. Consider an explicit typeof startIndex === 'number' && startIndex < 0 guard to match the style used in world-vercel/src/streamer.ts:127.

if (startIndex < 0 && chunkFiles.length > 0) {
const lastFile = chunkFiles[chunkFiles.length - 1];
const lastExt = fileExtMap.get(lastFile) ?? '.bin';
const lastChunk = deserializeChunk(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads and deserializes the last chunk file just to check eof. On the hot path for a stream with many chunks, this is an extra disk read every time a reader connects with a negative startIndex. Not blocking, but worth a comment noting the cost, or consider whether the EOF state could be tracked more cheaply (e.g., checking for a sentinel file).


// Resolve negative offset relative to the data chunk count
// (excluding the trailing EOF marker, if present)
if (offset < 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nit as the local streamer: offset starts as startIndex ?? 0, so it can never be undefined here — but an explicit typeof guard would make the intent clearer at a glance.

{/* @skip-typecheck: incomplete code sample */}
```typescript
// Read only the last 10 chunks
const stream = run.getReadable({ startIndex: -10 });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add some note/callout to be careful about paginating on this. Because streams are live and will continue enqueueing chunks, relative numbers will map to different absolute chunk "IDs" on subsequent calls. I think accurate pagination is only possible when cursor based, and streams don't support cursor based pagination yet so clients should account for that limitation

@VaguelySeriousVaguelySeriousMar 20, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a problem when using run.getReadable directly, but it is a big problem for resumption, i.e. WorkflowChatTransport. I'm working on this in a follow-up PR together with a metadata/tail endpoint, and cursor-based pagination. I'll add a comment in this PR to mention the limitation

// and 2 chunks to the "test" named stream:
// chunk 0: binary "Hello, named stream!"
// chunk 1: object { foo: 'bar' }
describe.skipIf(isLocalDeployment())('outputStreamWorkflow', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we skipping this test in local deployment? 🤔 this might be outdated and we should probably re-enable streaming tests in local deployments

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already being done so this PR isn't changing it. I might try re-enabling in the next PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah just fly by noticed this

// Negative startIndex resolves at connection time using knownChunkCount,
// so the stream must be fully written before connecting the reader.
waitForCompletion: true,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The e2e coverage for negative startIndex only tests -1 (last chunk). The unit tests in world-local/src/streamer.test.ts are more thorough (covering -2 and clamping with -100), but consider adding a clamping case to this data-driven loop too — e.g., startIndex: -100 expecting all chunks — so the full resolution path is exercised end-to-end across all worlds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add a broader test in the next PR

- Clarify that negative startIndex is for custom consumers, not WorkflowChatTransport
- Add live-stream caveat for negative startIndex resolution timing
- Add pagination limitation callout for live streams
- Use explicit typeof guards for negative startIndex checks (world-local, world-postgres)
- Add cost comment for EOF marker disk read in world-local
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threaddocs/content/docs/ai/resumable-streams.mdx Outdated
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@ghostghost mentioned this pull request Mar 20, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[core] Support negative startIndex for streaming - #1460

Merged
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start
Mar 20, 2026
Merged

[core] Support negative startIndex for streaming#1460
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Negative startIndex values (e.g. -3) resolve to n chunks before the known end of the stream. All world implementations (local, postgres, vercel) support this. Includes unit tests, e2e test, and doc updates.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7a2ee25

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
NameType
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
@workflow/corePatch
@workflow/cliPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/world-testingPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.043s (-4.9%)1.005s (~)0.962s101.00x
💻 LocalNitro0.043s (-8.4% 🟢)1.005s (~)0.962s101.02x
🐘 PostgresExpress0.048s (-32.2% 🟢)1.011s (-0.6%)0.963s101.13x
💻 LocalNext.js (Turbopack)0.050s1.005s0.955s101.18x
🌐 RedisNext.js (Turbopack)0.055s1.005s0.949s101.30x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.953s101.38x
🐘 PostgresNitro0.063s (-8.8% 🟢)1.013s (~)0.949s101.48x
🌐 MongoDBNext.js (Turbopack)0.114s1.008s0.893s102.68x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.464s (-35.6% 🟢)2.116s (-18.2% 🟢)1.651s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.114s (-2.2%)2.012s (~)0.898s101.00x
💻 LocalNext.js (Turbopack)1.119s2.005s0.886s101.00x
🌐 RedisNext.js (Turbopack)1.125s2.006s0.882s101.01x
💻 LocalExpress1.126s (~)2.006s (~)0.880s101.01x
💻 LocalNitro1.134s (~)2.005s (~)0.871s101.02x
🐘 PostgresNext.js (Turbopack)1.147s2.012s0.865s101.03x
🐘 PostgresNitro1.152s (+0.8%)2.014s (~)0.862s101.03x
🌐 MongoDBNext.js (Turbopack)1.310s2.009s0.698s101.18x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.083s (-10.3% 🟢)3.346s (-12.2% 🟢)1.263s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.739s (-1.5%)11.043s (~)0.304s31.00x
🌐 RedisNext.js (Turbopack)10.778s11.023s0.245s31.00x
💻 LocalNext.js (Turbopack)10.804s11.023s0.219s31.01x
🐘 PostgresNext.js (Turbopack)10.905s11.042s0.137s31.02x
💻 LocalNitro10.910s (~)11.023s (~)0.113s31.02x
💻 LocalExpress10.914s (~)11.023s (~)0.108s31.02x
🐘 PostgresNitro11.001s (~)11.046s (~)0.046s31.02x
🌐 MongoDBNext.js (Turbopack)12.213s13.016s0.803s31.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)17.063s (-3.9%)18.514s (-6.5% 🟢)1.451s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express14.176s (-2.7%)15.041s (~)0.865s41.00x
🌐 RedisNext.js (Turbopack)14.263s15.030s0.766s41.01x
🐘 PostgresNext.js (Turbopack)14.531s15.044s0.513s41.03x
💻 LocalNext.js (Turbopack)14.559s15.030s0.471s41.03x
🐘 PostgresNitro14.800s (~)15.044s (~)0.243s41.04x
💻 LocalNitro14.895s (~)15.029s (~)0.133s41.05x
💻 LocalExpress14.928s (~)15.027s (-3.2%)0.099s41.05x
🌐 MongoDBNext.js (Turbopack)17.872s18.026s0.154s41.26x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.853s (+1.2%)34.473s (-0.6%)1.620s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.190s (-5.9% 🟢)14.038s (-3.0%)0.847s71.00x
🌐 RedisNext.js (Turbopack)13.302s14.026s0.723s71.01x
🐘 PostgresNext.js (Turbopack)14.132s14.613s0.481s71.07x
🐘 PostgresNitro14.413s (~)15.041s (~)0.628s61.09x
💻 LocalNext.js (Turbopack)15.756s16.029s0.273s61.19x
💻 LocalExpress16.483s (-1.2%)17.031s (~)0.548s61.25x
💻 LocalNitro16.489s (~)17.029s (~)0.539s61.25x
🌐 MongoDBNext.js (Turbopack)20.399s21.025s0.625s51.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)56.806s (-9.5% 🟢)57.958s (-10.1% 🟢)1.153s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-4.3%)2.011s (~)0.800s151.00x
🐘 PostgresNext.js (Turbopack)1.266s2.013s0.746s151.05x
🐘 PostgresNitro1.281s (-0.9%)2.011s (~)0.730s151.06x
🌐 RedisNext.js (Turbopack)1.300s2.006s0.706s151.07x
💻 LocalNext.js (Turbopack)1.489s2.005s0.516s151.23x
💻 LocalNitro1.509s (+1.7%)2.006s (~)0.497s151.25x
💻 LocalExpress1.520s (+0.9%)2.006s (~)0.486s151.25x
🌐 MongoDBNext.js (Turbopack)2.156s3.008s0.852s101.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.664s (+6.9% 🔺)3.854s (-1.2%)1.189s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.366s (-3.8%)3.012s (~)0.646s101.00x
🐘 PostgresNitro2.459s (~)3.013s (~)0.553s101.04x
🐘 PostgresNext.js (Turbopack)2.515s3.012s0.497s101.06x
🌐 RedisNext.js (Turbopack)2.523s3.008s0.485s101.07x
💻 LocalNext.js (Turbopack)2.655s3.007s0.353s101.12x
💻 LocalNitro2.909s (+1.3%)3.107s (~)0.198s101.23x
💻 LocalExpress2.929s (-2.3%)3.308s (-7.2% 🟢)0.379s101.24x
🌐 MongoDBNext.js (Turbopack)4.824s5.345s0.521s62.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.892s (+10.0% 🔺)4.180s (+3.8%)1.287s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.522s (-1.9%)4.014s (~)0.492s81.00x
🐘 PostgresNitro3.609s (-0.6%)4.014s (~)0.405s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.014s0.246s81.07x
🌐 RedisNext.js (Turbopack)4.125s5.012s0.887s61.17x
💻 LocalNext.js (Turbopack)7.055s7.767s0.712s42.00x
💻 LocalNitro8.305s (+2.2%)8.770s (~)0.465s42.36x
💻 LocalExpress8.379s (-1.1%)9.020s (~)0.641s42.38x
🌐 MongoDBNext.js (Turbopack)10.095s10.680s0.585s32.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.478s (+3.7%)4.771s (-4.8%)1.293s71.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.202s (-4.6%)2.010s (~)0.809s151.00x
🐘 PostgresNext.js (Turbopack)1.253s2.011s0.758s151.04x
🐘 PostgresNitro1.273s (~)2.011s (~)0.738s151.06x
🌐 RedisNext.js (Turbopack)1.319s2.006s0.688s151.10x
💻 LocalNext.js (Turbopack)1.529s2.006s0.477s151.27x
💻 LocalNitro1.540s (-1.3%)2.005s (~)0.465s151.28x
💻 LocalExpress1.547s (+0.7%)2.005s (~)0.458s151.29x
🌐 MongoDBNext.js (Turbopack)2.181s3.008s0.827s101.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.572s (-1.1%)3.643s (-9.2% 🟢)1.070s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.341s (-4.5%)3.012s (~)0.671s101.00x
🐘 PostgresNitro2.454s (~)3.013s (~)0.559s101.05x
🐘 PostgresNext.js (Turbopack)2.470s3.011s0.541s101.06x
🌐 RedisNext.js (Turbopack)2.569s3.008s0.439s101.10x
💻 LocalNext.js (Turbopack)2.818s3.109s0.291s101.20x
💻 LocalNitro2.963s (-2.1%)3.676s (~)0.713s91.27x
💻 LocalExpress2.990s (-1.4%)3.676s (-2.2%)0.686s91.28x
🌐 MongoDBNext.js (Turbopack)4.746s5.178s0.432s62.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.766s (+16.2% 🔺)3.783s (+3.3%)1.017s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.517s (-2.3%)4.013s (~)0.496s81.00x
🐘 PostgresNitro3.651s (+1.0%)4.015s (~)0.363s81.04x
🐘 PostgresNext.js (Turbopack)3.735s4.014s0.279s81.06x
🌐 RedisNext.js (Turbopack)4.147s4.726s0.579s71.18x
💻 LocalNext.js (Turbopack)8.126s8.773s0.647s42.31x
💻 LocalNitro8.728s (+1.0%)9.019s (~)0.291s42.48x
💻 LocalExpress8.804s (-2.8%)9.025s (-7.7% 🟢)0.220s42.50x
🌐 MongoDBNext.js (Turbopack)9.951s10.684s0.732s32.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.848s (-1.8%)5.484s (~)1.636s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.652s (-24.7% 🟢)1.009s (-1.7%)0.357s601.00x
🌐 RedisNext.js (Turbopack)0.687s1.004s0.318s601.05x
🐘 PostgresNext.js (Turbopack)0.835s1.026s0.191s591.28x
💻 LocalNext.js (Turbopack)0.850s1.004s0.154s601.30x
🐘 PostgresNitro0.873s (-2.6%)1.009s (-3.3%)0.136s601.34x
💻 LocalNitro0.980s (+2.6%)1.136s (+11.3% 🔺)0.156s531.50x
💻 LocalExpress0.980s (~)1.158s (+5.7% 🔺)0.178s521.50x
🌐 MongoDBNext.js (Turbopack)2.158s3.008s0.851s203.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)10.623s (+1.2%)11.948s (-3.1%)1.325s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.572s (-25.7% 🟢)2.010s (-33.3% 🟢)0.438s451.00x
🌐 RedisNext.js (Turbopack)1.678s2.006s0.328s451.07x
🐘 PostgresNext.js (Turbopack)2.027s2.511s0.484s361.29x
🐘 PostgresNitro2.148s (-0.6%)3.012s (+1.1%)0.864s301.37x
💻 LocalNext.js (Turbopack)2.666s3.007s0.341s301.70x
💻 LocalNitro2.974s (+0.6%)3.330s (+7.0% 🔺)0.355s281.89x
💻 LocalExpress2.987s (-0.9%)3.329s (-6.1% 🟢)0.342s281.90x
🌐 MongoDBNext.js (Turbopack)5.273s6.011s0.739s153.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.443s (-0.6%)33.373s (-2.3%)0.929s31.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.263s (-23.5% 🟢)4.013s (-19.3% 🟢)0.750s301.00x
🌐 RedisNext.js (Turbopack)3.293s4.008s0.716s301.01x
🐘 PostgresNext.js (Turbopack)4.106s4.975s0.868s251.26x
🐘 PostgresNitro4.367s (+0.7%)5.015s (~)0.648s241.34x
💻 LocalNext.js (Turbopack)8.417s9.016s0.599s142.58x
💻 LocalNitro8.989s (~)9.479s (~)0.490s132.75x
💻 LocalExpress9.106s (~)9.710s (-0.8%)0.604s132.79x
🌐 MongoDBNext.js (Turbopack)10.535s11.019s0.484s113.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)89.160s (-8.5% 🟢)90.435s (-9.0% 🟢)1.274s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.243s (-19.5% 🟢)1.009s (~)0.766s601.00x
🐘 PostgresNext.js (Turbopack)0.265s1.009s0.744s601.09x
🐘 PostgresNitro0.298s (+1.1%)1.009s (~)0.711s601.22x
🌐 RedisNext.js (Turbopack)0.401s1.021s0.620s591.65x
💻 LocalNext.js (Turbopack)0.558s1.021s0.464s592.29x
💻 LocalNitro0.589s (-1.5%)1.004s (~)0.416s602.42x
💻 LocalExpress0.606s (+0.5%)1.004s (~)0.398s602.49x
🌐 MongoDBNext.js (Turbopack)1.655s2.149s0.494s286.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.914s (+0.7%)3.311s (-7.5% 🟢)1.397s191.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.419s (-20.5% 🟢)1.009s (~)0.590s901.00x
🐘 PostgresNitro0.540s (~)1.009s (~)0.469s901.29x
🐘 PostgresNext.js (Turbopack)0.569s1.021s0.451s891.36x
🌐 RedisNext.js (Turbopack)1.171s2.006s0.835s452.79x
💻 LocalNext.js (Turbopack)2.377s3.008s0.632s305.67x
💻 LocalNitro2.495s (+0.8%)3.008s (~)0.513s305.95x
💻 LocalExpress2.545s (-1.4%)3.009s (~)0.464s306.07x
🌐 MongoDBNext.js (Turbopack)4.756s5.287s0.532s1811.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.221s (-6.3% 🟢)4.527s (-5.8% 🟢)1.306s211.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.605s (-32.6% 🟢)1.009s (-3.1%)0.404s1191.00x
🐘 PostgresNitro0.919s (-2.1%)1.216s (+2.0%)0.297s991.52x
🐘 PostgresNext.js (Turbopack)0.964s1.345s0.381s901.59x
🌐 RedisNext.js (Turbopack)2.741s3.007s0.267s404.53x
🌐 MongoDBNext.js (Turbopack)9.862s10.432s0.570s1216.29x
💻 LocalNext.js (Turbopack)10.107s10.606s0.499s1216.70x
💻 LocalNitro10.955s (-1.4%)11.571s (-0.8%)0.616s1118.10x
💻 LocalExpress11.174s (-1.0%)11.846s (-1.5%)0.671s1118.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)6.960s (-11.2% 🟢)8.087s (-13.7% 🟢)1.127s151.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.168s (-22.4% 🟢)0.996s (~)0.001s (+16.7% 🔺)1.012s (~)0.844s101.00x
🌐 RedisNext.js (Turbopack)0.178s1.000s0.002s1.007s0.829s101.06x
💻 LocalNext.js (Turbopack)0.185s1.002s0.010s1.016s0.831s101.10x
💻 LocalNitro0.198s (+0.7%)1.003s (~)0.011s (-5.9% 🟢)1.017s (~)0.819s101.18x
💻 LocalExpress0.201s (-1.7%)1.003s (~)0.012s (-2.5%)1.017s (~)0.816s101.20x
🐘 PostgresNext.js (Turbopack)0.218s1.002s0.001s1.014s0.796s101.30x
🐘 PostgresNitro0.241s (+0.8%)0.993s (~)0.002s (+7.1% 🔺)1.013s (~)0.772s101.43x
🌐 MongoDBNext.js (Turbopack)0.493s0.960s0.001s1.009s0.516s102.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.656s (-4.3%)2.778s (-7.0% 🟢)0.004s (-29.5% 🟢)3.267s (-9.1% 🟢)1.611s101.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.555s1.000s0.003s1.011s0.456s601.00x
🐘 PostgresExpress0.616s (-11.2% 🟢)1.022s (+1.8%)0.003s (-18.6% 🟢)1.042s (+1.4%)0.425s591.11x
💻 LocalNext.js (Turbopack)0.669s1.008s0.010s1.024s0.355s591.20x
💻 LocalNitro0.722s (-0.7%)1.009s (~)0.010s (+3.3%)1.023s (~)0.301s591.30x
💻 LocalExpress0.731s (-5.9% 🟢)1.009s (-1.7%)0.010s (-2.2%)1.023s (-1.8%)0.292s591.32x
🐘 PostgresNitro0.733s (+1.5%)1.021s (+1.6%)0.004s (+11.7% 🔺)1.044s (+1.8%)0.311s591.32x
🐘 PostgresNext.js (Turbopack)0.751s1.010s0.004s1.027s0.276s591.35x
🌐 MongoDBNext.js (Turbopack)1.329s1.950s0.003s2.013s0.685s302.39x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.008s (+10.1% 🔺)5.891s (+1.8%)0.481s (+140.2% 🔺)6.857s (+5.0% 🔺)1.849s91.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.802s1.000s0.000s1.005s0.203s601.00x
🐘 PostgresExpress0.814s (-8.9% 🟢)1.043s (-3.7%)0.000s (+89.7% 🔺)1.071s (-3.1%)0.257s581.02x
🐘 PostgresNitro0.933s (+1.3%)1.150s (+8.3% 🔺)0.000s (+64.7% 🔺)1.180s (+9.2% 🔺)0.247s511.16x
🐘 PostgresNext.js (Turbopack)0.985s1.177s0.000s1.188s0.203s511.23x
💻 LocalNitro1.236s (+0.9%)2.020s (~)0.000s (-23.1% 🟢)2.023s (~)0.786s301.54x
💻 LocalNext.js (Turbopack)1.237s2.018s0.000s2.022s0.785s301.54x
💻 LocalExpress1.239s (-1.5%)2.020s (~)0.000s (-35.3% 🟢)2.023s (~)0.783s301.55x
🌐 MongoDBNext.js (Turbopack)2.360s2.946s0.000s3.008s0.648s202.94x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.692s (+26.0% 🔺)4.603s (+15.4% 🔺)0.000s (-41.7% 🟢)5.065s (+10.4% 🔺)1.373s121.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.529s2.034s0.000s2.040s0.510s301.00x
🐘 PostgresExpress1.686s (-6.6% 🟢)2.104s (~)0.000s (NaN%)2.133s (+0.5%)0.447s291.10x
🐘 PostgresNitro1.858s (-1.7%)2.098s (-5.5% 🟢)0.000s (-6.9% 🟢)2.117s (-5.5% 🟢)0.258s291.22x
🐘 PostgresNext.js (Turbopack)2.000s2.349s0.000s2.360s0.360s261.31x
💻 LocalNitro3.382s (+1.6%)4.033s (+1.6%)0.000s (-14.7% 🟢)4.037s (+1.6%)0.655s152.21x
💻 LocalNext.js (Turbopack)3.482s4.030s0.001s4.036s0.554s152.28x
💻 LocalExpress3.498s (+1.6%)4.098s (~)0.001s (+75.0% 🔺)4.102s (~)0.604s152.29x
🌐 MongoDBNext.js (Turbopack)4.395s4.976s0.000s5.011s0.616s122.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.869s (-11.4% 🟢)4.515s (-16.3% 🟢)0.000s (-100.0% 🟢)5.038s (-15.5% 🟢)1.169s131.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)18/21
🐘 PostgresExpress21/21
▲ VercelNext.js (Turbopack)21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres20/21
Next.js (Turbopack)🌐 Redis10/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production779167847
✅ 💻 Local Development7820142924
✅ 📦 Local Production7820142924
✅ 🐘 Local Postgres7270120847
✅ 🪟 Windows720577
❌ 🌍 Community Worlds1225821201
✅ 📋 Other198033231
Total3462595304051

❌ Failed Tests

▲ Vercel Production (1 failed)

example (1 failed):

🌍 Community Worlds (58 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

turso (53 failed):

  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KM6EQMFSSRJS76FW2VKYFC6X
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KM6EPGB5MHJ8YKVRWV2GKBEZ
  • promiseRaceWorkflow | wrun_01KM6EPKKCXKBHS77F1SN43AMM
  • promiseAnyWorkflow | wrun_01KM6EPNQB22J6R6YRY6NM84FM
  • importedStepOnlyWorkflow | wrun_01KM6ER2CBE39PF8CGSM5VP0JD
  • hookWorkflow | wrun_01KM6EQ25HJT2YYHAAJ3XADSAM
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • sleepingWorkflow | wrun_01KM6EQWAX2WSGW45X18BZM48A
  • parallelSleepWorkflow | wrun_01KM6ER8X111T19990VHTDFHXS
  • nullByteWorkflow | wrun_01KM6EREKA8MP390A0MWFDPKXY
  • workflowAndStepMetadataWorkflow | wrun_01KM6ERGYD1SHFWFEJBT7G0GT5
  • fetchWorkflow | wrun_01KM6ETBHPJ888CCD6008X0900
  • promiseRaceStressTestWorkflow | wrun_01KM6ETEZ9YDMFT5D1SWPJ6F4B
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KM6EXEX6EBHWZPDYABKM366M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KM6EYQZ9Q9GVYM8CVTMW9YEX
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KM6EZBGY895Q2T0QB7R3CWYR
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KM6EZMBHD3WX0SF21M07MJXY
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KM6EZV14JAWSMACBS0M0N4D1
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KM6EZX6CXS0CFYSDT2BWRHQ7
  • startFromWorkflow - calling start() directly inside a workflow function with hook communication
  • fibonacciWorkflow - recursive workflow composition via start()
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KM6F0CERY0X2RQKHYVV0M8CN
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KM6F0J8FCDZQ68EA8PWB8GJF
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KM6F0RZ6RFJP7415J3S6BTNR
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KM6F10P79TYKACWGFVXHKPEE
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KM6F178G30Z4VDETWFV53JPJ
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KM6F1DVYE9TNCTP39V71912Q
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KM6F1PTC83D0SYRWJA2XTXTP
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KM6F21X21AEBYXFSBTS5V6M7
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KM6F2A1JP11Z8KGDAWNB2GK3
  • cancelRun - cancelling a running workflow | wrun_01KM6F2GTPDS6HKWM3X5YQF41H
  • cancelRun via CLI - cancelling a running workflow | wrun_01KM6F2T3Z4YFC0NXTB3JXJQZ9
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01KM6F375GH61TFF6G0YZSM0KA
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KM6F3V6D7PN667T48JCEY8E7
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KM6F45ZYNS8T1RP0HNEJNGZ7

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro7007
❌ example6917
✅ express7007
✅ fastify7007
✅ hono7007
✅ nextjs-turbopack7502
✅ nextjs-webpack7502
✅ nitro7007
✅ nuxt7007
✅ sveltekit7007
✅ vite7007
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7205
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5435
✅ redis-dev302
❌ redis5525
✅ turso-dev302
❌ turso4535
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable66011
✅ e2e-local-postgres-nest-stable66011
✅ e2e-local-prod-nest-stable66011

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: failure
  • Windows: success

Check the workflow run for details.

VaguelySeriousand others added 2 commits March 19, 2026 19:17
Negative startIndex values (e.g. -3) resolve to n chunks before the
known end of the stream. All world implementations (local, postgres,
vercel) support this. Includes unit tests, e2e test, and doc updates.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threadpackages/world-vercel/src/utils.ts Outdated
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is a clean, well-tested feature. The implementation is consistent across worlds and the clamping behavior is solid. A few comments inline — the main concern is the docs could better call out the live-stream caveat, and the skill file could mention negative startIndex.

```

The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received.
The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received. Negative values are also supported (e.g. `-5` starts 5 chunks before the end), which is useful for showing the most recent output without replaying the full stream.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence mentions negative values as useful for "showing the most recent output without replaying the full stream" — but in the context of WorkflowChatTransport, the transport itself never uses negative startIndex (it tracks chunkIndex incrementally). The mention here might confuse readers into thinking the transport automatically leverages this.

Consider clarifying that this is useful for custom stream consumption (e.g., a dashboard showing recent output), not something WorkflowChatTransport does internally.


This allows clients to reconnect and continue receiving data from where they left off, rather than restarting from the beginning.

`startIndex` also supports **negative values** to read relative to the end of the stream. For example, `startIndex: -5` starts 5 chunks before the current end. This is useful when you want to show the most recent output without reading the entire stream history:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting that on a live (not-yet-closed) stream, the negative startIndex resolves at connection time — so -5 means "5 before the current end at the time of connecting", and any chunks written afterward will still be delivered. This is an important subtlety the e2e test handles (via waitForCompletion: true) but the docs do not mention.

A short note like: "On an active stream, the index resolves relative to the chunk count at connection time; subsequent chunks are still delivered." would prevent misunderstanding.

Comment threadpackages/world-local/src/streamer.ts Outdated
// Resolve negative startIndex relative to the number of data chunks
// (excluding the trailing EOF marker chunk, if present).
let dataChunkCount = chunkFiles.length;
if (startIndex < 0 && chunkFiles.length > 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: startIndex is typed as number | undefined (from the startIndex?: number parameter). The startIndex < 0 check works because undefined < 0 is false in JS, but it reads a bit fragile. Consider an explicit typeof startIndex === 'number' && startIndex < 0 guard to match the style used in world-vercel/src/streamer.ts:127.

if (startIndex < 0 && chunkFiles.length > 0) {
const lastFile = chunkFiles[chunkFiles.length - 1];
const lastExt = fileExtMap.get(lastFile) ?? '.bin';
const lastChunk = deserializeChunk(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads and deserializes the last chunk file just to check eof. On the hot path for a stream with many chunks, this is an extra disk read every time a reader connects with a negative startIndex. Not blocking, but worth a comment noting the cost, or consider whether the EOF state could be tracked more cheaply (e.g., checking for a sentinel file).


// Resolve negative offset relative to the data chunk count
// (excluding the trailing EOF marker, if present)
if (offset < 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nit as the local streamer: offset starts as startIndex ?? 0, so it can never be undefined here — but an explicit typeof guard would make the intent clearer at a glance.

{/* @skip-typecheck: incomplete code sample */}
```typescript
// Read only the last 10 chunks
const stream = run.getReadable({ startIndex: -10 });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add some note/callout to be careful about paginating on this. Because streams are live and will continue enqueueing chunks, relative numbers will map to different absolute chunk "IDs" on subsequent calls. I think accurate pagination is only possible when cursor based, and streams don't support cursor based pagination yet so clients should account for that limitation

@VaguelySeriousVaguelySeriousMar 20, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a problem when using run.getReadable directly, but it is a big problem for resumption, i.e. WorkflowChatTransport. I'm working on this in a follow-up PR together with a metadata/tail endpoint, and cursor-based pagination. I'll add a comment in this PR to mention the limitation

// and 2 chunks to the "test" named stream:
// chunk 0: binary "Hello, named stream!"
// chunk 1: object { foo: 'bar' }
describe.skipIf(isLocalDeployment())('outputStreamWorkflow', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we skipping this test in local deployment? 🤔 this might be outdated and we should probably re-enable streaming tests in local deployments

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already being done so this PR isn't changing it. I might try re-enabling in the next PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah just fly by noticed this

// Negative startIndex resolves at connection time using knownChunkCount,
// so the stream must be fully written before connecting the reader.
waitForCompletion: true,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The e2e coverage for negative startIndex only tests -1 (last chunk). The unit tests in world-local/src/streamer.test.ts are more thorough (covering -2 and clamping with -100), but consider adding a clamping case to this data-driven loop too — e.g., startIndex: -100 expecting all chunks — so the full resolution path is exercised end-to-end across all worlds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add a broader test in the next PR

- Clarify that negative startIndex is for custom consumers, not WorkflowChatTransport
- Add live-stream caveat for negative startIndex resolution timing
- Add pagination limitation callout for live streams
- Use explicit typeof guards for negative startIndex checks (world-local, world-postgres)
- Add cost comment for EOF marker disk read in world-local
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threaddocs/content/docs/ai/resumable-streams.mdx Outdated
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@ghostghost mentioned this pull request Mar 20, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

[core] Support negative startIndex for streaming - #1460

Merged
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start
Mar 20, 2026
Merged

[core] Support negative startIndex for streaming#1460
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Negative startIndex values (e.g. -3) resolve to n chunks before the known end of the stream. All world implementations (local, postgres, vercel) support this. Includes unit tests, e2e test, and doc updates.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7a2ee25

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
NameType
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
@workflow/corePatch
@workflow/cliPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/world-testingPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.043s (-4.9%)1.005s (~)0.962s101.00x
💻 LocalNitro0.043s (-8.4% 🟢)1.005s (~)0.962s101.02x
🐘 PostgresExpress0.048s (-32.2% 🟢)1.011s (-0.6%)0.963s101.13x
💻 LocalNext.js (Turbopack)0.050s1.005s0.955s101.18x
🌐 RedisNext.js (Turbopack)0.055s1.005s0.949s101.30x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.953s101.38x
🐘 PostgresNitro0.063s (-8.8% 🟢)1.013s (~)0.949s101.48x
🌐 MongoDBNext.js (Turbopack)0.114s1.008s0.893s102.68x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.464s (-35.6% 🟢)2.116s (-18.2% 🟢)1.651s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.114s (-2.2%)2.012s (~)0.898s101.00x
💻 LocalNext.js (Turbopack)1.119s2.005s0.886s101.00x
🌐 RedisNext.js (Turbopack)1.125s2.006s0.882s101.01x
💻 LocalExpress1.126s (~)2.006s (~)0.880s101.01x
💻 LocalNitro1.134s (~)2.005s (~)0.871s101.02x
🐘 PostgresNext.js (Turbopack)1.147s2.012s0.865s101.03x
🐘 PostgresNitro1.152s (+0.8%)2.014s (~)0.862s101.03x
🌐 MongoDBNext.js (Turbopack)1.310s2.009s0.698s101.18x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.083s (-10.3% 🟢)3.346s (-12.2% 🟢)1.263s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.739s (-1.5%)11.043s (~)0.304s31.00x
🌐 RedisNext.js (Turbopack)10.778s11.023s0.245s31.00x
💻 LocalNext.js (Turbopack)10.804s11.023s0.219s31.01x
🐘 PostgresNext.js (Turbopack)10.905s11.042s0.137s31.02x
💻 LocalNitro10.910s (~)11.023s (~)0.113s31.02x
💻 LocalExpress10.914s (~)11.023s (~)0.108s31.02x
🐘 PostgresNitro11.001s (~)11.046s (~)0.046s31.02x
🌐 MongoDBNext.js (Turbopack)12.213s13.016s0.803s31.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)17.063s (-3.9%)18.514s (-6.5% 🟢)1.451s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express14.176s (-2.7%)15.041s (~)0.865s41.00x
🌐 RedisNext.js (Turbopack)14.263s15.030s0.766s41.01x
🐘 PostgresNext.js (Turbopack)14.531s15.044s0.513s41.03x
💻 LocalNext.js (Turbopack)14.559s15.030s0.471s41.03x
🐘 PostgresNitro14.800s (~)15.044s (~)0.243s41.04x
💻 LocalNitro14.895s (~)15.029s (~)0.133s41.05x
💻 LocalExpress14.928s (~)15.027s (-3.2%)0.099s41.05x
🌐 MongoDBNext.js (Turbopack)17.872s18.026s0.154s41.26x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.853s (+1.2%)34.473s (-0.6%)1.620s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.190s (-5.9% 🟢)14.038s (-3.0%)0.847s71.00x
🌐 RedisNext.js (Turbopack)13.302s14.026s0.723s71.01x
🐘 PostgresNext.js (Turbopack)14.132s14.613s0.481s71.07x
🐘 PostgresNitro14.413s (~)15.041s (~)0.628s61.09x
💻 LocalNext.js (Turbopack)15.756s16.029s0.273s61.19x
💻 LocalExpress16.483s (-1.2%)17.031s (~)0.548s61.25x
💻 LocalNitro16.489s (~)17.029s (~)0.539s61.25x
🌐 MongoDBNext.js (Turbopack)20.399s21.025s0.625s51.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)56.806s (-9.5% 🟢)57.958s (-10.1% 🟢)1.153s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-4.3%)2.011s (~)0.800s151.00x
🐘 PostgresNext.js (Turbopack)1.266s2.013s0.746s151.05x
🐘 PostgresNitro1.281s (-0.9%)2.011s (~)0.730s151.06x
🌐 RedisNext.js (Turbopack)1.300s2.006s0.706s151.07x
💻 LocalNext.js (Turbopack)1.489s2.005s0.516s151.23x
💻 LocalNitro1.509s (+1.7%)2.006s (~)0.497s151.25x
💻 LocalExpress1.520s (+0.9%)2.006s (~)0.486s151.25x
🌐 MongoDBNext.js (Turbopack)2.156s3.008s0.852s101.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.664s (+6.9% 🔺)3.854s (-1.2%)1.189s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.366s (-3.8%)3.012s (~)0.646s101.00x
🐘 PostgresNitro2.459s (~)3.013s (~)0.553s101.04x
🐘 PostgresNext.js (Turbopack)2.515s3.012s0.497s101.06x
🌐 RedisNext.js (Turbopack)2.523s3.008s0.485s101.07x
💻 LocalNext.js (Turbopack)2.655s3.007s0.353s101.12x
💻 LocalNitro2.909s (+1.3%)3.107s (~)0.198s101.23x
💻 LocalExpress2.929s (-2.3%)3.308s (-7.2% 🟢)0.379s101.24x
🌐 MongoDBNext.js (Turbopack)4.824s5.345s0.521s62.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.892s (+10.0% 🔺)4.180s (+3.8%)1.287s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.522s (-1.9%)4.014s (~)0.492s81.00x
🐘 PostgresNitro3.609s (-0.6%)4.014s (~)0.405s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.014s0.246s81.07x
🌐 RedisNext.js (Turbopack)4.125s5.012s0.887s61.17x
💻 LocalNext.js (Turbopack)7.055s7.767s0.712s42.00x
💻 LocalNitro8.305s (+2.2%)8.770s (~)0.465s42.36x
💻 LocalExpress8.379s (-1.1%)9.020s (~)0.641s42.38x
🌐 MongoDBNext.js (Turbopack)10.095s10.680s0.585s32.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.478s (+3.7%)4.771s (-4.8%)1.293s71.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.202s (-4.6%)2.010s (~)0.809s151.00x
🐘 PostgresNext.js (Turbopack)1.253s2.011s0.758s151.04x
🐘 PostgresNitro1.273s (~)2.011s (~)0.738s151.06x
🌐 RedisNext.js (Turbopack)1.319s2.006s0.688s151.10x
💻 LocalNext.js (Turbopack)1.529s2.006s0.477s151.27x
💻 LocalNitro1.540s (-1.3%)2.005s (~)0.465s151.28x
💻 LocalExpress1.547s (+0.7%)2.005s (~)0.458s151.29x
🌐 MongoDBNext.js (Turbopack)2.181s3.008s0.827s101.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.572s (-1.1%)3.643s (-9.2% 🟢)1.070s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.341s (-4.5%)3.012s (~)0.671s101.00x
🐘 PostgresNitro2.454s (~)3.013s (~)0.559s101.05x
🐘 PostgresNext.js (Turbopack)2.470s3.011s0.541s101.06x
🌐 RedisNext.js (Turbopack)2.569s3.008s0.439s101.10x
💻 LocalNext.js (Turbopack)2.818s3.109s0.291s101.20x
💻 LocalNitro2.963s (-2.1%)3.676s (~)0.713s91.27x
💻 LocalExpress2.990s (-1.4%)3.676s (-2.2%)0.686s91.28x
🌐 MongoDBNext.js (Turbopack)4.746s5.178s0.432s62.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.766s (+16.2% 🔺)3.783s (+3.3%)1.017s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.517s (-2.3%)4.013s (~)0.496s81.00x
🐘 PostgresNitro3.651s (+1.0%)4.015s (~)0.363s81.04x
🐘 PostgresNext.js (Turbopack)3.735s4.014s0.279s81.06x
🌐 RedisNext.js (Turbopack)4.147s4.726s0.579s71.18x
💻 LocalNext.js (Turbopack)8.126s8.773s0.647s42.31x
💻 LocalNitro8.728s (+1.0%)9.019s (~)0.291s42.48x
💻 LocalExpress8.804s (-2.8%)9.025s (-7.7% 🟢)0.220s42.50x
🌐 MongoDBNext.js (Turbopack)9.951s10.684s0.732s32.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.848s (-1.8%)5.484s (~)1.636s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.652s (-24.7% 🟢)1.009s (-1.7%)0.357s601.00x
🌐 RedisNext.js (Turbopack)0.687s1.004s0.318s601.05x
🐘 PostgresNext.js (Turbopack)0.835s1.026s0.191s591.28x
💻 LocalNext.js (Turbopack)0.850s1.004s0.154s601.30x
🐘 PostgresNitro0.873s (-2.6%)1.009s (-3.3%)0.136s601.34x
💻 LocalNitro0.980s (+2.6%)1.136s (+11.3% 🔺)0.156s531.50x
💻 LocalExpress0.980s (~)1.158s (+5.7% 🔺)0.178s521.50x
🌐 MongoDBNext.js (Turbopack)2.158s3.008s0.851s203.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)10.623s (+1.2%)11.948s (-3.1%)1.325s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.572s (-25.7% 🟢)2.010s (-33.3% 🟢)0.438s451.00x
🌐 RedisNext.js (Turbopack)1.678s2.006s0.328s451.07x
🐘 PostgresNext.js (Turbopack)2.027s2.511s0.484s361.29x
🐘 PostgresNitro2.148s (-0.6%)3.012s (+1.1%)0.864s301.37x
💻 LocalNext.js (Turbopack)2.666s3.007s0.341s301.70x
💻 LocalNitro2.974s (+0.6%)3.330s (+7.0% 🔺)0.355s281.89x
💻 LocalExpress2.987s (-0.9%)3.329s (-6.1% 🟢)0.342s281.90x
🌐 MongoDBNext.js (Turbopack)5.273s6.011s0.739s153.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.443s (-0.6%)33.373s (-2.3%)0.929s31.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.263s (-23.5% 🟢)4.013s (-19.3% 🟢)0.750s301.00x
🌐 RedisNext.js (Turbopack)3.293s4.008s0.716s301.01x
🐘 PostgresNext.js (Turbopack)4.106s4.975s0.868s251.26x
🐘 PostgresNitro4.367s (+0.7%)5.015s (~)0.648s241.34x
💻 LocalNext.js (Turbopack)8.417s9.016s0.599s142.58x
💻 LocalNitro8.989s (~)9.479s (~)0.490s132.75x
💻 LocalExpress9.106s (~)9.710s (-0.8%)0.604s132.79x
🌐 MongoDBNext.js (Turbopack)10.535s11.019s0.484s113.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)89.160s (-8.5% 🟢)90.435s (-9.0% 🟢)1.274s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.243s (-19.5% 🟢)1.009s (~)0.766s601.00x
🐘 PostgresNext.js (Turbopack)0.265s1.009s0.744s601.09x
🐘 PostgresNitro0.298s (+1.1%)1.009s (~)0.711s601.22x
🌐 RedisNext.js (Turbopack)0.401s1.021s0.620s591.65x
💻 LocalNext.js (Turbopack)0.558s1.021s0.464s592.29x
💻 LocalNitro0.589s (-1.5%)1.004s (~)0.416s602.42x
💻 LocalExpress0.606s (+0.5%)1.004s (~)0.398s602.49x
🌐 MongoDBNext.js (Turbopack)1.655s2.149s0.494s286.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.914s (+0.7%)3.311s (-7.5% 🟢)1.397s191.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.419s (-20.5% 🟢)1.009s (~)0.590s901.00x
🐘 PostgresNitro0.540s (~)1.009s (~)0.469s901.29x
🐘 PostgresNext.js (Turbopack)0.569s1.021s0.451s891.36x
🌐 RedisNext.js (Turbopack)1.171s2.006s0.835s452.79x
💻 LocalNext.js (Turbopack)2.377s3.008s0.632s305.67x
💻 LocalNitro2.495s (+0.8%)3.008s (~)0.513s305.95x
💻 LocalExpress2.545s (-1.4%)3.009s (~)0.464s306.07x
🌐 MongoDBNext.js (Turbopack)4.756s5.287s0.532s1811.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.221s (-6.3% 🟢)4.527s (-5.8% 🟢)1.306s211.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.605s (-32.6% 🟢)1.009s (-3.1%)0.404s1191.00x
🐘 PostgresNitro0.919s (-2.1%)1.216s (+2.0%)0.297s991.52x
🐘 PostgresNext.js (Turbopack)0.964s1.345s0.381s901.59x
🌐 RedisNext.js (Turbopack)2.741s3.007s0.267s404.53x
🌐 MongoDBNext.js (Turbopack)9.862s10.432s0.570s1216.29x
💻 LocalNext.js (Turbopack)10.107s10.606s0.499s1216.70x
💻 LocalNitro10.955s (-1.4%)11.571s (-0.8%)0.616s1118.10x
💻 LocalExpress11.174s (-1.0%)11.846s (-1.5%)0.671s1118.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)6.960s (-11.2% 🟢)8.087s (-13.7% 🟢)1.127s151.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.168s (-22.4% 🟢)0.996s (~)0.001s (+16.7% 🔺)1.012s (~)0.844s101.00x
🌐 RedisNext.js (Turbopack)0.178s1.000s0.002s1.007s0.829s101.06x
💻 LocalNext.js (Turbopack)0.185s1.002s0.010s1.016s0.831s101.10x
💻 LocalNitro0.198s (+0.7%)1.003s (~)0.011s (-5.9% 🟢)1.017s (~)0.819s101.18x
💻 LocalExpress0.201s (-1.7%)1.003s (~)0.012s (-2.5%)1.017s (~)0.816s101.20x
🐘 PostgresNext.js (Turbopack)0.218s1.002s0.001s1.014s0.796s101.30x
🐘 PostgresNitro0.241s (+0.8%)0.993s (~)0.002s (+7.1% 🔺)1.013s (~)0.772s101.43x
🌐 MongoDBNext.js (Turbopack)0.493s0.960s0.001s1.009s0.516s102.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.656s (-4.3%)2.778s (-7.0% 🟢)0.004s (-29.5% 🟢)3.267s (-9.1% 🟢)1.611s101.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.555s1.000s0.003s1.011s0.456s601.00x
🐘 PostgresExpress0.616s (-11.2% 🟢)1.022s (+1.8%)0.003s (-18.6% 🟢)1.042s (+1.4%)0.425s591.11x
💻 LocalNext.js (Turbopack)0.669s1.008s0.010s1.024s0.355s591.20x
💻 LocalNitro0.722s (-0.7%)1.009s (~)0.010s (+3.3%)1.023s (~)0.301s591.30x
💻 LocalExpress0.731s (-5.9% 🟢)1.009s (-1.7%)0.010s (-2.2%)1.023s (-1.8%)0.292s591.32x
🐘 PostgresNitro0.733s (+1.5%)1.021s (+1.6%)0.004s (+11.7% 🔺)1.044s (+1.8%)0.311s591.32x
🐘 PostgresNext.js (Turbopack)0.751s1.010s0.004s1.027s0.276s591.35x
🌐 MongoDBNext.js (Turbopack)1.329s1.950s0.003s2.013s0.685s302.39x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.008s (+10.1% 🔺)5.891s (+1.8%)0.481s (+140.2% 🔺)6.857s (+5.0% 🔺)1.849s91.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.802s1.000s0.000s1.005s0.203s601.00x
🐘 PostgresExpress0.814s (-8.9% 🟢)1.043s (-3.7%)0.000s (+89.7% 🔺)1.071s (-3.1%)0.257s581.02x
🐘 PostgresNitro0.933s (+1.3%)1.150s (+8.3% 🔺)0.000s (+64.7% 🔺)1.180s (+9.2% 🔺)0.247s511.16x
🐘 PostgresNext.js (Turbopack)0.985s1.177s0.000s1.188s0.203s511.23x
💻 LocalNitro1.236s (+0.9%)2.020s (~)0.000s (-23.1% 🟢)2.023s (~)0.786s301.54x
💻 LocalNext.js (Turbopack)1.237s2.018s0.000s2.022s0.785s301.54x
💻 LocalExpress1.239s (-1.5%)2.020s (~)0.000s (-35.3% 🟢)2.023s (~)0.783s301.55x
🌐 MongoDBNext.js (Turbopack)2.360s2.946s0.000s3.008s0.648s202.94x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.692s (+26.0% 🔺)4.603s (+15.4% 🔺)0.000s (-41.7% 🟢)5.065s (+10.4% 🔺)1.373s121.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.529s2.034s0.000s2.040s0.510s301.00x
🐘 PostgresExpress1.686s (-6.6% 🟢)2.104s (~)0.000s (NaN%)2.133s (+0.5%)0.447s291.10x
🐘 PostgresNitro1.858s (-1.7%)2.098s (-5.5% 🟢)0.000s (-6.9% 🟢)2.117s (-5.5% 🟢)0.258s291.22x
🐘 PostgresNext.js (Turbopack)2.000s2.349s0.000s2.360s0.360s261.31x
💻 LocalNitro3.382s (+1.6%)4.033s (+1.6%)0.000s (-14.7% 🟢)4.037s (+1.6%)0.655s152.21x
💻 LocalNext.js (Turbopack)3.482s4.030s0.001s4.036s0.554s152.28x
💻 LocalExpress3.498s (+1.6%)4.098s (~)0.001s (+75.0% 🔺)4.102s (~)0.604s152.29x
🌐 MongoDBNext.js (Turbopack)4.395s4.976s0.000s5.011s0.616s122.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.869s (-11.4% 🟢)4.515s (-16.3% 🟢)0.000s (-100.0% 🟢)5.038s (-15.5% 🟢)1.169s131.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)18/21
🐘 PostgresExpress21/21
▲ VercelNext.js (Turbopack)21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres20/21
Next.js (Turbopack)🌐 Redis10/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production779167847
✅ 💻 Local Development7820142924
✅ 📦 Local Production7820142924
✅ 🐘 Local Postgres7270120847
✅ 🪟 Windows720577
❌ 🌍 Community Worlds1225821201
✅ 📋 Other198033231
Total3462595304051

❌ Failed Tests

▲ Vercel Production (1 failed)

example (1 failed):

🌍 Community Worlds (58 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

turso (53 failed):

  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KM6EQMFSSRJS76FW2VKYFC6X
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KM6EPGB5MHJ8YKVRWV2GKBEZ
  • promiseRaceWorkflow | wrun_01KM6EPKKCXKBHS77F1SN43AMM
  • promiseAnyWorkflow | wrun_01KM6EPNQB22J6R6YRY6NM84FM
  • importedStepOnlyWorkflow | wrun_01KM6ER2CBE39PF8CGSM5VP0JD
  • hookWorkflow | wrun_01KM6EQ25HJT2YYHAAJ3XADSAM
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • sleepingWorkflow | wrun_01KM6EQWAX2WSGW45X18BZM48A
  • parallelSleepWorkflow | wrun_01KM6ER8X111T19990VHTDFHXS
  • nullByteWorkflow | wrun_01KM6EREKA8MP390A0MWFDPKXY
  • workflowAndStepMetadataWorkflow | wrun_01KM6ERGYD1SHFWFEJBT7G0GT5
  • fetchWorkflow | wrun_01KM6ETBHPJ888CCD6008X0900
  • promiseRaceStressTestWorkflow | wrun_01KM6ETEZ9YDMFT5D1SWPJ6F4B
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KM6EXEX6EBHWZPDYABKM366M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KM6EYQZ9Q9GVYM8CVTMW9YEX
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KM6EZBGY895Q2T0QB7R3CWYR
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KM6EZMBHD3WX0SF21M07MJXY
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KM6EZV14JAWSMACBS0M0N4D1
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KM6EZX6CXS0CFYSDT2BWRHQ7
  • startFromWorkflow - calling start() directly inside a workflow function with hook communication
  • fibonacciWorkflow - recursive workflow composition via start()
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KM6F0CERY0X2RQKHYVV0M8CN
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KM6F0J8FCDZQ68EA8PWB8GJF
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KM6F0RZ6RFJP7415J3S6BTNR
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KM6F10P79TYKACWGFVXHKPEE
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KM6F178G30Z4VDETWFV53JPJ
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KM6F1DVYE9TNCTP39V71912Q
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KM6F1PTC83D0SYRWJA2XTXTP
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KM6F21X21AEBYXFSBTS5V6M7
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KM6F2A1JP11Z8KGDAWNB2GK3
  • cancelRun - cancelling a running workflow | wrun_01KM6F2GTPDS6HKWM3X5YQF41H
  • cancelRun via CLI - cancelling a running workflow | wrun_01KM6F2T3Z4YFC0NXTB3JXJQZ9
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01KM6F375GH61TFF6G0YZSM0KA
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KM6F3V6D7PN667T48JCEY8E7
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KM6F45ZYNS8T1RP0HNEJNGZ7

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro7007
❌ example6917
✅ express7007
✅ fastify7007
✅ hono7007
✅ nextjs-turbopack7502
✅ nextjs-webpack7502
✅ nitro7007
✅ nuxt7007
✅ sveltekit7007
✅ vite7007
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7205
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5435
✅ redis-dev302
❌ redis5525
✅ turso-dev302
❌ turso4535
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable66011
✅ e2e-local-postgres-nest-stable66011
✅ e2e-local-prod-nest-stable66011

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: failure
  • Windows: success

Check the workflow run for details.

VaguelySeriousand others added 2 commits March 19, 2026 19:17
Negative startIndex values (e.g. -3) resolve to n chunks before the
known end of the stream. All world implementations (local, postgres,
vercel) support this. Includes unit tests, e2e test, and doc updates.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threadpackages/world-vercel/src/utils.ts Outdated
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is a clean, well-tested feature. The implementation is consistent across worlds and the clamping behavior is solid. A few comments inline — the main concern is the docs could better call out the live-stream caveat, and the skill file could mention negative startIndex.

```

The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received.
The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received. Negative values are also supported (e.g. `-5` starts 5 chunks before the end), which is useful for showing the most recent output without replaying the full stream.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence mentions negative values as useful for "showing the most recent output without replaying the full stream" — but in the context of WorkflowChatTransport, the transport itself never uses negative startIndex (it tracks chunkIndex incrementally). The mention here might confuse readers into thinking the transport automatically leverages this.

Consider clarifying that this is useful for custom stream consumption (e.g., a dashboard showing recent output), not something WorkflowChatTransport does internally.


This allows clients to reconnect and continue receiving data from where they left off, rather than restarting from the beginning.

`startIndex` also supports **negative values** to read relative to the end of the stream. For example, `startIndex: -5` starts 5 chunks before the current end. This is useful when you want to show the most recent output without reading the entire stream history:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting that on a live (not-yet-closed) stream, the negative startIndex resolves at connection time — so -5 means "5 before the current end at the time of connecting", and any chunks written afterward will still be delivered. This is an important subtlety the e2e test handles (via waitForCompletion: true) but the docs do not mention.

A short note like: "On an active stream, the index resolves relative to the chunk count at connection time; subsequent chunks are still delivered." would prevent misunderstanding.

Comment threadpackages/world-local/src/streamer.ts Outdated
// Resolve negative startIndex relative to the number of data chunks
// (excluding the trailing EOF marker chunk, if present).
let dataChunkCount = chunkFiles.length;
if (startIndex < 0 && chunkFiles.length > 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: startIndex is typed as number | undefined (from the startIndex?: number parameter). The startIndex < 0 check works because undefined < 0 is false in JS, but it reads a bit fragile. Consider an explicit typeof startIndex === 'number' && startIndex < 0 guard to match the style used in world-vercel/src/streamer.ts:127.

if (startIndex < 0 && chunkFiles.length > 0) {
const lastFile = chunkFiles[chunkFiles.length - 1];
const lastExt = fileExtMap.get(lastFile) ?? '.bin';
const lastChunk = deserializeChunk(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads and deserializes the last chunk file just to check eof. On the hot path for a stream with many chunks, this is an extra disk read every time a reader connects with a negative startIndex. Not blocking, but worth a comment noting the cost, or consider whether the EOF state could be tracked more cheaply (e.g., checking for a sentinel file).


// Resolve negative offset relative to the data chunk count
// (excluding the trailing EOF marker, if present)
if (offset < 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nit as the local streamer: offset starts as startIndex ?? 0, so it can never be undefined here — but an explicit typeof guard would make the intent clearer at a glance.

{/* @skip-typecheck: incomplete code sample */}
```typescript
// Read only the last 10 chunks
const stream = run.getReadable({ startIndex: -10 });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add some note/callout to be careful about paginating on this. Because streams are live and will continue enqueueing chunks, relative numbers will map to different absolute chunk "IDs" on subsequent calls. I think accurate pagination is only possible when cursor based, and streams don't support cursor based pagination yet so clients should account for that limitation

@VaguelySeriousVaguelySeriousMar 20, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a problem when using run.getReadable directly, but it is a big problem for resumption, i.e. WorkflowChatTransport. I'm working on this in a follow-up PR together with a metadata/tail endpoint, and cursor-based pagination. I'll add a comment in this PR to mention the limitation

// and 2 chunks to the "test" named stream:
// chunk 0: binary "Hello, named stream!"
// chunk 1: object { foo: 'bar' }
describe.skipIf(isLocalDeployment())('outputStreamWorkflow', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we skipping this test in local deployment? 🤔 this might be outdated and we should probably re-enable streaming tests in local deployments

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already being done so this PR isn't changing it. I might try re-enabling in the next PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah just fly by noticed this

// Negative startIndex resolves at connection time using knownChunkCount,
// so the stream must be fully written before connecting the reader.
waitForCompletion: true,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The e2e coverage for negative startIndex only tests -1 (last chunk). The unit tests in world-local/src/streamer.test.ts are more thorough (covering -2 and clamping with -100), but consider adding a clamping case to this data-driven loop too — e.g., startIndex: -100 expecting all chunks — so the full resolution path is exercised end-to-end across all worlds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add a broader test in the next PR

- Clarify that negative startIndex is for custom consumers, not WorkflowChatTransport
- Add live-stream caveat for negative startIndex resolution timing
- Add pagination limitation callout for live streams
- Use explicit typeof guards for negative startIndex checks (world-local, world-postgres)
- Add cost comment for EOF marker disk read in world-local
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threaddocs/content/docs/ai/resumable-streams.mdx Outdated
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@ghostghost mentioned this pull request Mar 20, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[core] Support negative startIndex for streaming - #1460

Merged
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start
Mar 20, 2026
Merged

[core] Support negative startIndex for streaming#1460
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Negative startIndex values (e.g. -3) resolve to n chunks before the known end of the stream. All world implementations (local, postgres, vercel) support this. Includes unit tests, e2e test, and doc updates.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7a2ee25

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
NameType
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
@workflow/corePatch
@workflow/cliPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/world-testingPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.043s (-4.9%)1.005s (~)0.962s101.00x
💻 LocalNitro0.043s (-8.4% 🟢)1.005s (~)0.962s101.02x
🐘 PostgresExpress0.048s (-32.2% 🟢)1.011s (-0.6%)0.963s101.13x
💻 LocalNext.js (Turbopack)0.050s1.005s0.955s101.18x
🌐 RedisNext.js (Turbopack)0.055s1.005s0.949s101.30x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.953s101.38x
🐘 PostgresNitro0.063s (-8.8% 🟢)1.013s (~)0.949s101.48x
🌐 MongoDBNext.js (Turbopack)0.114s1.008s0.893s102.68x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.464s (-35.6% 🟢)2.116s (-18.2% 🟢)1.651s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.114s (-2.2%)2.012s (~)0.898s101.00x
💻 LocalNext.js (Turbopack)1.119s2.005s0.886s101.00x
🌐 RedisNext.js (Turbopack)1.125s2.006s0.882s101.01x
💻 LocalExpress1.126s (~)2.006s (~)0.880s101.01x
💻 LocalNitro1.134s (~)2.005s (~)0.871s101.02x
🐘 PostgresNext.js (Turbopack)1.147s2.012s0.865s101.03x
🐘 PostgresNitro1.152s (+0.8%)2.014s (~)0.862s101.03x
🌐 MongoDBNext.js (Turbopack)1.310s2.009s0.698s101.18x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.083s (-10.3% 🟢)3.346s (-12.2% 🟢)1.263s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.739s (-1.5%)11.043s (~)0.304s31.00x
🌐 RedisNext.js (Turbopack)10.778s11.023s0.245s31.00x
💻 LocalNext.js (Turbopack)10.804s11.023s0.219s31.01x
🐘 PostgresNext.js (Turbopack)10.905s11.042s0.137s31.02x
💻 LocalNitro10.910s (~)11.023s (~)0.113s31.02x
💻 LocalExpress10.914s (~)11.023s (~)0.108s31.02x
🐘 PostgresNitro11.001s (~)11.046s (~)0.046s31.02x
🌐 MongoDBNext.js (Turbopack)12.213s13.016s0.803s31.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)17.063s (-3.9%)18.514s (-6.5% 🟢)1.451s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express14.176s (-2.7%)15.041s (~)0.865s41.00x
🌐 RedisNext.js (Turbopack)14.263s15.030s0.766s41.01x
🐘 PostgresNext.js (Turbopack)14.531s15.044s0.513s41.03x
💻 LocalNext.js (Turbopack)14.559s15.030s0.471s41.03x
🐘 PostgresNitro14.800s (~)15.044s (~)0.243s41.04x
💻 LocalNitro14.895s (~)15.029s (~)0.133s41.05x
💻 LocalExpress14.928s (~)15.027s (-3.2%)0.099s41.05x
🌐 MongoDBNext.js (Turbopack)17.872s18.026s0.154s41.26x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.853s (+1.2%)34.473s (-0.6%)1.620s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.190s (-5.9% 🟢)14.038s (-3.0%)0.847s71.00x
🌐 RedisNext.js (Turbopack)13.302s14.026s0.723s71.01x
🐘 PostgresNext.js (Turbopack)14.132s14.613s0.481s71.07x
🐘 PostgresNitro14.413s (~)15.041s (~)0.628s61.09x
💻 LocalNext.js (Turbopack)15.756s16.029s0.273s61.19x
💻 LocalExpress16.483s (-1.2%)17.031s (~)0.548s61.25x
💻 LocalNitro16.489s (~)17.029s (~)0.539s61.25x
🌐 MongoDBNext.js (Turbopack)20.399s21.025s0.625s51.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)56.806s (-9.5% 🟢)57.958s (-10.1% 🟢)1.153s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-4.3%)2.011s (~)0.800s151.00x
🐘 PostgresNext.js (Turbopack)1.266s2.013s0.746s151.05x
🐘 PostgresNitro1.281s (-0.9%)2.011s (~)0.730s151.06x
🌐 RedisNext.js (Turbopack)1.300s2.006s0.706s151.07x
💻 LocalNext.js (Turbopack)1.489s2.005s0.516s151.23x
💻 LocalNitro1.509s (+1.7%)2.006s (~)0.497s151.25x
💻 LocalExpress1.520s (+0.9%)2.006s (~)0.486s151.25x
🌐 MongoDBNext.js (Turbopack)2.156s3.008s0.852s101.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.664s (+6.9% 🔺)3.854s (-1.2%)1.189s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.366s (-3.8%)3.012s (~)0.646s101.00x
🐘 PostgresNitro2.459s (~)3.013s (~)0.553s101.04x
🐘 PostgresNext.js (Turbopack)2.515s3.012s0.497s101.06x
🌐 RedisNext.js (Turbopack)2.523s3.008s0.485s101.07x
💻 LocalNext.js (Turbopack)2.655s3.007s0.353s101.12x
💻 LocalNitro2.909s (+1.3%)3.107s (~)0.198s101.23x
💻 LocalExpress2.929s (-2.3%)3.308s (-7.2% 🟢)0.379s101.24x
🌐 MongoDBNext.js (Turbopack)4.824s5.345s0.521s62.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.892s (+10.0% 🔺)4.180s (+3.8%)1.287s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.522s (-1.9%)4.014s (~)0.492s81.00x
🐘 PostgresNitro3.609s (-0.6%)4.014s (~)0.405s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.014s0.246s81.07x
🌐 RedisNext.js (Turbopack)4.125s5.012s0.887s61.17x
💻 LocalNext.js (Turbopack)7.055s7.767s0.712s42.00x
💻 LocalNitro8.305s (+2.2%)8.770s (~)0.465s42.36x
💻 LocalExpress8.379s (-1.1%)9.020s (~)0.641s42.38x
🌐 MongoDBNext.js (Turbopack)10.095s10.680s0.585s32.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.478s (+3.7%)4.771s (-4.8%)1.293s71.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.202s (-4.6%)2.010s (~)0.809s151.00x
🐘 PostgresNext.js (Turbopack)1.253s2.011s0.758s151.04x
🐘 PostgresNitro1.273s (~)2.011s (~)0.738s151.06x
🌐 RedisNext.js (Turbopack)1.319s2.006s0.688s151.10x
💻 LocalNext.js (Turbopack)1.529s2.006s0.477s151.27x
💻 LocalNitro1.540s (-1.3%)2.005s (~)0.465s151.28x
💻 LocalExpress1.547s (+0.7%)2.005s (~)0.458s151.29x
🌐 MongoDBNext.js (Turbopack)2.181s3.008s0.827s101.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.572s (-1.1%)3.643s (-9.2% 🟢)1.070s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.341s (-4.5%)3.012s (~)0.671s101.00x
🐘 PostgresNitro2.454s (~)3.013s (~)0.559s101.05x
🐘 PostgresNext.js (Turbopack)2.470s3.011s0.541s101.06x
🌐 RedisNext.js (Turbopack)2.569s3.008s0.439s101.10x
💻 LocalNext.js (Turbopack)2.818s3.109s0.291s101.20x
💻 LocalNitro2.963s (-2.1%)3.676s (~)0.713s91.27x
💻 LocalExpress2.990s (-1.4%)3.676s (-2.2%)0.686s91.28x
🌐 MongoDBNext.js (Turbopack)4.746s5.178s0.432s62.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.766s (+16.2% 🔺)3.783s (+3.3%)1.017s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.517s (-2.3%)4.013s (~)0.496s81.00x
🐘 PostgresNitro3.651s (+1.0%)4.015s (~)0.363s81.04x
🐘 PostgresNext.js (Turbopack)3.735s4.014s0.279s81.06x
🌐 RedisNext.js (Turbopack)4.147s4.726s0.579s71.18x
💻 LocalNext.js (Turbopack)8.126s8.773s0.647s42.31x
💻 LocalNitro8.728s (+1.0%)9.019s (~)0.291s42.48x
💻 LocalExpress8.804s (-2.8%)9.025s (-7.7% 🟢)0.220s42.50x
🌐 MongoDBNext.js (Turbopack)9.951s10.684s0.732s32.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.848s (-1.8%)5.484s (~)1.636s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.652s (-24.7% 🟢)1.009s (-1.7%)0.357s601.00x
🌐 RedisNext.js (Turbopack)0.687s1.004s0.318s601.05x
🐘 PostgresNext.js (Turbopack)0.835s1.026s0.191s591.28x
💻 LocalNext.js (Turbopack)0.850s1.004s0.154s601.30x
🐘 PostgresNitro0.873s (-2.6%)1.009s (-3.3%)0.136s601.34x
💻 LocalNitro0.980s (+2.6%)1.136s (+11.3% 🔺)0.156s531.50x
💻 LocalExpress0.980s (~)1.158s (+5.7% 🔺)0.178s521.50x
🌐 MongoDBNext.js (Turbopack)2.158s3.008s0.851s203.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)10.623s (+1.2%)11.948s (-3.1%)1.325s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.572s (-25.7% 🟢)2.010s (-33.3% 🟢)0.438s451.00x
🌐 RedisNext.js (Turbopack)1.678s2.006s0.328s451.07x
🐘 PostgresNext.js (Turbopack)2.027s2.511s0.484s361.29x
🐘 PostgresNitro2.148s (-0.6%)3.012s (+1.1%)0.864s301.37x
💻 LocalNext.js (Turbopack)2.666s3.007s0.341s301.70x
💻 LocalNitro2.974s (+0.6%)3.330s (+7.0% 🔺)0.355s281.89x
💻 LocalExpress2.987s (-0.9%)3.329s (-6.1% 🟢)0.342s281.90x
🌐 MongoDBNext.js (Turbopack)5.273s6.011s0.739s153.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.443s (-0.6%)33.373s (-2.3%)0.929s31.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.263s (-23.5% 🟢)4.013s (-19.3% 🟢)0.750s301.00x
🌐 RedisNext.js (Turbopack)3.293s4.008s0.716s301.01x
🐘 PostgresNext.js (Turbopack)4.106s4.975s0.868s251.26x
🐘 PostgresNitro4.367s (+0.7%)5.015s (~)0.648s241.34x
💻 LocalNext.js (Turbopack)8.417s9.016s0.599s142.58x
💻 LocalNitro8.989s (~)9.479s (~)0.490s132.75x
💻 LocalExpress9.106s (~)9.710s (-0.8%)0.604s132.79x
🌐 MongoDBNext.js (Turbopack)10.535s11.019s0.484s113.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)89.160s (-8.5% 🟢)90.435s (-9.0% 🟢)1.274s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.243s (-19.5% 🟢)1.009s (~)0.766s601.00x
🐘 PostgresNext.js (Turbopack)0.265s1.009s0.744s601.09x
🐘 PostgresNitro0.298s (+1.1%)1.009s (~)0.711s601.22x
🌐 RedisNext.js (Turbopack)0.401s1.021s0.620s591.65x
💻 LocalNext.js (Turbopack)0.558s1.021s0.464s592.29x
💻 LocalNitro0.589s (-1.5%)1.004s (~)0.416s602.42x
💻 LocalExpress0.606s (+0.5%)1.004s (~)0.398s602.49x
🌐 MongoDBNext.js (Turbopack)1.655s2.149s0.494s286.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.914s (+0.7%)3.311s (-7.5% 🟢)1.397s191.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.419s (-20.5% 🟢)1.009s (~)0.590s901.00x
🐘 PostgresNitro0.540s (~)1.009s (~)0.469s901.29x
🐘 PostgresNext.js (Turbopack)0.569s1.021s0.451s891.36x
🌐 RedisNext.js (Turbopack)1.171s2.006s0.835s452.79x
💻 LocalNext.js (Turbopack)2.377s3.008s0.632s305.67x
💻 LocalNitro2.495s (+0.8%)3.008s (~)0.513s305.95x
💻 LocalExpress2.545s (-1.4%)3.009s (~)0.464s306.07x
🌐 MongoDBNext.js (Turbopack)4.756s5.287s0.532s1811.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.221s (-6.3% 🟢)4.527s (-5.8% 🟢)1.306s211.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.605s (-32.6% 🟢)1.009s (-3.1%)0.404s1191.00x
🐘 PostgresNitro0.919s (-2.1%)1.216s (+2.0%)0.297s991.52x
🐘 PostgresNext.js (Turbopack)0.964s1.345s0.381s901.59x
🌐 RedisNext.js (Turbopack)2.741s3.007s0.267s404.53x
🌐 MongoDBNext.js (Turbopack)9.862s10.432s0.570s1216.29x
💻 LocalNext.js (Turbopack)10.107s10.606s0.499s1216.70x
💻 LocalNitro10.955s (-1.4%)11.571s (-0.8%)0.616s1118.10x
💻 LocalExpress11.174s (-1.0%)11.846s (-1.5%)0.671s1118.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)6.960s (-11.2% 🟢)8.087s (-13.7% 🟢)1.127s151.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.168s (-22.4% 🟢)0.996s (~)0.001s (+16.7% 🔺)1.012s (~)0.844s101.00x
🌐 RedisNext.js (Turbopack)0.178s1.000s0.002s1.007s0.829s101.06x
💻 LocalNext.js (Turbopack)0.185s1.002s0.010s1.016s0.831s101.10x
💻 LocalNitro0.198s (+0.7%)1.003s (~)0.011s (-5.9% 🟢)1.017s (~)0.819s101.18x
💻 LocalExpress0.201s (-1.7%)1.003s (~)0.012s (-2.5%)1.017s (~)0.816s101.20x
🐘 PostgresNext.js (Turbopack)0.218s1.002s0.001s1.014s0.796s101.30x
🐘 PostgresNitro0.241s (+0.8%)0.993s (~)0.002s (+7.1% 🔺)1.013s (~)0.772s101.43x
🌐 MongoDBNext.js (Turbopack)0.493s0.960s0.001s1.009s0.516s102.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.656s (-4.3%)2.778s (-7.0% 🟢)0.004s (-29.5% 🟢)3.267s (-9.1% 🟢)1.611s101.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.555s1.000s0.003s1.011s0.456s601.00x
🐘 PostgresExpress0.616s (-11.2% 🟢)1.022s (+1.8%)0.003s (-18.6% 🟢)1.042s (+1.4%)0.425s591.11x
💻 LocalNext.js (Turbopack)0.669s1.008s0.010s1.024s0.355s591.20x
💻 LocalNitro0.722s (-0.7%)1.009s (~)0.010s (+3.3%)1.023s (~)0.301s591.30x
💻 LocalExpress0.731s (-5.9% 🟢)1.009s (-1.7%)0.010s (-2.2%)1.023s (-1.8%)0.292s591.32x
🐘 PostgresNitro0.733s (+1.5%)1.021s (+1.6%)0.004s (+11.7% 🔺)1.044s (+1.8%)0.311s591.32x
🐘 PostgresNext.js (Turbopack)0.751s1.010s0.004s1.027s0.276s591.35x
🌐 MongoDBNext.js (Turbopack)1.329s1.950s0.003s2.013s0.685s302.39x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.008s (+10.1% 🔺)5.891s (+1.8%)0.481s (+140.2% 🔺)6.857s (+5.0% 🔺)1.849s91.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.802s1.000s0.000s1.005s0.203s601.00x
🐘 PostgresExpress0.814s (-8.9% 🟢)1.043s (-3.7%)0.000s (+89.7% 🔺)1.071s (-3.1%)0.257s581.02x
🐘 PostgresNitro0.933s (+1.3%)1.150s (+8.3% 🔺)0.000s (+64.7% 🔺)1.180s (+9.2% 🔺)0.247s511.16x
🐘 PostgresNext.js (Turbopack)0.985s1.177s0.000s1.188s0.203s511.23x
💻 LocalNitro1.236s (+0.9%)2.020s (~)0.000s (-23.1% 🟢)2.023s (~)0.786s301.54x
💻 LocalNext.js (Turbopack)1.237s2.018s0.000s2.022s0.785s301.54x
💻 LocalExpress1.239s (-1.5%)2.020s (~)0.000s (-35.3% 🟢)2.023s (~)0.783s301.55x
🌐 MongoDBNext.js (Turbopack)2.360s2.946s0.000s3.008s0.648s202.94x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.692s (+26.0% 🔺)4.603s (+15.4% 🔺)0.000s (-41.7% 🟢)5.065s (+10.4% 🔺)1.373s121.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.529s2.034s0.000s2.040s0.510s301.00x
🐘 PostgresExpress1.686s (-6.6% 🟢)2.104s (~)0.000s (NaN%)2.133s (+0.5%)0.447s291.10x
🐘 PostgresNitro1.858s (-1.7%)2.098s (-5.5% 🟢)0.000s (-6.9% 🟢)2.117s (-5.5% 🟢)0.258s291.22x
🐘 PostgresNext.js (Turbopack)2.000s2.349s0.000s2.360s0.360s261.31x
💻 LocalNitro3.382s (+1.6%)4.033s (+1.6%)0.000s (-14.7% 🟢)4.037s (+1.6%)0.655s152.21x
💻 LocalNext.js (Turbopack)3.482s4.030s0.001s4.036s0.554s152.28x
💻 LocalExpress3.498s (+1.6%)4.098s (~)0.001s (+75.0% 🔺)4.102s (~)0.604s152.29x
🌐 MongoDBNext.js (Turbopack)4.395s4.976s0.000s5.011s0.616s122.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.869s (-11.4% 🟢)4.515s (-16.3% 🟢)0.000s (-100.0% 🟢)5.038s (-15.5% 🟢)1.169s131.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)18/21
🐘 PostgresExpress21/21
▲ VercelNext.js (Turbopack)21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres20/21
Next.js (Turbopack)🌐 Redis10/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production779167847
✅ 💻 Local Development7820142924
✅ 📦 Local Production7820142924
✅ 🐘 Local Postgres7270120847
✅ 🪟 Windows720577
❌ 🌍 Community Worlds1225821201
✅ 📋 Other198033231
Total3462595304051

❌ Failed Tests

▲ Vercel Production (1 failed)

example (1 failed):

🌍 Community Worlds (58 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

turso (53 failed):

  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KM6EQMFSSRJS76FW2VKYFC6X
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KM6EPGB5MHJ8YKVRWV2GKBEZ
  • promiseRaceWorkflow | wrun_01KM6EPKKCXKBHS77F1SN43AMM
  • promiseAnyWorkflow | wrun_01KM6EPNQB22J6R6YRY6NM84FM
  • importedStepOnlyWorkflow | wrun_01KM6ER2CBE39PF8CGSM5VP0JD
  • hookWorkflow | wrun_01KM6EQ25HJT2YYHAAJ3XADSAM
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • sleepingWorkflow | wrun_01KM6EQWAX2WSGW45X18BZM48A
  • parallelSleepWorkflow | wrun_01KM6ER8X111T19990VHTDFHXS
  • nullByteWorkflow | wrun_01KM6EREKA8MP390A0MWFDPKXY
  • workflowAndStepMetadataWorkflow | wrun_01KM6ERGYD1SHFWFEJBT7G0GT5
  • fetchWorkflow | wrun_01KM6ETBHPJ888CCD6008X0900
  • promiseRaceStressTestWorkflow | wrun_01KM6ETEZ9YDMFT5D1SWPJ6F4B
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KM6EXEX6EBHWZPDYABKM366M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KM6EYQZ9Q9GVYM8CVTMW9YEX
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KM6EZBGY895Q2T0QB7R3CWYR
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KM6EZMBHD3WX0SF21M07MJXY
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KM6EZV14JAWSMACBS0M0N4D1
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KM6EZX6CXS0CFYSDT2BWRHQ7
  • startFromWorkflow - calling start() directly inside a workflow function with hook communication
  • fibonacciWorkflow - recursive workflow composition via start()
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KM6F0CERY0X2RQKHYVV0M8CN
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KM6F0J8FCDZQ68EA8PWB8GJF
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KM6F0RZ6RFJP7415J3S6BTNR
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KM6F10P79TYKACWGFVXHKPEE
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KM6F178G30Z4VDETWFV53JPJ
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KM6F1DVYE9TNCTP39V71912Q
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KM6F1PTC83D0SYRWJA2XTXTP
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KM6F21X21AEBYXFSBTS5V6M7
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KM6F2A1JP11Z8KGDAWNB2GK3
  • cancelRun - cancelling a running workflow | wrun_01KM6F2GTPDS6HKWM3X5YQF41H
  • cancelRun via CLI - cancelling a running workflow | wrun_01KM6F2T3Z4YFC0NXTB3JXJQZ9
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01KM6F375GH61TFF6G0YZSM0KA
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KM6F3V6D7PN667T48JCEY8E7
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KM6F45ZYNS8T1RP0HNEJNGZ7

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro7007
❌ example6917
✅ express7007
✅ fastify7007
✅ hono7007
✅ nextjs-turbopack7502
✅ nextjs-webpack7502
✅ nitro7007
✅ nuxt7007
✅ sveltekit7007
✅ vite7007
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7205
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5435
✅ redis-dev302
❌ redis5525
✅ turso-dev302
❌ turso4535
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable66011
✅ e2e-local-postgres-nest-stable66011
✅ e2e-local-prod-nest-stable66011

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: failure
  • Windows: success

Check the workflow run for details.

VaguelySeriousand others added 2 commits March 19, 2026 19:17
Negative startIndex values (e.g. -3) resolve to n chunks before the
known end of the stream. All world implementations (local, postgres,
vercel) support this. Includes unit tests, e2e test, and doc updates.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threadpackages/world-vercel/src/utils.ts Outdated
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is a clean, well-tested feature. The implementation is consistent across worlds and the clamping behavior is solid. A few comments inline — the main concern is the docs could better call out the live-stream caveat, and the skill file could mention negative startIndex.

```

The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received.
The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received. Negative values are also supported (e.g. `-5` starts 5 chunks before the end), which is useful for showing the most recent output without replaying the full stream.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence mentions negative values as useful for "showing the most recent output without replaying the full stream" — but in the context of WorkflowChatTransport, the transport itself never uses negative startIndex (it tracks chunkIndex incrementally). The mention here might confuse readers into thinking the transport automatically leverages this.

Consider clarifying that this is useful for custom stream consumption (e.g., a dashboard showing recent output), not something WorkflowChatTransport does internally.


This allows clients to reconnect and continue receiving data from where they left off, rather than restarting from the beginning.

`startIndex` also supports **negative values** to read relative to the end of the stream. For example, `startIndex: -5` starts 5 chunks before the current end. This is useful when you want to show the most recent output without reading the entire stream history:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting that on a live (not-yet-closed) stream, the negative startIndex resolves at connection time — so -5 means "5 before the current end at the time of connecting", and any chunks written afterward will still be delivered. This is an important subtlety the e2e test handles (via waitForCompletion: true) but the docs do not mention.

A short note like: "On an active stream, the index resolves relative to the chunk count at connection time; subsequent chunks are still delivered." would prevent misunderstanding.

Comment threadpackages/world-local/src/streamer.ts Outdated
// Resolve negative startIndex relative to the number of data chunks
// (excluding the trailing EOF marker chunk, if present).
let dataChunkCount = chunkFiles.length;
if (startIndex < 0 && chunkFiles.length > 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: startIndex is typed as number | undefined (from the startIndex?: number parameter). The startIndex < 0 check works because undefined < 0 is false in JS, but it reads a bit fragile. Consider an explicit typeof startIndex === 'number' && startIndex < 0 guard to match the style used in world-vercel/src/streamer.ts:127.

if (startIndex < 0 && chunkFiles.length > 0) {
const lastFile = chunkFiles[chunkFiles.length - 1];
const lastExt = fileExtMap.get(lastFile) ?? '.bin';
const lastChunk = deserializeChunk(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads and deserializes the last chunk file just to check eof. On the hot path for a stream with many chunks, this is an extra disk read every time a reader connects with a negative startIndex. Not blocking, but worth a comment noting the cost, or consider whether the EOF state could be tracked more cheaply (e.g., checking for a sentinel file).


// Resolve negative offset relative to the data chunk count
// (excluding the trailing EOF marker, if present)
if (offset < 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nit as the local streamer: offset starts as startIndex ?? 0, so it can never be undefined here — but an explicit typeof guard would make the intent clearer at a glance.

{/* @skip-typecheck: incomplete code sample */}
```typescript
// Read only the last 10 chunks
const stream = run.getReadable({ startIndex: -10 });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add some note/callout to be careful about paginating on this. Because streams are live and will continue enqueueing chunks, relative numbers will map to different absolute chunk "IDs" on subsequent calls. I think accurate pagination is only possible when cursor based, and streams don't support cursor based pagination yet so clients should account for that limitation

@VaguelySeriousVaguelySeriousMar 20, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a problem when using run.getReadable directly, but it is a big problem for resumption, i.e. WorkflowChatTransport. I'm working on this in a follow-up PR together with a metadata/tail endpoint, and cursor-based pagination. I'll add a comment in this PR to mention the limitation

// and 2 chunks to the "test" named stream:
// chunk 0: binary "Hello, named stream!"
// chunk 1: object { foo: 'bar' }
describe.skipIf(isLocalDeployment())('outputStreamWorkflow', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we skipping this test in local deployment? 🤔 this might be outdated and we should probably re-enable streaming tests in local deployments

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already being done so this PR isn't changing it. I might try re-enabling in the next PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah just fly by noticed this

// Negative startIndex resolves at connection time using knownChunkCount,
// so the stream must be fully written before connecting the reader.
waitForCompletion: true,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The e2e coverage for negative startIndex only tests -1 (last chunk). The unit tests in world-local/src/streamer.test.ts are more thorough (covering -2 and clamping with -100), but consider adding a clamping case to this data-driven loop too — e.g., startIndex: -100 expecting all chunks — so the full resolution path is exercised end-to-end across all worlds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add a broader test in the next PR

- Clarify that negative startIndex is for custom consumers, not WorkflowChatTransport
- Add live-stream caveat for negative startIndex resolution timing
- Add pagination limitation callout for live streams
- Use explicit typeof guards for negative startIndex checks (world-local, world-postgres)
- Add cost comment for EOF marker disk read in world-local
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threaddocs/content/docs/ai/resumable-streams.mdx Outdated
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@ghostghost mentioned this pull request Mar 20, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[core] Support negative startIndex for streaming - #1460

Merged
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start
Mar 20, 2026
Merged

[core] Support negative startIndex for streaming#1460
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Negative startIndex values (e.g. -3) resolve to n chunks before the known end of the stream. All world implementations (local, postgres, vercel) support this. Includes unit tests, e2e test, and doc updates.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7a2ee25

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
NameType
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
@workflow/corePatch
@workflow/cliPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/world-testingPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.043s (-4.9%)1.005s (~)0.962s101.00x
💻 LocalNitro0.043s (-8.4% 🟢)1.005s (~)0.962s101.02x
🐘 PostgresExpress0.048s (-32.2% 🟢)1.011s (-0.6%)0.963s101.13x
💻 LocalNext.js (Turbopack)0.050s1.005s0.955s101.18x
🌐 RedisNext.js (Turbopack)0.055s1.005s0.949s101.30x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.953s101.38x
🐘 PostgresNitro0.063s (-8.8% 🟢)1.013s (~)0.949s101.48x
🌐 MongoDBNext.js (Turbopack)0.114s1.008s0.893s102.68x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.464s (-35.6% 🟢)2.116s (-18.2% 🟢)1.651s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.114s (-2.2%)2.012s (~)0.898s101.00x
💻 LocalNext.js (Turbopack)1.119s2.005s0.886s101.00x
🌐 RedisNext.js (Turbopack)1.125s2.006s0.882s101.01x
💻 LocalExpress1.126s (~)2.006s (~)0.880s101.01x
💻 LocalNitro1.134s (~)2.005s (~)0.871s101.02x
🐘 PostgresNext.js (Turbopack)1.147s2.012s0.865s101.03x
🐘 PostgresNitro1.152s (+0.8%)2.014s (~)0.862s101.03x
🌐 MongoDBNext.js (Turbopack)1.310s2.009s0.698s101.18x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.083s (-10.3% 🟢)3.346s (-12.2% 🟢)1.263s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.739s (-1.5%)11.043s (~)0.304s31.00x
🌐 RedisNext.js (Turbopack)10.778s11.023s0.245s31.00x
💻 LocalNext.js (Turbopack)10.804s11.023s0.219s31.01x
🐘 PostgresNext.js (Turbopack)10.905s11.042s0.137s31.02x
💻 LocalNitro10.910s (~)11.023s (~)0.113s31.02x
💻 LocalExpress10.914s (~)11.023s (~)0.108s31.02x
🐘 PostgresNitro11.001s (~)11.046s (~)0.046s31.02x
🌐 MongoDBNext.js (Turbopack)12.213s13.016s0.803s31.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)17.063s (-3.9%)18.514s (-6.5% 🟢)1.451s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express14.176s (-2.7%)15.041s (~)0.865s41.00x
🌐 RedisNext.js (Turbopack)14.263s15.030s0.766s41.01x
🐘 PostgresNext.js (Turbopack)14.531s15.044s0.513s41.03x
💻 LocalNext.js (Turbopack)14.559s15.030s0.471s41.03x
🐘 PostgresNitro14.800s (~)15.044s (~)0.243s41.04x
💻 LocalNitro14.895s (~)15.029s (~)0.133s41.05x
💻 LocalExpress14.928s (~)15.027s (-3.2%)0.099s41.05x
🌐 MongoDBNext.js (Turbopack)17.872s18.026s0.154s41.26x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.853s (+1.2%)34.473s (-0.6%)1.620s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.190s (-5.9% 🟢)14.038s (-3.0%)0.847s71.00x
🌐 RedisNext.js (Turbopack)13.302s14.026s0.723s71.01x
🐘 PostgresNext.js (Turbopack)14.132s14.613s0.481s71.07x
🐘 PostgresNitro14.413s (~)15.041s (~)0.628s61.09x
💻 LocalNext.js (Turbopack)15.756s16.029s0.273s61.19x
💻 LocalExpress16.483s (-1.2%)17.031s (~)0.548s61.25x
💻 LocalNitro16.489s (~)17.029s (~)0.539s61.25x
🌐 MongoDBNext.js (Turbopack)20.399s21.025s0.625s51.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)56.806s (-9.5% 🟢)57.958s (-10.1% 🟢)1.153s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-4.3%)2.011s (~)0.800s151.00x
🐘 PostgresNext.js (Turbopack)1.266s2.013s0.746s151.05x
🐘 PostgresNitro1.281s (-0.9%)2.011s (~)0.730s151.06x
🌐 RedisNext.js (Turbopack)1.300s2.006s0.706s151.07x
💻 LocalNext.js (Turbopack)1.489s2.005s0.516s151.23x
💻 LocalNitro1.509s (+1.7%)2.006s (~)0.497s151.25x
💻 LocalExpress1.520s (+0.9%)2.006s (~)0.486s151.25x
🌐 MongoDBNext.js (Turbopack)2.156s3.008s0.852s101.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.664s (+6.9% 🔺)3.854s (-1.2%)1.189s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.366s (-3.8%)3.012s (~)0.646s101.00x
🐘 PostgresNitro2.459s (~)3.013s (~)0.553s101.04x
🐘 PostgresNext.js (Turbopack)2.515s3.012s0.497s101.06x
🌐 RedisNext.js (Turbopack)2.523s3.008s0.485s101.07x
💻 LocalNext.js (Turbopack)2.655s3.007s0.353s101.12x
💻 LocalNitro2.909s (+1.3%)3.107s (~)0.198s101.23x
💻 LocalExpress2.929s (-2.3%)3.308s (-7.2% 🟢)0.379s101.24x
🌐 MongoDBNext.js (Turbopack)4.824s5.345s0.521s62.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.892s (+10.0% 🔺)4.180s (+3.8%)1.287s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.522s (-1.9%)4.014s (~)0.492s81.00x
🐘 PostgresNitro3.609s (-0.6%)4.014s (~)0.405s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.014s0.246s81.07x
🌐 RedisNext.js (Turbopack)4.125s5.012s0.887s61.17x
💻 LocalNext.js (Turbopack)7.055s7.767s0.712s42.00x
💻 LocalNitro8.305s (+2.2%)8.770s (~)0.465s42.36x
💻 LocalExpress8.379s (-1.1%)9.020s (~)0.641s42.38x
🌐 MongoDBNext.js (Turbopack)10.095s10.680s0.585s32.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.478s (+3.7%)4.771s (-4.8%)1.293s71.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.202s (-4.6%)2.010s (~)0.809s151.00x
🐘 PostgresNext.js (Turbopack)1.253s2.011s0.758s151.04x
🐘 PostgresNitro1.273s (~)2.011s (~)0.738s151.06x
🌐 RedisNext.js (Turbopack)1.319s2.006s0.688s151.10x
💻 LocalNext.js (Turbopack)1.529s2.006s0.477s151.27x
💻 LocalNitro1.540s (-1.3%)2.005s (~)0.465s151.28x
💻 LocalExpress1.547s (+0.7%)2.005s (~)0.458s151.29x
🌐 MongoDBNext.js (Turbopack)2.181s3.008s0.827s101.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.572s (-1.1%)3.643s (-9.2% 🟢)1.070s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.341s (-4.5%)3.012s (~)0.671s101.00x
🐘 PostgresNitro2.454s (~)3.013s (~)0.559s101.05x
🐘 PostgresNext.js (Turbopack)2.470s3.011s0.541s101.06x
🌐 RedisNext.js (Turbopack)2.569s3.008s0.439s101.10x
💻 LocalNext.js (Turbopack)2.818s3.109s0.291s101.20x
💻 LocalNitro2.963s (-2.1%)3.676s (~)0.713s91.27x
💻 LocalExpress2.990s (-1.4%)3.676s (-2.2%)0.686s91.28x
🌐 MongoDBNext.js (Turbopack)4.746s5.178s0.432s62.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.766s (+16.2% 🔺)3.783s (+3.3%)1.017s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.517s (-2.3%)4.013s (~)0.496s81.00x
🐘 PostgresNitro3.651s (+1.0%)4.015s (~)0.363s81.04x
🐘 PostgresNext.js (Turbopack)3.735s4.014s0.279s81.06x
🌐 RedisNext.js (Turbopack)4.147s4.726s0.579s71.18x
💻 LocalNext.js (Turbopack)8.126s8.773s0.647s42.31x
💻 LocalNitro8.728s (+1.0%)9.019s (~)0.291s42.48x
💻 LocalExpress8.804s (-2.8%)9.025s (-7.7% 🟢)0.220s42.50x
🌐 MongoDBNext.js (Turbopack)9.951s10.684s0.732s32.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.848s (-1.8%)5.484s (~)1.636s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.652s (-24.7% 🟢)1.009s (-1.7%)0.357s601.00x
🌐 RedisNext.js (Turbopack)0.687s1.004s0.318s601.05x
🐘 PostgresNext.js (Turbopack)0.835s1.026s0.191s591.28x
💻 LocalNext.js (Turbopack)0.850s1.004s0.154s601.30x
🐘 PostgresNitro0.873s (-2.6%)1.009s (-3.3%)0.136s601.34x
💻 LocalNitro0.980s (+2.6%)1.136s (+11.3% 🔺)0.156s531.50x
💻 LocalExpress0.980s (~)1.158s (+5.7% 🔺)0.178s521.50x
🌐 MongoDBNext.js (Turbopack)2.158s3.008s0.851s203.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)10.623s (+1.2%)11.948s (-3.1%)1.325s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.572s (-25.7% 🟢)2.010s (-33.3% 🟢)0.438s451.00x
🌐 RedisNext.js (Turbopack)1.678s2.006s0.328s451.07x
🐘 PostgresNext.js (Turbopack)2.027s2.511s0.484s361.29x
🐘 PostgresNitro2.148s (-0.6%)3.012s (+1.1%)0.864s301.37x
💻 LocalNext.js (Turbopack)2.666s3.007s0.341s301.70x
💻 LocalNitro2.974s (+0.6%)3.330s (+7.0% 🔺)0.355s281.89x
💻 LocalExpress2.987s (-0.9%)3.329s (-6.1% 🟢)0.342s281.90x
🌐 MongoDBNext.js (Turbopack)5.273s6.011s0.739s153.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.443s (-0.6%)33.373s (-2.3%)0.929s31.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.263s (-23.5% 🟢)4.013s (-19.3% 🟢)0.750s301.00x
🌐 RedisNext.js (Turbopack)3.293s4.008s0.716s301.01x
🐘 PostgresNext.js (Turbopack)4.106s4.975s0.868s251.26x
🐘 PostgresNitro4.367s (+0.7%)5.015s (~)0.648s241.34x
💻 LocalNext.js (Turbopack)8.417s9.016s0.599s142.58x
💻 LocalNitro8.989s (~)9.479s (~)0.490s132.75x
💻 LocalExpress9.106s (~)9.710s (-0.8%)0.604s132.79x
🌐 MongoDBNext.js (Turbopack)10.535s11.019s0.484s113.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)89.160s (-8.5% 🟢)90.435s (-9.0% 🟢)1.274s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.243s (-19.5% 🟢)1.009s (~)0.766s601.00x
🐘 PostgresNext.js (Turbopack)0.265s1.009s0.744s601.09x
🐘 PostgresNitro0.298s (+1.1%)1.009s (~)0.711s601.22x
🌐 RedisNext.js (Turbopack)0.401s1.021s0.620s591.65x
💻 LocalNext.js (Turbopack)0.558s1.021s0.464s592.29x
💻 LocalNitro0.589s (-1.5%)1.004s (~)0.416s602.42x
💻 LocalExpress0.606s (+0.5%)1.004s (~)0.398s602.49x
🌐 MongoDBNext.js (Turbopack)1.655s2.149s0.494s286.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.914s (+0.7%)3.311s (-7.5% 🟢)1.397s191.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.419s (-20.5% 🟢)1.009s (~)0.590s901.00x
🐘 PostgresNitro0.540s (~)1.009s (~)0.469s901.29x
🐘 PostgresNext.js (Turbopack)0.569s1.021s0.451s891.36x
🌐 RedisNext.js (Turbopack)1.171s2.006s0.835s452.79x
💻 LocalNext.js (Turbopack)2.377s3.008s0.632s305.67x
💻 LocalNitro2.495s (+0.8%)3.008s (~)0.513s305.95x
💻 LocalExpress2.545s (-1.4%)3.009s (~)0.464s306.07x
🌐 MongoDBNext.js (Turbopack)4.756s5.287s0.532s1811.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.221s (-6.3% 🟢)4.527s (-5.8% 🟢)1.306s211.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.605s (-32.6% 🟢)1.009s (-3.1%)0.404s1191.00x
🐘 PostgresNitro0.919s (-2.1%)1.216s (+2.0%)0.297s991.52x
🐘 PostgresNext.js (Turbopack)0.964s1.345s0.381s901.59x
🌐 RedisNext.js (Turbopack)2.741s3.007s0.267s404.53x
🌐 MongoDBNext.js (Turbopack)9.862s10.432s0.570s1216.29x
💻 LocalNext.js (Turbopack)10.107s10.606s0.499s1216.70x
💻 LocalNitro10.955s (-1.4%)11.571s (-0.8%)0.616s1118.10x
💻 LocalExpress11.174s (-1.0%)11.846s (-1.5%)0.671s1118.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)6.960s (-11.2% 🟢)8.087s (-13.7% 🟢)1.127s151.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.168s (-22.4% 🟢)0.996s (~)0.001s (+16.7% 🔺)1.012s (~)0.844s101.00x
🌐 RedisNext.js (Turbopack)0.178s1.000s0.002s1.007s0.829s101.06x
💻 LocalNext.js (Turbopack)0.185s1.002s0.010s1.016s0.831s101.10x
💻 LocalNitro0.198s (+0.7%)1.003s (~)0.011s (-5.9% 🟢)1.017s (~)0.819s101.18x
💻 LocalExpress0.201s (-1.7%)1.003s (~)0.012s (-2.5%)1.017s (~)0.816s101.20x
🐘 PostgresNext.js (Turbopack)0.218s1.002s0.001s1.014s0.796s101.30x
🐘 PostgresNitro0.241s (+0.8%)0.993s (~)0.002s (+7.1% 🔺)1.013s (~)0.772s101.43x
🌐 MongoDBNext.js (Turbopack)0.493s0.960s0.001s1.009s0.516s102.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.656s (-4.3%)2.778s (-7.0% 🟢)0.004s (-29.5% 🟢)3.267s (-9.1% 🟢)1.611s101.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.555s1.000s0.003s1.011s0.456s601.00x
🐘 PostgresExpress0.616s (-11.2% 🟢)1.022s (+1.8%)0.003s (-18.6% 🟢)1.042s (+1.4%)0.425s591.11x
💻 LocalNext.js (Turbopack)0.669s1.008s0.010s1.024s0.355s591.20x
💻 LocalNitro0.722s (-0.7%)1.009s (~)0.010s (+3.3%)1.023s (~)0.301s591.30x
💻 LocalExpress0.731s (-5.9% 🟢)1.009s (-1.7%)0.010s (-2.2%)1.023s (-1.8%)0.292s591.32x
🐘 PostgresNitro0.733s (+1.5%)1.021s (+1.6%)0.004s (+11.7% 🔺)1.044s (+1.8%)0.311s591.32x
🐘 PostgresNext.js (Turbopack)0.751s1.010s0.004s1.027s0.276s591.35x
🌐 MongoDBNext.js (Turbopack)1.329s1.950s0.003s2.013s0.685s302.39x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.008s (+10.1% 🔺)5.891s (+1.8%)0.481s (+140.2% 🔺)6.857s (+5.0% 🔺)1.849s91.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.802s1.000s0.000s1.005s0.203s601.00x
🐘 PostgresExpress0.814s (-8.9% 🟢)1.043s (-3.7%)0.000s (+89.7% 🔺)1.071s (-3.1%)0.257s581.02x
🐘 PostgresNitro0.933s (+1.3%)1.150s (+8.3% 🔺)0.000s (+64.7% 🔺)1.180s (+9.2% 🔺)0.247s511.16x
🐘 PostgresNext.js (Turbopack)0.985s1.177s0.000s1.188s0.203s511.23x
💻 LocalNitro1.236s (+0.9%)2.020s (~)0.000s (-23.1% 🟢)2.023s (~)0.786s301.54x
💻 LocalNext.js (Turbopack)1.237s2.018s0.000s2.022s0.785s301.54x
💻 LocalExpress1.239s (-1.5%)2.020s (~)0.000s (-35.3% 🟢)2.023s (~)0.783s301.55x
🌐 MongoDBNext.js (Turbopack)2.360s2.946s0.000s3.008s0.648s202.94x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.692s (+26.0% 🔺)4.603s (+15.4% 🔺)0.000s (-41.7% 🟢)5.065s (+10.4% 🔺)1.373s121.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.529s2.034s0.000s2.040s0.510s301.00x
🐘 PostgresExpress1.686s (-6.6% 🟢)2.104s (~)0.000s (NaN%)2.133s (+0.5%)0.447s291.10x
🐘 PostgresNitro1.858s (-1.7%)2.098s (-5.5% 🟢)0.000s (-6.9% 🟢)2.117s (-5.5% 🟢)0.258s291.22x
🐘 PostgresNext.js (Turbopack)2.000s2.349s0.000s2.360s0.360s261.31x
💻 LocalNitro3.382s (+1.6%)4.033s (+1.6%)0.000s (-14.7% 🟢)4.037s (+1.6%)0.655s152.21x
💻 LocalNext.js (Turbopack)3.482s4.030s0.001s4.036s0.554s152.28x
💻 LocalExpress3.498s (+1.6%)4.098s (~)0.001s (+75.0% 🔺)4.102s (~)0.604s152.29x
🌐 MongoDBNext.js (Turbopack)4.395s4.976s0.000s5.011s0.616s122.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.869s (-11.4% 🟢)4.515s (-16.3% 🟢)0.000s (-100.0% 🟢)5.038s (-15.5% 🟢)1.169s131.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)18/21
🐘 PostgresExpress21/21
▲ VercelNext.js (Turbopack)21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres20/21
Next.js (Turbopack)🌐 Redis10/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production779167847
✅ 💻 Local Development7820142924
✅ 📦 Local Production7820142924
✅ 🐘 Local Postgres7270120847
✅ 🪟 Windows720577
❌ 🌍 Community Worlds1225821201
✅ 📋 Other198033231
Total3462595304051

❌ Failed Tests

▲ Vercel Production (1 failed)

example (1 failed):

🌍 Community Worlds (58 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

turso (53 failed):

  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KM6EQMFSSRJS76FW2VKYFC6X
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KM6EPGB5MHJ8YKVRWV2GKBEZ
  • promiseRaceWorkflow | wrun_01KM6EPKKCXKBHS77F1SN43AMM
  • promiseAnyWorkflow | wrun_01KM6EPNQB22J6R6YRY6NM84FM
  • importedStepOnlyWorkflow | wrun_01KM6ER2CBE39PF8CGSM5VP0JD
  • hookWorkflow | wrun_01KM6EQ25HJT2YYHAAJ3XADSAM
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • sleepingWorkflow | wrun_01KM6EQWAX2WSGW45X18BZM48A
  • parallelSleepWorkflow | wrun_01KM6ER8X111T19990VHTDFHXS
  • nullByteWorkflow | wrun_01KM6EREKA8MP390A0MWFDPKXY
  • workflowAndStepMetadataWorkflow | wrun_01KM6ERGYD1SHFWFEJBT7G0GT5
  • fetchWorkflow | wrun_01KM6ETBHPJ888CCD6008X0900
  • promiseRaceStressTestWorkflow | wrun_01KM6ETEZ9YDMFT5D1SWPJ6F4B
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KM6EXEX6EBHWZPDYABKM366M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KM6EYQZ9Q9GVYM8CVTMW9YEX
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KM6EZBGY895Q2T0QB7R3CWYR
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KM6EZMBHD3WX0SF21M07MJXY
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KM6EZV14JAWSMACBS0M0N4D1
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KM6EZX6CXS0CFYSDT2BWRHQ7
  • startFromWorkflow - calling start() directly inside a workflow function with hook communication
  • fibonacciWorkflow - recursive workflow composition via start()
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KM6F0CERY0X2RQKHYVV0M8CN
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KM6F0J8FCDZQ68EA8PWB8GJF
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KM6F0RZ6RFJP7415J3S6BTNR
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KM6F10P79TYKACWGFVXHKPEE
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KM6F178G30Z4VDETWFV53JPJ
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KM6F1DVYE9TNCTP39V71912Q
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KM6F1PTC83D0SYRWJA2XTXTP
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KM6F21X21AEBYXFSBTS5V6M7
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KM6F2A1JP11Z8KGDAWNB2GK3
  • cancelRun - cancelling a running workflow | wrun_01KM6F2GTPDS6HKWM3X5YQF41H
  • cancelRun via CLI - cancelling a running workflow | wrun_01KM6F2T3Z4YFC0NXTB3JXJQZ9
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01KM6F375GH61TFF6G0YZSM0KA
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KM6F3V6D7PN667T48JCEY8E7
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KM6F45ZYNS8T1RP0HNEJNGZ7

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro7007
❌ example6917
✅ express7007
✅ fastify7007
✅ hono7007
✅ nextjs-turbopack7502
✅ nextjs-webpack7502
✅ nitro7007
✅ nuxt7007
✅ sveltekit7007
✅ vite7007
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7205
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5435
✅ redis-dev302
❌ redis5525
✅ turso-dev302
❌ turso4535
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable66011
✅ e2e-local-postgres-nest-stable66011
✅ e2e-local-prod-nest-stable66011

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: failure
  • Windows: success

Check the workflow run for details.

VaguelySeriousand others added 2 commits March 19, 2026 19:17
Negative startIndex values (e.g. -3) resolve to n chunks before the
known end of the stream. All world implementations (local, postgres,
vercel) support this. Includes unit tests, e2e test, and doc updates.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threadpackages/world-vercel/src/utils.ts Outdated
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is a clean, well-tested feature. The implementation is consistent across worlds and the clamping behavior is solid. A few comments inline — the main concern is the docs could better call out the live-stream caveat, and the skill file could mention negative startIndex.

```

The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received.
The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received. Negative values are also supported (e.g. `-5` starts 5 chunks before the end), which is useful for showing the most recent output without replaying the full stream.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence mentions negative values as useful for "showing the most recent output without replaying the full stream" — but in the context of WorkflowChatTransport, the transport itself never uses negative startIndex (it tracks chunkIndex incrementally). The mention here might confuse readers into thinking the transport automatically leverages this.

Consider clarifying that this is useful for custom stream consumption (e.g., a dashboard showing recent output), not something WorkflowChatTransport does internally.


This allows clients to reconnect and continue receiving data from where they left off, rather than restarting from the beginning.

`startIndex` also supports **negative values** to read relative to the end of the stream. For example, `startIndex: -5` starts 5 chunks before the current end. This is useful when you want to show the most recent output without reading the entire stream history:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting that on a live (not-yet-closed) stream, the negative startIndex resolves at connection time — so -5 means "5 before the current end at the time of connecting", and any chunks written afterward will still be delivered. This is an important subtlety the e2e test handles (via waitForCompletion: true) but the docs do not mention.

A short note like: "On an active stream, the index resolves relative to the chunk count at connection time; subsequent chunks are still delivered." would prevent misunderstanding.

Comment threadpackages/world-local/src/streamer.ts Outdated
// Resolve negative startIndex relative to the number of data chunks
// (excluding the trailing EOF marker chunk, if present).
let dataChunkCount = chunkFiles.length;
if (startIndex < 0 && chunkFiles.length > 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: startIndex is typed as number | undefined (from the startIndex?: number parameter). The startIndex < 0 check works because undefined < 0 is false in JS, but it reads a bit fragile. Consider an explicit typeof startIndex === 'number' && startIndex < 0 guard to match the style used in world-vercel/src/streamer.ts:127.

if (startIndex < 0 && chunkFiles.length > 0) {
const lastFile = chunkFiles[chunkFiles.length - 1];
const lastExt = fileExtMap.get(lastFile) ?? '.bin';
const lastChunk = deserializeChunk(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads and deserializes the last chunk file just to check eof. On the hot path for a stream with many chunks, this is an extra disk read every time a reader connects with a negative startIndex. Not blocking, but worth a comment noting the cost, or consider whether the EOF state could be tracked more cheaply (e.g., checking for a sentinel file).


// Resolve negative offset relative to the data chunk count
// (excluding the trailing EOF marker, if present)
if (offset < 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nit as the local streamer: offset starts as startIndex ?? 0, so it can never be undefined here — but an explicit typeof guard would make the intent clearer at a glance.

{/* @skip-typecheck: incomplete code sample */}
```typescript
// Read only the last 10 chunks
const stream = run.getReadable({ startIndex: -10 });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add some note/callout to be careful about paginating on this. Because streams are live and will continue enqueueing chunks, relative numbers will map to different absolute chunk "IDs" on subsequent calls. I think accurate pagination is only possible when cursor based, and streams don't support cursor based pagination yet so clients should account for that limitation

@VaguelySeriousVaguelySeriousMar 20, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a problem when using run.getReadable directly, but it is a big problem for resumption, i.e. WorkflowChatTransport. I'm working on this in a follow-up PR together with a metadata/tail endpoint, and cursor-based pagination. I'll add a comment in this PR to mention the limitation

// and 2 chunks to the "test" named stream:
// chunk 0: binary "Hello, named stream!"
// chunk 1: object { foo: 'bar' }
describe.skipIf(isLocalDeployment())('outputStreamWorkflow', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we skipping this test in local deployment? 🤔 this might be outdated and we should probably re-enable streaming tests in local deployments

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already being done so this PR isn't changing it. I might try re-enabling in the next PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah just fly by noticed this

// Negative startIndex resolves at connection time using knownChunkCount,
// so the stream must be fully written before connecting the reader.
waitForCompletion: true,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The e2e coverage for negative startIndex only tests -1 (last chunk). The unit tests in world-local/src/streamer.test.ts are more thorough (covering -2 and clamping with -100), but consider adding a clamping case to this data-driven loop too — e.g., startIndex: -100 expecting all chunks — so the full resolution path is exercised end-to-end across all worlds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add a broader test in the next PR

- Clarify that negative startIndex is for custom consumers, not WorkflowChatTransport
- Add live-stream caveat for negative startIndex resolution timing
- Add pagination limitation callout for live streams
- Use explicit typeof guards for negative startIndex checks (world-local, world-postgres)
- Add cost comment for EOF marker disk read in world-local
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threaddocs/content/docs/ai/resumable-streams.mdx Outdated
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@ghostghost mentioned this pull request Mar 20, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

[core] Support negative startIndex for streaming - #1460

Merged
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start
Mar 20, 2026
Merged

[core] Support negative startIndex for streaming#1460
VaguelySerious merged 12 commits into
mainfrom
peter/negative-start

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Negative startIndex values (e.g. -3) resolve to n chunks before the known end of the stream. All world implementations (local, postgres, vercel) support this. Includes unit tests, e2e test, and doc updates.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7a2ee25

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
NameType
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
@workflow/corePatch
@workflow/cliPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/world-testingPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.043s (-4.9%)1.005s (~)0.962s101.00x
💻 LocalNitro0.043s (-8.4% 🟢)1.005s (~)0.962s101.02x
🐘 PostgresExpress0.048s (-32.2% 🟢)1.011s (-0.6%)0.963s101.13x
💻 LocalNext.js (Turbopack)0.050s1.005s0.955s101.18x
🌐 RedisNext.js (Turbopack)0.055s1.005s0.949s101.30x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.953s101.38x
🐘 PostgresNitro0.063s (-8.8% 🟢)1.013s (~)0.949s101.48x
🌐 MongoDBNext.js (Turbopack)0.114s1.008s0.893s102.68x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.464s (-35.6% 🟢)2.116s (-18.2% 🟢)1.651s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.114s (-2.2%)2.012s (~)0.898s101.00x
💻 LocalNext.js (Turbopack)1.119s2.005s0.886s101.00x
🌐 RedisNext.js (Turbopack)1.125s2.006s0.882s101.01x
💻 LocalExpress1.126s (~)2.006s (~)0.880s101.01x
💻 LocalNitro1.134s (~)2.005s (~)0.871s101.02x
🐘 PostgresNext.js (Turbopack)1.147s2.012s0.865s101.03x
🐘 PostgresNitro1.152s (+0.8%)2.014s (~)0.862s101.03x
🌐 MongoDBNext.js (Turbopack)1.310s2.009s0.698s101.18x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.083s (-10.3% 🟢)3.346s (-12.2% 🟢)1.263s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.739s (-1.5%)11.043s (~)0.304s31.00x
🌐 RedisNext.js (Turbopack)10.778s11.023s0.245s31.00x
💻 LocalNext.js (Turbopack)10.804s11.023s0.219s31.01x
🐘 PostgresNext.js (Turbopack)10.905s11.042s0.137s31.02x
💻 LocalNitro10.910s (~)11.023s (~)0.113s31.02x
💻 LocalExpress10.914s (~)11.023s (~)0.108s31.02x
🐘 PostgresNitro11.001s (~)11.046s (~)0.046s31.02x
🌐 MongoDBNext.js (Turbopack)12.213s13.016s0.803s31.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)17.063s (-3.9%)18.514s (-6.5% 🟢)1.451s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express14.176s (-2.7%)15.041s (~)0.865s41.00x
🌐 RedisNext.js (Turbopack)14.263s15.030s0.766s41.01x
🐘 PostgresNext.js (Turbopack)14.531s15.044s0.513s41.03x
💻 LocalNext.js (Turbopack)14.559s15.030s0.471s41.03x
🐘 PostgresNitro14.800s (~)15.044s (~)0.243s41.04x
💻 LocalNitro14.895s (~)15.029s (~)0.133s41.05x
💻 LocalExpress14.928s (~)15.027s (-3.2%)0.099s41.05x
🌐 MongoDBNext.js (Turbopack)17.872s18.026s0.154s41.26x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.853s (+1.2%)34.473s (-0.6%)1.620s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.190s (-5.9% 🟢)14.038s (-3.0%)0.847s71.00x
🌐 RedisNext.js (Turbopack)13.302s14.026s0.723s71.01x
🐘 PostgresNext.js (Turbopack)14.132s14.613s0.481s71.07x
🐘 PostgresNitro14.413s (~)15.041s (~)0.628s61.09x
💻 LocalNext.js (Turbopack)15.756s16.029s0.273s61.19x
💻 LocalExpress16.483s (-1.2%)17.031s (~)0.548s61.25x
💻 LocalNitro16.489s (~)17.029s (~)0.539s61.25x
🌐 MongoDBNext.js (Turbopack)20.399s21.025s0.625s51.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)56.806s (-9.5% 🟢)57.958s (-10.1% 🟢)1.153s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-4.3%)2.011s (~)0.800s151.00x
🐘 PostgresNext.js (Turbopack)1.266s2.013s0.746s151.05x
🐘 PostgresNitro1.281s (-0.9%)2.011s (~)0.730s151.06x
🌐 RedisNext.js (Turbopack)1.300s2.006s0.706s151.07x
💻 LocalNext.js (Turbopack)1.489s2.005s0.516s151.23x
💻 LocalNitro1.509s (+1.7%)2.006s (~)0.497s151.25x
💻 LocalExpress1.520s (+0.9%)2.006s (~)0.486s151.25x
🌐 MongoDBNext.js (Turbopack)2.156s3.008s0.852s101.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.664s (+6.9% 🔺)3.854s (-1.2%)1.189s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.366s (-3.8%)3.012s (~)0.646s101.00x
🐘 PostgresNitro2.459s (~)3.013s (~)0.553s101.04x
🐘 PostgresNext.js (Turbopack)2.515s3.012s0.497s101.06x
🌐 RedisNext.js (Turbopack)2.523s3.008s0.485s101.07x
💻 LocalNext.js (Turbopack)2.655s3.007s0.353s101.12x
💻 LocalNitro2.909s (+1.3%)3.107s (~)0.198s101.23x
💻 LocalExpress2.929s (-2.3%)3.308s (-7.2% 🟢)0.379s101.24x
🌐 MongoDBNext.js (Turbopack)4.824s5.345s0.521s62.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.892s (+10.0% 🔺)4.180s (+3.8%)1.287s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.522s (-1.9%)4.014s (~)0.492s81.00x
🐘 PostgresNitro3.609s (-0.6%)4.014s (~)0.405s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.014s0.246s81.07x
🌐 RedisNext.js (Turbopack)4.125s5.012s0.887s61.17x
💻 LocalNext.js (Turbopack)7.055s7.767s0.712s42.00x
💻 LocalNitro8.305s (+2.2%)8.770s (~)0.465s42.36x
💻 LocalExpress8.379s (-1.1%)9.020s (~)0.641s42.38x
🌐 MongoDBNext.js (Turbopack)10.095s10.680s0.585s32.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.478s (+3.7%)4.771s (-4.8%)1.293s71.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.202s (-4.6%)2.010s (~)0.809s151.00x
🐘 PostgresNext.js (Turbopack)1.253s2.011s0.758s151.04x
🐘 PostgresNitro1.273s (~)2.011s (~)0.738s151.06x
🌐 RedisNext.js (Turbopack)1.319s2.006s0.688s151.10x
💻 LocalNext.js (Turbopack)1.529s2.006s0.477s151.27x
💻 LocalNitro1.540s (-1.3%)2.005s (~)0.465s151.28x
💻 LocalExpress1.547s (+0.7%)2.005s (~)0.458s151.29x
🌐 MongoDBNext.js (Turbopack)2.181s3.008s0.827s101.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.572s (-1.1%)3.643s (-9.2% 🟢)1.070s101.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.341s (-4.5%)3.012s (~)0.671s101.00x
🐘 PostgresNitro2.454s (~)3.013s (~)0.559s101.05x
🐘 PostgresNext.js (Turbopack)2.470s3.011s0.541s101.06x
🌐 RedisNext.js (Turbopack)2.569s3.008s0.439s101.10x
💻 LocalNext.js (Turbopack)2.818s3.109s0.291s101.20x
💻 LocalNitro2.963s (-2.1%)3.676s (~)0.713s91.27x
💻 LocalExpress2.990s (-1.4%)3.676s (-2.2%)0.686s91.28x
🌐 MongoDBNext.js (Turbopack)4.746s5.178s0.432s62.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.766s (+16.2% 🔺)3.783s (+3.3%)1.017s81.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.517s (-2.3%)4.013s (~)0.496s81.00x
🐘 PostgresNitro3.651s (+1.0%)4.015s (~)0.363s81.04x
🐘 PostgresNext.js (Turbopack)3.735s4.014s0.279s81.06x
🌐 RedisNext.js (Turbopack)4.147s4.726s0.579s71.18x
💻 LocalNext.js (Turbopack)8.126s8.773s0.647s42.31x
💻 LocalNitro8.728s (+1.0%)9.019s (~)0.291s42.48x
💻 LocalExpress8.804s (-2.8%)9.025s (-7.7% 🟢)0.220s42.50x
🌐 MongoDBNext.js (Turbopack)9.951s10.684s0.732s32.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.848s (-1.8%)5.484s (~)1.636s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.652s (-24.7% 🟢)1.009s (-1.7%)0.357s601.00x
🌐 RedisNext.js (Turbopack)0.687s1.004s0.318s601.05x
🐘 PostgresNext.js (Turbopack)0.835s1.026s0.191s591.28x
💻 LocalNext.js (Turbopack)0.850s1.004s0.154s601.30x
🐘 PostgresNitro0.873s (-2.6%)1.009s (-3.3%)0.136s601.34x
💻 LocalNitro0.980s (+2.6%)1.136s (+11.3% 🔺)0.156s531.50x
💻 LocalExpress0.980s (~)1.158s (+5.7% 🔺)0.178s521.50x
🌐 MongoDBNext.js (Turbopack)2.158s3.008s0.851s203.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)10.623s (+1.2%)11.948s (-3.1%)1.325s61.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.572s (-25.7% 🟢)2.010s (-33.3% 🟢)0.438s451.00x
🌐 RedisNext.js (Turbopack)1.678s2.006s0.328s451.07x
🐘 PostgresNext.js (Turbopack)2.027s2.511s0.484s361.29x
🐘 PostgresNitro2.148s (-0.6%)3.012s (+1.1%)0.864s301.37x
💻 LocalNext.js (Turbopack)2.666s3.007s0.341s301.70x
💻 LocalNitro2.974s (+0.6%)3.330s (+7.0% 🔺)0.355s281.89x
💻 LocalExpress2.987s (-0.9%)3.329s (-6.1% 🟢)0.342s281.90x
🌐 MongoDBNext.js (Turbopack)5.273s6.011s0.739s153.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)32.443s (-0.6%)33.373s (-2.3%)0.929s31.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.263s (-23.5% 🟢)4.013s (-19.3% 🟢)0.750s301.00x
🌐 RedisNext.js (Turbopack)3.293s4.008s0.716s301.01x
🐘 PostgresNext.js (Turbopack)4.106s4.975s0.868s251.26x
🐘 PostgresNitro4.367s (+0.7%)5.015s (~)0.648s241.34x
💻 LocalNext.js (Turbopack)8.417s9.016s0.599s142.58x
💻 LocalNitro8.989s (~)9.479s (~)0.490s132.75x
💻 LocalExpress9.106s (~)9.710s (-0.8%)0.604s132.79x
🌐 MongoDBNext.js (Turbopack)10.535s11.019s0.484s113.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)89.160s (-8.5% 🟢)90.435s (-9.0% 🟢)1.274s21.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.243s (-19.5% 🟢)1.009s (~)0.766s601.00x
🐘 PostgresNext.js (Turbopack)0.265s1.009s0.744s601.09x
🐘 PostgresNitro0.298s (+1.1%)1.009s (~)0.711s601.22x
🌐 RedisNext.js (Turbopack)0.401s1.021s0.620s591.65x
💻 LocalNext.js (Turbopack)0.558s1.021s0.464s592.29x
💻 LocalNitro0.589s (-1.5%)1.004s (~)0.416s602.42x
💻 LocalExpress0.606s (+0.5%)1.004s (~)0.398s602.49x
🌐 MongoDBNext.js (Turbopack)1.655s2.149s0.494s286.81x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.914s (+0.7%)3.311s (-7.5% 🟢)1.397s191.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.419s (-20.5% 🟢)1.009s (~)0.590s901.00x
🐘 PostgresNitro0.540s (~)1.009s (~)0.469s901.29x
🐘 PostgresNext.js (Turbopack)0.569s1.021s0.451s891.36x
🌐 RedisNext.js (Turbopack)1.171s2.006s0.835s452.79x
💻 LocalNext.js (Turbopack)2.377s3.008s0.632s305.67x
💻 LocalNitro2.495s (+0.8%)3.008s (~)0.513s305.95x
💻 LocalExpress2.545s (-1.4%)3.009s (~)0.464s306.07x
🌐 MongoDBNext.js (Turbopack)4.756s5.287s0.532s1811.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.221s (-6.3% 🟢)4.527s (-5.8% 🟢)1.306s211.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.605s (-32.6% 🟢)1.009s (-3.1%)0.404s1191.00x
🐘 PostgresNitro0.919s (-2.1%)1.216s (+2.0%)0.297s991.52x
🐘 PostgresNext.js (Turbopack)0.964s1.345s0.381s901.59x
🌐 RedisNext.js (Turbopack)2.741s3.007s0.267s404.53x
🌐 MongoDBNext.js (Turbopack)9.862s10.432s0.570s1216.29x
💻 LocalNext.js (Turbopack)10.107s10.606s0.499s1216.70x
💻 LocalNitro10.955s (-1.4%)11.571s (-0.8%)0.616s1118.10x
💻 LocalExpress11.174s (-1.0%)11.846s (-1.5%)0.671s1118.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)6.960s (-11.2% 🟢)8.087s (-13.7% 🟢)1.127s151.00x
▲ VercelExpress⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.168s (-22.4% 🟢)0.996s (~)0.001s (+16.7% 🔺)1.012s (~)0.844s101.00x
🌐 RedisNext.js (Turbopack)0.178s1.000s0.002s1.007s0.829s101.06x
💻 LocalNext.js (Turbopack)0.185s1.002s0.010s1.016s0.831s101.10x
💻 LocalNitro0.198s (+0.7%)1.003s (~)0.011s (-5.9% 🟢)1.017s (~)0.819s101.18x
💻 LocalExpress0.201s (-1.7%)1.003s (~)0.012s (-2.5%)1.017s (~)0.816s101.20x
🐘 PostgresNext.js (Turbopack)0.218s1.002s0.001s1.014s0.796s101.30x
🐘 PostgresNitro0.241s (+0.8%)0.993s (~)0.002s (+7.1% 🔺)1.013s (~)0.772s101.43x
🌐 MongoDBNext.js (Turbopack)0.493s0.960s0.001s1.009s0.516s102.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.656s (-4.3%)2.778s (-7.0% 🟢)0.004s (-29.5% 🟢)3.267s (-9.1% 🟢)1.611s101.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.555s1.000s0.003s1.011s0.456s601.00x
🐘 PostgresExpress0.616s (-11.2% 🟢)1.022s (+1.8%)0.003s (-18.6% 🟢)1.042s (+1.4%)0.425s591.11x
💻 LocalNext.js (Turbopack)0.669s1.008s0.010s1.024s0.355s591.20x
💻 LocalNitro0.722s (-0.7%)1.009s (~)0.010s (+3.3%)1.023s (~)0.301s591.30x
💻 LocalExpress0.731s (-5.9% 🟢)1.009s (-1.7%)0.010s (-2.2%)1.023s (-1.8%)0.292s591.32x
🐘 PostgresNitro0.733s (+1.5%)1.021s (+1.6%)0.004s (+11.7% 🔺)1.044s (+1.8%)0.311s591.32x
🐘 PostgresNext.js (Turbopack)0.751s1.010s0.004s1.027s0.276s591.35x
🌐 MongoDBNext.js (Turbopack)1.329s1.950s0.003s2.013s0.685s302.39x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.008s (+10.1% 🔺)5.891s (+1.8%)0.481s (+140.2% 🔺)6.857s (+5.0% 🔺)1.849s91.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.802s1.000s0.000s1.005s0.203s601.00x
🐘 PostgresExpress0.814s (-8.9% 🟢)1.043s (-3.7%)0.000s (+89.7% 🔺)1.071s (-3.1%)0.257s581.02x
🐘 PostgresNitro0.933s (+1.3%)1.150s (+8.3% 🔺)0.000s (+64.7% 🔺)1.180s (+9.2% 🔺)0.247s511.16x
🐘 PostgresNext.js (Turbopack)0.985s1.177s0.000s1.188s0.203s511.23x
💻 LocalNitro1.236s (+0.9%)2.020s (~)0.000s (-23.1% 🟢)2.023s (~)0.786s301.54x
💻 LocalNext.js (Turbopack)1.237s2.018s0.000s2.022s0.785s301.54x
💻 LocalExpress1.239s (-1.5%)2.020s (~)0.000s (-35.3% 🟢)2.023s (~)0.783s301.55x
🌐 MongoDBNext.js (Turbopack)2.360s2.946s0.000s3.008s0.648s202.94x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.692s (+26.0% 🔺)4.603s (+15.4% 🔺)0.000s (-41.7% 🟢)5.065s (+10.4% 🔺)1.373s121.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.529s2.034s0.000s2.040s0.510s301.00x
🐘 PostgresExpress1.686s (-6.6% 🟢)2.104s (~)0.000s (NaN%)2.133s (+0.5%)0.447s291.10x
🐘 PostgresNitro1.858s (-1.7%)2.098s (-5.5% 🟢)0.000s (-6.9% 🟢)2.117s (-5.5% 🟢)0.258s291.22x
🐘 PostgresNext.js (Turbopack)2.000s2.349s0.000s2.360s0.360s261.31x
💻 LocalNitro3.382s (+1.6%)4.033s (+1.6%)0.000s (-14.7% 🟢)4.037s (+1.6%)0.655s152.21x
💻 LocalNext.js (Turbopack)3.482s4.030s0.001s4.036s0.554s152.28x
💻 LocalExpress3.498s (+1.6%)4.098s (~)0.001s (+75.0% 🔺)4.102s (~)0.604s152.29x
🌐 MongoDBNext.js (Turbopack)4.395s4.976s0.000s5.011s0.616s122.87x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.869s (-11.4% 🟢)4.515s (-16.3% 🟢)0.000s (-100.0% 🟢)5.038s (-15.5% 🟢)1.169s131.00x
▲ VercelExpress⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)18/21
🐘 PostgresExpress21/21
▲ VercelNext.js (Turbopack)21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres20/21
Next.js (Turbopack)🌐 Redis10/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@github-actions

github-actionsBot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production779167847
✅ 💻 Local Development7820142924
✅ 📦 Local Production7820142924
✅ 🐘 Local Postgres7270120847
✅ 🪟 Windows720577
❌ 🌍 Community Worlds1225821201
✅ 📋 Other198033231
Total3462595304051

❌ Failed Tests

▲ Vercel Production (1 failed)

example (1 failed):

🌍 Community Worlds (58 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0

turso (53 failed):

  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • addTenWorkflow | wrun_01KM6EP9PA2VF8D6C8FZPX1DPV
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KM6EQMFSSRJS76FW2VKYFC6X
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KM6EPGB5MHJ8YKVRWV2GKBEZ
  • promiseRaceWorkflow | wrun_01KM6EPKKCXKBHS77F1SN43AMM
  • promiseAnyWorkflow | wrun_01KM6EPNQB22J6R6YRY6NM84FM
  • importedStepOnlyWorkflow | wrun_01KM6ER2CBE39PF8CGSM5VP0JD
  • hookWorkflow | wrun_01KM6EQ25HJT2YYHAAJ3XADSAM
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM6EQCWA8FH8NNSY7ZGA1KTY
  • webhookWorkflow | wrun_01KM6EQNFETZMV0R06RZ9WS59M
  • sleepingWorkflow | wrun_01KM6EQWAX2WSGW45X18BZM48A
  • parallelSleepWorkflow | wrun_01KM6ER8X111T19990VHTDFHXS
  • nullByteWorkflow | wrun_01KM6EREKA8MP390A0MWFDPKXY
  • workflowAndStepMetadataWorkflow | wrun_01KM6ERGYD1SHFWFEJBT7G0GT5
  • fetchWorkflow | wrun_01KM6ETBHPJ888CCD6008X0900
  • promiseRaceStressTestWorkflow | wrun_01KM6ETEZ9YDMFT5D1SWPJ6F4B
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KM6EXEX6EBHWZPDYABKM366M
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM6EY2570DGB3VDP62VET1W0
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KM6EYQZ9Q9GVYM8CVTMW9YEX
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KM6EZBGY895Q2T0QB7R3CWYR
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KM6EZMBHD3WX0SF21M07MJXY
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KM6EZV14JAWSMACBS0M0N4D1
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KM6EZX6CXS0CFYSDT2BWRHQ7
  • startFromWorkflow - calling start() directly inside a workflow function with hook communication
  • fibonacciWorkflow - recursive workflow composition via start()
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KM6F0CERY0X2RQKHYVV0M8CN
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KM6F0J8FCDZQ68EA8PWB8GJF
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KM6F0RZ6RFJP7415J3S6BTNR
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KM6F10P79TYKACWGFVXHKPEE
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KM6F178G30Z4VDETWFV53JPJ
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KM6F1DVYE9TNCTP39V71912Q
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KM6F1PTC83D0SYRWJA2XTXTP
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KM6F21X21AEBYXFSBTS5V6M7
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KM6F2A1JP11Z8KGDAWNB2GK3
  • cancelRun - cancelling a running workflow | wrun_01KM6F2GTPDS6HKWM3X5YQF41H
  • cancelRun via CLI - cancelling a running workflow | wrun_01KM6F2T3Z4YFC0NXTB3JXJQZ9
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01KM6F375GH61TFF6G0YZSM0KA
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KM6F3V6D7PN667T48JCEY8E7
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KM6F45ZYNS8T1RP0HNEJNGZ7

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro7007
❌ example6917
✅ express7007
✅ fastify7007
✅ hono7007
✅ nextjs-turbopack7502
✅ nextjs-webpack7502
✅ nitro7007
✅ nuxt7007
✅ sveltekit7007
✅ vite7007
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-canary55022
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable66011
✅ express-stable66011
✅ fastify-stable66011
✅ hono-stable66011
✅ nextjs-turbopack-stable7205
✅ nextjs-webpack-canary55022
✅ nextjs-webpack-stable7205
✅ nitro-stable66011
✅ nuxt-stable66011
✅ sveltekit-stable66011
✅ vite-stable66011
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7205
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5435
✅ redis-dev302
❌ redis5525
✅ turso-dev302
❌ turso4535
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable66011
✅ e2e-local-postgres-nest-stable66011
✅ e2e-local-prod-nest-stable66011

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: failure
  • Windows: success

Check the workflow run for details.

VaguelySeriousand others added 2 commits March 19, 2026 19:17
Negative startIndex values (e.g. -3) resolve to n chunks before the
known end of the stream. All world implementations (local, postgres,
vercel) support this. Includes unit tests, e2e test, and doc updates.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threadpackages/world-vercel/src/utils.ts Outdated
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is a clean, well-tested feature. The implementation is consistent across worlds and the clamping behavior is solid. A few comments inline — the main concern is the docs could better call out the live-stream caveat, and the skill file could mention negative startIndex.

```

The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received.
The `startIndex` parameter ensures the client can choose where to resume the stream from. For instance, if the function times out during streaming, the chat transport will use `startIndex` to resume the stream exactly from the last token it received. Negative values are also supported (e.g. `-5` starts 5 chunks before the end), which is useful for showing the most recent output without replaying the full stream.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence mentions negative values as useful for "showing the most recent output without replaying the full stream" — but in the context of WorkflowChatTransport, the transport itself never uses negative startIndex (it tracks chunkIndex incrementally). The mention here might confuse readers into thinking the transport automatically leverages this.

Consider clarifying that this is useful for custom stream consumption (e.g., a dashboard showing recent output), not something WorkflowChatTransport does internally.


This allows clients to reconnect and continue receiving data from where they left off, rather than restarting from the beginning.

`startIndex` also supports **negative values** to read relative to the end of the stream. For example, `startIndex: -5` starts 5 chunks before the current end. This is useful when you want to show the most recent output without reading the entire stream history:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting that on a live (not-yet-closed) stream, the negative startIndex resolves at connection time — so -5 means "5 before the current end at the time of connecting", and any chunks written afterward will still be delivered. This is an important subtlety the e2e test handles (via waitForCompletion: true) but the docs do not mention.

A short note like: "On an active stream, the index resolves relative to the chunk count at connection time; subsequent chunks are still delivered." would prevent misunderstanding.

Comment threadpackages/world-local/src/streamer.ts Outdated
// Resolve negative startIndex relative to the number of data chunks
// (excluding the trailing EOF marker chunk, if present).
let dataChunkCount = chunkFiles.length;
if (startIndex < 0 && chunkFiles.length > 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: startIndex is typed as number | undefined (from the startIndex?: number parameter). The startIndex < 0 check works because undefined < 0 is false in JS, but it reads a bit fragile. Consider an explicit typeof startIndex === 'number' && startIndex < 0 guard to match the style used in world-vercel/src/streamer.ts:127.

if (startIndex < 0 && chunkFiles.length > 0) {
const lastFile = chunkFiles[chunkFiles.length - 1];
const lastExt = fileExtMap.get(lastFile) ?? '.bin';
const lastChunk = deserializeChunk(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads and deserializes the last chunk file just to check eof. On the hot path for a stream with many chunks, this is an extra disk read every time a reader connects with a negative startIndex. Not blocking, but worth a comment noting the cost, or consider whether the EOF state could be tracked more cheaply (e.g., checking for a sentinel file).


// Resolve negative offset relative to the data chunk count
// (excluding the trailing EOF marker, if present)
if (offset < 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nit as the local streamer: offset starts as startIndex ?? 0, so it can never be undefined here — but an explicit typeof guard would make the intent clearer at a glance.

{/* @skip-typecheck: incomplete code sample */}
```typescript
// Read only the last 10 chunks
const stream = run.getReadable({ startIndex: -10 });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add some note/callout to be careful about paginating on this. Because streams are live and will continue enqueueing chunks, relative numbers will map to different absolute chunk "IDs" on subsequent calls. I think accurate pagination is only possible when cursor based, and streams don't support cursor based pagination yet so clients should account for that limitation

@VaguelySeriousVaguelySeriousMar 20, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a problem when using run.getReadable directly, but it is a big problem for resumption, i.e. WorkflowChatTransport. I'm working on this in a follow-up PR together with a metadata/tail endpoint, and cursor-based pagination. I'll add a comment in this PR to mention the limitation

// and 2 chunks to the "test" named stream:
// chunk 0: binary "Hello, named stream!"
// chunk 1: object { foo: 'bar' }
describe.skipIf(isLocalDeployment())('outputStreamWorkflow', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we skipping this test in local deployment? 🤔 this might be outdated and we should probably re-enable streaming tests in local deployments

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already being done so this PR isn't changing it. I might try re-enabling in the next PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah just fly by noticed this

// Negative startIndex resolves at connection time using knownChunkCount,
// so the stream must be fully written before connecting the reader.
waitForCompletion: true,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The e2e coverage for negative startIndex only tests -1 (last chunk). The unit tests in world-local/src/streamer.test.ts are more thorough (covering -2 and clamping with -100), but consider adding a clamping case to this data-driven loop too — e.g., startIndex: -100 expecting all chunks — so the full resolution path is exercised end-to-end across all worlds.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add a broader test in the next PR

- Clarify that negative startIndex is for custom consumers, not WorkflowChatTransport
- Add live-stream caveat for negative startIndex resolution timing
- Add pagination limitation callout for live streams
- Use explicit typeof guards for negative startIndex checks (world-local, world-postgres)
- Add cost comment for EOF marker disk read in world-local
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment threaddocs/content/docs/ai/resumable-streams.mdx Outdated
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@ghostghost mentioned this pull request Mar 20, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp