fix: embed agent and workflow framework sources in compiled binary - #276
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes production 404s for framework modules when running as a compiled Deno binary by embedding additional framework source directories into dist/framework-src/, and adds an integration test to ensure those embedded modules are served correctly.
Changes:
- Add
agent/andworkflow/to the embedded framework source copy list inprepare-framework-sources.ts. - Add an integration e2e test that fetches several
_veryfront/*module URLs from the compiled binary to ensure they return 200. - Bump
deno.jsonversion from0.1.7-rc.50to0.1.7-rc.51.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
scripts/build/prepare-framework-sources.ts |
Embeds src/agent/ and src/workflow/ into dist/framework-src/ for compiled-binary module serving. |
tests/integration/vfs-proxy-mode-e2e.test.ts |
Adds a compiled-binary VFS/proxy-mode e2e test asserting key embedded framework modules return 200. |
deno.json |
Version bump to 0.1.7-rc.51. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Wait for server to be ready | ||
| const deadline = Date.now() + 30_000; | ||
| while (Date.now() < deadline) { | ||
| try { | ||
| const r = await fetch(`http://127.0.0.1:${server.port}/`); | ||
| await r.text(); | ||
| break; | ||
| } catch { await new Promise((r) => setTimeout(r, 500)); } | ||
| } |
There was a problem hiding this comment.
The server "readiness" loop breaks on the first successful fetch, but if the deadline is reached it falls through silently and the test continues. That makes failures harder to diagnose (you'll get connection errors or 404s later without a clear timeout message) and can introduce flakiness. Track whether the server became reachable and throw a descriptive error (ideally including recent server logs) when the timeout elapses, or reuse a shared waitForServer helper like the one in tests/integration/compiled-binary-e2e.test.ts.
FRAMEWORK_DIRS only included react/ and lib/, so client-side modules like veryfront/agent/react (useChat, useAgent) and veryfront/workflow/react (useWorkflow, useApproval) returned 404 in production compiled binaries. Add agent/ and workflow/ to the embedded framework sources list.
4a21140 to
20e2f35
Compare
) * chore: bump version to 0.1.7-rc.51 * fix: embed agent and workflow dirs in compiled binary (#275) FRAMEWORK_DIRS only included react/ and lib/, so client-side modules like veryfront/agent/react (useChat, useAgent) and veryfront/workflow/react (useWorkflow, useApproval) returned 404 in production compiled binaries. Add agent/ and workflow/ to the embedded framework sources list.
…dbox - teams/confluence template clients: strip HTML tags to a fixed point and decode & last, closing incomplete-multi-character-sanitization and double-escaping findings (alerts #276-#278) - push command: drop the dead pushedSourceDigest initializer — every path that reads it reassigns via computePushedSourceDigest, which revalidates remote content itself (alert #285) - worker-script: remove a null comparison already excluded by the early return at the top of snapshotStructuredData (alert #247) - execution-support test: call throwIfChildRunAborted directly instead of asserting the return value of a void function (alerts #279/#280)
Summary
agent/andworkflow/toFRAMEWORK_DIRSinprepare-framework-sources.tsProblem
FRAMEWORK_DIRSonly included["react", "lib"], so client-side modules likeveryfront/agent/react(useChat,useAgent) andveryfront/workflow/react(useWorkflow,useApproval) returned 404 "Module not found" in production compiled binaries.The embedded sources in
dist/framework-src/only containedreact/files. When the module server tried to resolve_veryfront/agent/react/index.js, it couldn't find it.Fixes #275
Test plan
agent/react/index.jsreturns 200 (was 404)workflow/react/index.jsreturns 200 (was 404)react/components/Head.jsstill returns 200should serve embedded framework modules from compiled binary