recall the previous run's ledger for a follow-up within query_recall_window

A completed real-skill run's ledger is held in memory per origin source
for query_recall_window seconds (default 30, 0 disables). A follow-up
request in the same chat arrives with it as prior_ledger -- rendered as a
'previous request' context block in navigation/assessment state and
exposed to bodies via last_result -- so a reference like 'send it to Sam'
resolves against what the agent just did.

Kept separate from run_ledger: recall is not an in-flight continuation,
so it never skips the actionability guard nor feeds the monotonic-progress
guard. Only terminal real-skill runs are remembered (canned responses and
housekeeping meta skills excluded); the final step is synthesized as a
ledger entry since a single-step run's own run_ledger is empty.
This commit is contained in:
gabby committed 2026-10-10 08:33:59 +00:00
1 parent ab0defca1e
commit def51f81dc
7 files changed
+351 -4

No files matched your search

+4
View File
@@ -39,6 +39,7 @@ from .skills import (
SkillStore,
bound_output,
render_ledger,
render_recall,
resolve_skill_config,
unresolved_variables,
)
@@ -345,6 +346,9 @@ class SkillRunner:
f"resolved inputs:\n{resolved}\n"
f"action log:\n{observed}"
)
recall = render_recall(request)
if recall:
state += f"\n{recall}"
ledger = render_ledger(request.run_ledger)
if ledger:
state += f"\nsteps already taken:\n{ledger}"