mirror of
https://github.com/DeBrosOfficial/orama.git
synced 2026-06-16 22:54:12 +00:00
InstantiatePersistent passed WithStartFunctions() with no args, explicitly disabling both wasi entry points. The intent was to skip main(); the side effect was leaving the TinyGo runtime uninitialized. The first call to any export traps via wasmExportCheckRun and managed-memory ops panic. Every persistent WS function was effectively dead since plan #06 landed. Earlier patch in this thread restored the call but only handled wasi-reactor builds (_initialize). AnChat's rpc-router is a wasi command build (`_start` export only, no `_initialize`) — wasm-objdump confirms — so the reactor-only fix still left it broken. This fix tries `_initialize` first, falls back to `_start`, and bounds whichever runs with a 5s timeout so a buggy main() can't hang instantiation forever. Logs the chosen hook at Debug, warns when neither is exported. Still pass WithStartFunctions() (no args) so wazero doesn't auto-call `_start` during InstantiateModule — we want full control over which hook runs and the timeout that bounds it. VERSION bumped to 0.122.22.