[direct] add an explicit native-call batch cardinality budget (max_native_calls_per_batch) #305
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm#305
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Direct mode classifies the complete native tool-call batch returned by one provider response (
classify_calls/4inprolog/rlm_direct.pl). Recoverable per-call preflight faults (issue #313, hardened after #316) never execute and are never charged againstmax_tool_calls/max_context_ops, so one provider response can request an arbitrarily large all-fault batch:native_tool_calls_normalize/2(prolog/rlm_native_tool.pl) accepts any list length (require_call_list/1only checks list-ness).max_tokens(output size of the single response) andmax_output_bytes(bounded fault observations per call) plusmax_model_calls/max_iterationsacross turns.Problem
A hostile or degenerate model response can force the runtime to normalize and classify a very large call list in one turn. Each faulted call still costs normalization work, one bounded observation, and observation bytes. There is no explicit, testable runtime knob bounding per-response native-call cardinality; the bound today is an emergent property of provider output limits.
Requested behavior
Add an explicit budget field equivalent to
max_native_calls_per_batch(trusted, operator-configured, with a bounded default) enforced during classification against the ORIGINAL requested batch:native_batch_too_large);docs/direct-runtime.mdalongside the other budget admission rules;Non-goals
Do not silently repurpose
max_tool_calls/max_context_opsto cover rejected calls: charged counts must keep meaning executed operations. This is a separate admission limit, not a charge change.Related: #313, #316.
Fix in #332 (max_native_calls_per_batch admission: original-batch cardinality, fail-closed native_batch_too_large, executed-operation accounting unchanged).
Completed by #332 (merged as
3a4c2d1): max_native_calls_per_batch admission — original-batch cardinality, fail-closed native_batch_too_large, executed-operation accounting unchanged, docs/direct-runtime.md updated.