Revert cek_run import patch — caused infinite CEK loop on server

The cek_run import handling (resume after hook loads library) caused
cek_step_loop to infinite-loop during aser page rendering. Root cause
not yet identified — the resumed CEK state never reaches terminal.

Reverted to original cek_run that throws "IO suspension in non-IO
context". The 4 server startup errors are harmless (files load
partially, all needed symbols available via other paths).

Import hook re-entry guard and debug logging retained for future work.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 00:59:45 +00:00
parent 107c1b8b97
commit 244c669334
2 changed files with 19 additions and 20 deletions

View File

@@ -488,20 +488,7 @@ and cek_step_loop state =
(* cek-run *)
and cek_run state =
(let rec run s =
let final = cek_step_loop s in
if sx_truthy (cek_suspended_p final) then begin
let request = cek_io_request final in
let op = match request with Dict d -> (match Hashtbl.find_opt d "op" with Some (String s) -> s | _ -> "") | _ -> "" in
if op = "import" then
let lib_spec = match request with Dict d -> (match Hashtbl.find_opt d "library" with Some v -> v | _ -> Nil) | _ -> Nil in
let resolved = sx_truthy (library_loaded_p lib_spec) ||
(match !_import_hook with Some hook -> hook lib_spec | None -> false) in
if resolved then run (cek_resume final Nil)
else raise (Eval_error "IO suspension in non-IO context")
else raise (Eval_error "IO suspension in non-IO context")
end else cek_value final
in run state)
(let final = (cek_step_loop (state)) in (if sx_truthy ((cek_suspended_p (final))) then (raise (Eval_error (value_to_str (String "IO suspension in non-IO context")))) else (cek_value (final))))
(* cek-resume *)
and cek_resume suspended_state result' =