[P2] Preserve provider usage when completion plan execution fails #44
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#44
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?
Problem
Issue #20 added an append-only
model_responsesledger inrlm_planso nested model calls remain accountable even when child lexical vars are restored. Successfulrlm_completion/4results now aggregate that ledger correctly.However,
completion_after_execution/8currently returnserror(Error)immediately whenplan_run/5fails. The plan error now containsmodel_responses, butrlm_completiondoes not aggregate or attach their usage on the error path.Therefore a plan that successfully consumes provider tokens/cost and then fails on a later tool/context/final operation can lose those provider usage totals from the completion outcome.
Desired behavior
Constraints
Do not double-count retries or responses. Reuse the
model_responsesledger introduced during #20 instead of reconstructing usage from visible vars.Discovered by
PR #43 / issue #20 deep-recursion accounting audit.