Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions docker/app/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e

MODE="${1:-server}"

echo "Starting Owletto backend (Node + tsx)"
echo "Starting Owletto backend (Bun)"
echo "================================"

echo "Environment:"
Expand Down Expand Up @@ -41,16 +41,15 @@ else
run_migrations
fi

# Run under Node so V8 native addons (isolated-vm) load.
# Bun uses JavaScriptCore and cannot link the V8 ABI surface that
# isolated-vm requires; the execute MCP tool silently degrades to
# RuntimeUnavailable under bun. tsx provides the TS loader so the
# source layout stays uncompiled.
#
# Keep cwd=/app — gateway services and embedded agent routes resolve
# bundled config (`config/providers.json`) relative to process.cwd().
# Use the absolute tsx loader path so the resolution doesn't depend
# on cwd or PATH.
exec node \
--import "file:///app/packages/owletto-backend/node_modules/tsx/dist/loader.mjs" \
/app/packages/owletto-backend/src/server.ts
# NOTE: prod runs under Bun. The execute MCP tool requires V8
# (isolated-vm), which Bun's JSC ABI shim cannot load. PR #430 attempted
# to switch the runtime to `node --import tsx`, but exposed a CJS/ESM
# interop gap: Node's cjs-module-lexer doesn't detect new named exports
# of @lobu/core's CJS dist when the static import follows certain
# reachability paths (e.g. the full server.ts boot chain hits
# `SyntaxError: ... does not provide an export named 'createBuiltinSecretRef'`,
# even though a same-imports test entry resolves fine). Reverted on the
# understanding that fixing properly means making @lobu/core (and other
# workspace packages) ship dual ESM+CJS output instead of CJS-only with
# an `import` condition. Tracked separately.
exec bun /app/packages/owletto-backend/src/server.ts
Loading