prolog-rlm flake pin predates rlm_direct/4: direct-mode dispatch fails with existence_error(procedure, rlm:rlm_direct/4) #118

Closed
opened 2026-09-08 00:48:31 +00:00 by nsaspy · 1 comment
Owner

Summary

The direct lane of the _prolog_rlm plugin crashes with an existence error: runtime_worker.pl dispatches rlm:rlm_direct(Prompt, text(Context), Options, Outcome), but the flake-pinned prolog-rlm revision (2e1264d8, Aug 27) predates the provider-native direct runtime (rlm_direct/4 landed Aug 28 in f7d93e6f). Every direct-mode turn through the core-loop proxy raises existence_error(procedure, rlm:rlm_direct/4) inside dispatch/3, which surfaces as a RuntimeFailure and aborts the agent's model turn. The plugin had to be disabled to keep the agent running.

Environment

  • Repo: lost-rob0t/a0-symbolics@main bba5dcba
  • prolog-rlm pin (a0-symbolics flake): 2e1264d80d02fecfb9f946e1328caaf1053e7a3b
  • prolog-rlm main at time of report: e1ed6c2b5f717d9bb380fcf22d144737299197f8
  • Command: live agent turn through plugins/_prolog_rlm/helpers/loop.py (core-loop proxy, direct mode)

Repro

  1. On main, note flake.nix pins prolog-rlm to 2e1264d8; the built pack's prolog/rlm.pl exports no rlm_direct/4 (confirmed: grep -c rlm_direct → 0 in the store path that activate_prolog_rlm gcroots and exports via SWIPL_PACK_PATH).
  2. Run the worker against that pack and issue a direct request:
    echo '{"request_id":"t2","action":"direct","arguments":{"prompt":"2+2","context":{"text":"x"},"budget":{"max_total_tokens":256}}}' | swipl -q -f plugins/_prolog_rlm/prolog/runtime_worker.pl
  3. The worker dies with rc=1 and no response envelope (silent crash in this configuration), or the exception propagates through the Python bridge as: RuntimeFailure: dispatch/3: Unknown procedure: rlm:rlm_direct/4: error(existence_error(procedure,rlm:rlm_direct/4),context(dispatch/3,_246)).

Expected / Actual

Expected: the pinned runtime revision satisfies every procedure the plugin worker dispatches (rlm_direct/4 for direct, rlm_completion/4 for symbolic); a missing runtime capability should fail as a typed envelope, not abort the turn.

Actual: the pin predates rlm_direct/4; dispatch(direct, ...) raises error(existence_error(procedure, rlm:rlm_direct/4), context(dispatch/3, _)).

Evidence

  • Pin 2e1264d8 (2026-08-27 00:25) < feat: add provider-native direct runtime f7d93e6f / d87c467b (2026-08-28 03:18), which is where rlm_direct/4 enters prolog/rlm.pl exports.
  • Rebuilt the pack from prolog-rlm e1ed6c2b (origin/main, 2026-09-05): rlm_direct/4 present (7 occurrences in rlm.pl), worker status action responds ok:true, and the pack builds cleanly under the symbolics nix setup.
  • Container live env confirms the skew: SWIPL_PACK_PATH=/nix/store/s1d81w1...-prolog-rlm-0.1.0/share/swi-prolog/pack (identical to the pinned source, no rlm_direct).

Fix direction

Bump the flake pin to a prolog-rlm revision containing the provider-native direct runtime (verified against e1ed6c2b5f717d9bb380fcf22d144737299197f8), and consider a smoke test asserting the worker's status result lists the surfaces the plugin dispatch table depends on, so pin/runtime skew fails in CI instead of in a live agent turn.

## Summary The `direct` lane of the `_prolog_rlm` plugin crashes with an existence error: `runtime_worker.pl` dispatches `rlm:rlm_direct(Prompt, text(Context), Options, Outcome)`, but the flake-pinned prolog-rlm revision (2e1264d8, Aug 27) predates the provider-native direct runtime (`rlm_direct/4` landed Aug 28 in f7d93e6f). Every `direct`-mode turn through the core-loop proxy raises `existence_error(procedure, rlm:rlm_direct/4)` inside `dispatch/3`, which surfaces as a `RuntimeFailure` and aborts the agent's model turn. The plugin had to be disabled to keep the agent running. ## Environment - Repo: lost-rob0t/a0-symbolics@main bba5dcba - prolog-rlm pin (a0-symbolics flake): 2e1264d80d02fecfb9f946e1328caaf1053e7a3b - prolog-rlm main at time of report: e1ed6c2b5f717d9bb380fcf22d144737299197f8 - Command: live agent turn through `plugins/_prolog_rlm/helpers/loop.py` (core-loop proxy, direct mode) ## Repro 1. On `main`, note `flake.nix` pins `prolog-rlm` to 2e1264d8; the built pack's `prolog/rlm.pl` exports no `rlm_direct/4` (confirmed: `grep -c rlm_direct` → 0 in the store path that `activate_prolog_rlm` gcroots and exports via `SWIPL_PACK_PATH`). 2. Run the worker against that pack and issue a `direct` request: `echo '{"request_id":"t2","action":"direct","arguments":{"prompt":"2+2","context":{"text":"x"},"budget":{"max_total_tokens":256}}}' | swipl -q -f plugins/_prolog_rlm/prolog/runtime_worker.pl` 3. The worker dies with rc=1 and no response envelope (silent crash in this configuration), or the exception propagates through the Python bridge as: `RuntimeFailure: dispatch/3: Unknown procedure: rlm:rlm_direct/4: error(existence_error(procedure,rlm:rlm_direct/4),context(dispatch/3,_246))`. ## Expected / Actual Expected: the pinned runtime revision satisfies every procedure the plugin worker dispatches (`rlm_direct/4` for direct, `rlm_completion/4` for symbolic); a missing runtime capability should fail as a typed envelope, not abort the turn. Actual: the pin predates `rlm_direct/4`; `dispatch(direct, ...)` raises `error(existence_error(procedure, rlm:rlm_direct/4), context(dispatch/3, _))`. ## Evidence - Pin 2e1264d8 (2026-08-27 00:25) < `feat: add provider-native direct runtime` f7d93e6f / d87c467b (2026-08-28 03:18), which is where `rlm_direct/4` enters `prolog/rlm.pl` exports. - Rebuilt the pack from prolog-rlm `e1ed6c2b` (origin/main, 2026-09-05): `rlm_direct/4` present (7 occurrences in `rlm.pl`), worker `status` action responds `ok:true`, and the pack builds cleanly under the symbolics nix setup. - Container live env confirms the skew: `SWIPL_PACK_PATH=/nix/store/s1d81w1...-prolog-rlm-0.1.0/share/swi-prolog/pack` (identical to the pinned source, no `rlm_direct`). ## Fix direction Bump the flake pin to a prolog-rlm revision containing the provider-native direct runtime (verified against `e1ed6c2b5f717d9bb380fcf22d144737299197f8`), and consider a smoke test asserting the worker's `status` result lists the surfaces the plugin dispatch table depends on, so pin/runtime skew fails in CI instead of in a live agent turn.
Author
Owner

Fix pushed to the Forgejo repo: PR nsaspy/a0-symbolics#117 (fix/prolog-rlm-pin-rlm_direct, commit 17dc77c9) bumps the flake pin to e1ed6c2b.

Verified on the branch:

  • rebuilt pack exports rlm_direct/4 (7 refs in prolog/rlm.pl)
  • worker status action responds ok:true with the full surface list
  • plugin + context-compiler suites: 49 passed, 9 skipped
Fix pushed to the Forgejo repo: PR nsaspy/a0-symbolics#117 (`fix/prolog-rlm-pin-rlm_direct`, commit 17dc77c9) bumps the flake pin to `e1ed6c2b`. Verified on the branch: - rebuilt pack exports `rlm_direct/4` (7 refs in `prolog/rlm.pl`) - worker `status` action responds `ok:true` with the full surface list - plugin + context-compiler suites: 49 passed, 9 skipped
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/a0-symbolics#118
No description provided.