From 58ece83738cfe88fbf67db1c0adbb62016024323 Mon Sep 17 00:00:00 2001 From: William Cory Date: Wed, 18 Mar 2026 13:32:33 -0700 Subject: [PATCH] fix: tolerate codex rollout recorder stderr Rebased from SamuelLHuber/fix/codex-rollout-recorder (PR #86) onto refactored codebase. Original file src/agents/cli.ts was split into individual agent files; changes applied to src/agents/BaseCliAgent.ts. Adds three new benign stderr patterns for codex rollout recorder shutdown noise and cache TTL errors. When codex exits non-zero but stderr is empty after filtering, treat it as success. Also regenerates docs/llms-full.txt to fix docs sync test. Co-Authored-By: Samuel Huber Co-Authored-By: Claude Opus 4.6 (1M context) --- docs/llms-full.txt | 22 +++++++++++++++++++++- src/agents/BaseCliAgent.ts | 15 ++++++++++----- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/docs/llms-full.txt b/docs/llms-full.txt index 0cf200ed..23a776b2 100644 --- a/docs/llms-full.txt +++ b/docs/llms-full.txt @@ -9447,9 +9447,29 @@ export default smithers(db, (ctx) => ( Internally, `` renders as a `` host element (or `null` when skipped). The runtime manages iteration state and re-renders the workflow tree on each iteration, re-evaluating the `until` condition with the latest context. +## Nested loops + +Direct nesting — placing a `` as an immediate child of another `` — is not supported and throws `"Nested is not supported."` at render time. However, you can nest loops by wrapping the inner `` in a ``: + +```tsx + + + + + + Run the inner loop body. + + + + + +``` + +A common pattern is an outer loop driving the overall pipeline with an inner loop handling a review-until-LGTM cycle on each iteration. + ## Restrictions -- **Nesting is not supported.** Placing a `` inside another `` throws an error at render time. +- **Direct nesting throws.** Placing a `` as an immediate child of another `` throws an error. Wrap the inner loop in a `` to nest loops (see [Nested loops](#nested-loops) above). - **Duplicate ids throw.** If two `` loops share the same `id` (explicit or auto-generated), an error is thrown. ## Notes diff --git a/src/agents/BaseCliAgent.ts b/src/agents/BaseCliAgent.ts index c03989ba..64223427 100644 --- a/src/agents/BaseCliAgent.ts +++ b/src/agents/BaseCliAgent.ts @@ -816,6 +816,9 @@ export abstract class BaseCliAgent implements Agent { const benignPatterns = [ /^.*state db missing rollout path.*$/gm, /^.*codex_core::rollout::list.*$/gm, + /^.*failed to record rollout items: failed to queue rollout items: channel closed.*$/gim, + /^.*Failed to shutdown rollout recorder.*$/gm, + /^.*failed to renew cache TTL: Operation not permitted.*$/gim, ]; let filtered = stderr; for (const pattern of benignPatterns) { @@ -827,11 +830,13 @@ export abstract class BaseCliAgent implements Agent { if (result.exitCode && result.exitCode !== 0) { const filteredStderr = filterBenignStderr(result.stderr); - const errorText = - filteredStderr || - result.stdout.trim() || - `CLI exited with code ${result.exitCode}`; - throw new Error(errorText); + if (!(commandSpec.command === "codex" && filteredStderr.length === 0)) { + const errorText = + filteredStderr || + result.stdout.trim() || + `CLI exited with code ${result.exitCode}`; + throw new Error(errorText); + } } // Some CLIs may print extra banners to stdout. Allow individual agents