Fix JIT nil-param crash: guard execute-request, restore error logging

- orchestration.sx: add nil guard for verb/url before calling do-fetch
  (prevents "Expected string, got nil" when verb info dict lacks method)
- sx_browser.ml: restore JIT error logging (Eval_error only, not all
  exceptions) so real failures are visible, silence routine fallbacks
- Rebuild WASM bundle with fixes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 17:22:06 +00:00
parent f33eaf8f3a
commit 2802dd99e2
9 changed files with 1411 additions and 13 deletions

View File

@@ -582,9 +582,9 @@ let () =
(match l.l_compiled with
| Some cl when not (Sx_vm.is_jit_failed cl) ->
(try Some (Sx_vm.call_closure cl args cl.vm_env_ref)
with e ->
with Eval_error msg ->
let fn_name = match l.l_name with Some n -> n | None -> "?" in
Printf.eprintf "[jit] DISABLED %s — %s\n%!" fn_name (Printexc.to_string e);
Printf.eprintf "[jit] DISABLED %s — %s\n%!" fn_name msg;
l.l_compiled <- Some Sx_vm.jit_failed_sentinel;
None)
| Some _ -> None
@@ -595,18 +595,14 @@ let () =
let globals = env_to_vm_globals global_env in
let compiled = Sx_vm.jit_compile_lambda l globals in
_jit_compiling := false;
let fn_name = match l.l_name with Some n -> n | None -> "?" in
(match compiled with
| Some cl ->
l.l_compiled <- Some cl;
(try Some (Sx_vm.call_closure cl args cl.vm_env_ref)
with e ->
Printf.eprintf "[jit] DISABLED %s — %s\n%!" fn_name (Printexc.to_string e);
with _ ->
l.l_compiled <- Some Sx_vm.jit_failed_sentinel;
None)
| None ->
Printf.eprintf "[jit] FAIL %s\n%!" fn_name;
None)
| None -> None)
end)
| _ -> None)