Agent: max_tokens 32k for cloud models and retry on empty turns (runaway reasoning); proxy: sap_activate fallback for PROG/FUNC
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
@@ -52,6 +52,7 @@ class ToolProxy:
|
||||
self.log = open(log_path, "a")
|
||||
self.adt = None
|
||||
self.fallbacks = [] # writes that needed the ADT activation fallback
|
||||
self.last_source = {} # last main source pushed per PROG/FUNC, for the sap_activate fallback
|
||||
|
||||
def schemas(self):
|
||||
tools = [t for t in self.mcp.list_tools() if t["name"] in MODEL_TOOLS]
|
||||
@@ -126,7 +127,13 @@ class ToolProxy:
|
||||
self.activations += 1
|
||||
err, text = self.mcp.call(tool, args)
|
||||
if tool == "sap_push_source":
|
||||
if str(args.get("objectType", "")).upper() in ("PROG", "FUNC") and not args.get("includeType"):
|
||||
self.last_source[str(args.get("objectName", "")).upper()] = args.get("source", "")
|
||||
err, text = self._activation_fallback(args, err, text)
|
||||
elif tool == "sap_activate": # a write with activate=false, then sap_activate (G0014, G0124)
|
||||
src = self.last_source.get(str(args.get("objectName", "")).upper())
|
||||
if src is not None:
|
||||
err, text = self._activation_fallback(dict(args, source=src), err, text)
|
||||
result = (err, self._filter(tool, text))
|
||||
if tool in WRITE_TOOLS:
|
||||
failed = err or '"success":false' in text.replace(" ", "")
|
||||
|
||||
Reference in New Issue
Block a user