context(slice): out-of-range model selector is terminal instead of a recoverable per-call fault #381

Open
opened 2026-09-07 00:02:24 +00:00 by nsaspy · 0 comments
Owner

Summary

A model-issued context(slice) request with a start index beyond the current payload length fails the entire run with context_operation_failed, instead of being surfaced as a recoverable per-call fault (the way malformed native tool-call arguments already are). The model cannot correct course after one bad slice guess.

Reproduction (live run, 2026-09-06)

Auto-Dig Prolog actor, native direct mode, pinned ref 39b278589dae8518e583778cd6671a6cb1e026c7 (with the Auto-Dig hotfix set applied). The model (z-ai/glm-5.3-flash via OpenRouter) had already made 6 model calls / 8 context calls when it requested:

{"operation": {"$term": "slice", "args": [6000, 2288]}}

Outcome error (rlm-result.json):

{
  "kind": "context_operation_failed",
  "message": "native context operation failed",
  "cause": {
    "kind": "out_of_range",
    "index": 6000,
    "message": "context selector is outside the payload",
    "operation": {"$term": "slice", "args": [6000, 2288]}
  }
}

The run terminated with exit 1 (phase=context kind=context_operation_failed). No retry, no repair attempt, no clamp.

Why this matters for Auto-Dig

  • The pinned runtime already treats recoverable native preflight faults, transient provider failures, and read-only tool errors as per-call events; an out-of-range selector is the same class: the model guessed an offset it could not verify.
  • A single bad slice guess should cost one call (ideally returning a bounded error/corrected-range hint the model can use), not the whole bounded research slice.
  • Observed twice in three live runs with identical config: run svc-20260906T235450Z (full success, no bad slices), run svc-20260906T235839Z (this failure), run svc-20260906T235958Z (full success again) — so it is model-behavior variance, not a deterministic request property.

Requested behavior

  • Out-of-range context(slice) selectors (and equivalent peek/search selectors) should be recoverable per-call faults: return a structured error the loop can feed back to the model (e.g. "payload length is N; valid range 0..N"), allow one bounded repair retry, and only fail the run if the model repeats the same invalid selector.
  • Alternatively clamp to the payload and record the clamped result in the trace, as long as the trace shows the requested vs. served range.

Environment

  • prolog-rlm pinned ref: 39b278589dae8518e583778cd6671a6cb1e026c7 + scripts/apply_prolog_rlm_hotfix.py patch set from starintel-gpt-auto-dig.
  • Runner: agents/auto_dig_rlm_runner.pl (context options max_bytes(262144), time_limit(5.0)).
## Summary A model-issued `context(slice)` request with a start index beyond the current payload length fails the **entire run** with `context_operation_failed`, instead of being surfaced as a recoverable per-call fault (the way malformed native tool-call arguments already are). The model cannot correct course after one bad slice guess. ## Reproduction (live run, 2026-09-06) Auto-Dig Prolog actor, native direct mode, pinned ref `39b278589dae8518e583778cd6671a6cb1e026c7` (with the Auto-Dig hotfix set applied). The model (z-ai/glm-5.3-flash via OpenRouter) had already made 6 model calls / 8 context calls when it requested: ```json {"operation": {"$term": "slice", "args": [6000, 2288]}} ``` Outcome error (`rlm-result.json`): ```json { "kind": "context_operation_failed", "message": "native context operation failed", "cause": { "kind": "out_of_range", "index": 6000, "message": "context selector is outside the payload", "operation": {"$term": "slice", "args": [6000, 2288]} } } ``` The run terminated with exit 1 (`phase=context kind=context_operation_failed`). No retry, no repair attempt, no clamp. ## Why this matters for Auto-Dig - The pinned runtime already treats recoverable native preflight faults, transient provider failures, and read-only tool errors as per-call events; an out-of-range selector is the same class: the model guessed an offset it could not verify. - A single bad slice guess should cost one call (ideally returning a bounded error/corrected-range hint the model can use), not the whole bounded research slice. - Observed twice in three live runs with identical config: run `svc-20260906T235450Z` (full success, no bad slices), run `svc-20260906T235839Z` (this failure), run `svc-20260906T235958Z` (full success again) — so it is model-behavior variance, not a deterministic request property. ## Requested behavior - Out-of-range `context(slice)` selectors (and equivalent peek/search selectors) should be recoverable per-call faults: return a structured error the loop can feed back to the model (e.g. "payload length is N; valid range 0..N"), allow one bounded repair retry, and only fail the run if the model repeats the same invalid selector. - Alternatively clamp to the payload and record the clamped result in the trace, as long as the trace shows the requested vs. served range. ## Environment - prolog-rlm pinned ref: `39b278589dae8518e583778cd6671a6cb1e026c7` + `scripts/apply_prolog_rlm_hotfix.py` patch set from starintel-gpt-auto-dig. - Runner: `agents/auto_dig_rlm_runner.pl` (context options `max_bytes(262144), time_limit(5.0)`).
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/prolog-rlm#381
No description provided.