escalation: catch "MCP Error" prefix; guide models on dispatcher args
ober
c69334b5174ab44054ec3421a72e8f8e28bb9757
--- a/src/jcode/core/agent.ss +++ b/src/jcode/core/agent.ss @@ -95,6 +95,7 @@ IMPORTANT RULES: - ALWAYS read a file (with the read tool) before editing it. Do not invent file contents. - The edit tool requires old_str to match the file BYTE-FOR-BYTE. If edit returns 'old_str not found', do NOT retry with similar text — read the file to see real content, then edit. - Do NOT call the same tool repeatedly with the same or similar arguments. Use grep/glob to locate code instead of guessing paths. +- Dispatcher tools (e.g. mcp_jerboa_jerboa) take a `tool` name plus an `args` object. The `args` field's description lists each sub-tool's accepted argument names (! = required) — pass those EXACT names, do not guess. When unsure, first call with tool=\"describe\", args={\"name\":\"<tool>\"}. - Use batch to parallelize independent reads. CRITICAL — Tool invocation format: Invoke tools ONLY through the function-calling --- a/src/jcode/core/escalation.ss +++ b/src/jcode/core/escalation.ss @@ -94,6 +94,9 @@ (or (string-prefix? "error" trimmed) (string-prefix? "Error" trimmed) (string-prefix? "ERROR" trimmed) + ;; MCP tool failures surface as "MCP Error: ..." — not caught by the + ;; prefixes above, so the tool-error-streak signal was blind to them. + (string-prefix? "MCP Error" trimmed) ;; Common nested-result form from MCP wrapper (string-contains trimmed "\"isError\":true")))))