Production OOM triage: every 'Worker exceeded memory limit' burst hits
unrelated cheap routes right after a deploy — the 128MB limit is per
isolate, and the main worker's eagerly-evaluated module graph is what
crowds it, not any single request.
- Alias just-bash to a throwing stub (worker never uses it): removes
just-bash + turndown + @mixmark-io/domino from the bundle. The chain
was pulled in eagerly by @cloudflare/think via the SamChatAgent
re-export in src/server.ts; SAM only uses its own MCP tools.
- Disable Think's workspace bash tool on SamChatAgent so the stub is
unreachable at runtime.
- Dynamic-import page-analyzer (cheerio) in the site-audit crawl step
so it evaluates only when an audit runs, not in every isolate.
- Drop the turndown CJS alias workaround (#339): turndown is no longer
in the graph at all.
Main eager server chunk: 14,434 kB -> 11,712 kB (-19%); cheerio's
503 kB now a lazy chunk.