fix(nitro): Compile Junior content for serverless#513
Conversation
Load Junior app and plugin content from a private Nitro virtual module so Vercel functions no longer depend on copied app or package manifests at runtime. Keep filesystem-backed discovery for local and non-Nitro runtimes, and preserve includeFiles only for explicit dependency assets that the bundler cannot trace. Fixes #510 Co-Authored-By: GPT-5 Codex <codex@openai.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 44bd010. Configure here.
| export function readRuntimeFileSync(targetPath: string): string | null { | ||
| const compiled = compiledFileBuffer(targetPath); | ||
| if (compiled) { | ||
| return compiled.toString("utf8"); |
There was a problem hiding this comment.
Empty compiled files ignored
Medium Severity
Compiled entries present in the graph with an empty base64 payload decode to a zero-length Buffer, but read and existence helpers treat that buffer as falsy and fall back to the filesystem. On Nitro/serverless, those paths are not on disk, so empty bundled files behave as missing instead of empty.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 44bd010. Configure here.
|
|
||
| /** Create a Hono app with all Junior routes. */ | ||
| export async function createApp(options?: JuniorAppOptions): Promise<Hono> { | ||
| setRuntimeContent(await resolveVirtualContent()); |
There was a problem hiding this comment.
Failed createApp leaves stale content
Medium Severity
createApp hydrates compiled content before validation, but its error path only rolls back plugin catalog, agents, and config defaults—not runtime content. If the catalog rolls back to no packages, filterCompiledPluginPackageContent clears package plugins while the compiled graph still contains them, so bundled plugins vanish until process restart.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 44bd010. Configure here.


Compile Junior app and plugin content into a private Nitro virtual module so Vercel route and queue functions no longer depend on copied app/plugin files at runtime. Local and non-Nitro runtimes keep using filesystem-backed discovery.
Compiled Content Provider
createApp()hydrates#junior/contentbefore plugin validation, and app markdown, skills, manifests, sandbox sync, app-home, image prompt, and reporting reads go through the provider. The provider falls back to the filesystem when no virtual module is present.Package Boundary
Compiled package content is projected through the active plugin catalog so bundled-but-unselected packages do not become providers. Registry cache keys include the runtime content version, and app plugin symlinks are followed during graph compilation.
Vercel Output Guard
The example postbuild check validates the compiled graph in both primary and queue functions and fails if copied Junior app/plugin files reappear.
Fixes #510