mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 03:30:48 +08:00
Cache inventory MCP lists and accept YES as WhatsApp confirm.
Extend short TTL reuse to listManagedNe/queryUmeNeInventory to cut list self-loops, and treat short YES/continue as confirmation when a token is pending. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
f1d025ed60
commit
d3f621b58b
6 changed files with 130 additions and 42 deletions
|
|
@ -967,12 +967,26 @@ class ToolExecutor:
|
|||
continue
|
||||
sig = f"{tc.name}:{self._json_dumps_safe(dict(tc.arguments or {}))}"
|
||||
count = int(sig_seen.get(sig, 0))
|
||||
name_low = str(tc.name or "").strip().lower()
|
||||
listish = name_low.endswith(
|
||||
(
|
||||
"listclitargets",
|
||||
"listmanagedne",
|
||||
"queryumeneinventory",
|
||||
)
|
||||
)
|
||||
if count >= budget:
|
||||
results_by_id[tc.id] = (
|
||||
{
|
||||
"ok": False,
|
||||
"error_code": "tool_loop_guard",
|
||||
"error": f"tool loop guard triggered for signature: {tc.name}",
|
||||
"hint": (
|
||||
"Identical list/inventory call already ran this turn; reuse prior ids/rows "
|
||||
"instead of listing again."
|
||||
if listish
|
||||
else "Identical tool call already ran this turn; change arguments or continue without retry."
|
||||
),
|
||||
},
|
||||
0,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue