From c9c82a7f907ce87aa84599bdb2de5e93dd82ecce Mon Sep 17 00:00:00 2001 From: yelog Date: Wed, 29 Apr 2026 23:12:31 +0800 Subject: [PATCH] fix(agents): disable pi-coding-agent auto-retry to prevent tool call replay loops (#73781) --- CHANGELOG.md | 1 + src/agents/pi-project-settings.test.ts | 3 +-- src/agents/pi-project-settings.ts | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5eb67861f10a..8c931b06fe4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2013,6 +2013,7 @@ Docs: https://docs.openclaw.ai - Browser/chrome-mcp: read Chrome DevTools MCP screenshot output from the extension-suffixed path, fixing ENOENT on screenshot capture. Fixes #77222. (#74685) Thanks @barbarhan. +- Agents/Pi: disable the embedded pi-coding-agent runtime auto-retry so OpenClaw's own retry and failover loop does not replay failed tool calls through a nested SDK retry. Fixes #73781. Thanks @yelog. - macOS/launchd: set generated Gateway LaunchAgent plists to `ProcessType=Interactive` so the gateway keeps timely execution during idle periods. Fixes #58061; refs #62294 and closed duplicate #66992. (#62308) Thanks @bryanpearson and @zssggle-rgb. - Plugins/install: honor the beta update channel for onboarding and doctor-managed plugin installs by requesting floating npm and ClawHub specs with `@beta` while keeping persistent install records on the catalog default. Thanks @vincentkoc. - WhatsApp/onboarding: canonicalize setup and pairing allowlist entries to WhatsApp's digit-only phone ids while still accepting E.164, JID, and `whatsapp:` inputs, so personal-phone allowlists match WhatsApp Web sender ids after setup. Thanks @vincentkoc. diff --git a/src/agents/pi-project-settings.test.ts b/src/agents/pi-project-settings.test.ts index f69ecba1cb42..f763512249a5 100644 --- a/src/agents/pi-project-settings.test.ts +++ b/src/agents/pi-project-settings.test.ts @@ -161,9 +161,8 @@ describe("createPreparedEmbeddedPiSettingsManager", () => { }); expect(settingsManager.getShellCommandPrefix()).toBe("echo trusted &&"); - expect(settingsManager.getRetryEnabled()).toBe(true); + expect(settingsManager.getRetryEnabled()).toBe(false); - settingsManager.setRetryEnabled(false); await settingsManager.flush(); const diskSettings = JSON.parse(await fs.readFile(agentSettingsPath, "utf8")) as { diff --git a/src/agents/pi-project-settings.ts b/src/agents/pi-project-settings.ts index 9106f1836ddb..46cc14628388 100644 --- a/src/agents/pi-project-settings.ts +++ b/src/agents/pi-project-settings.ts @@ -61,5 +61,10 @@ export function createPreparedEmbeddedPiSettingsManager(params: { cfg: params.cfg, contextTokenBudget: params.contextTokenBudget, }); + // Disable the pi-coding-agent auto-retry. OpenClaw has its own comprehensive + // retry layer (failover rotation, auth profile rotation, empty-error retry, + // thinking-level fallback) in run.ts. Having both layers active creates a + // double-retry that can replay failed tool calls in an unbounded loop (#73781). + settingsManager.setRetryEnabled(false); return settingsManager; }