Repository navigation
refactor: unify the embedded-agent fallback run-entry across all four pipelines - #111608
Conversation
…emory, and follow-up paths
|
Codex review: needs real behavior proof before merge. Reviewed July 20, 2026, 1:32 AM ET / 05:32 UTC. Summary PR surface: Source +302, Tests +333. Total +635 across 12 files. Reproducibility: not applicable. This PR is presented as a behavior-preserving refactor, not a report of a currently failing user workflow. The relevant evidence needed is after-fix runtime equivalence across the four execution variants. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Keep one typed shared entrypoint only if representative real executions prove each variant preserves its intended fallback, abort, terminal, and session-settlement contract, and resolve the failing type-test check before a maintainer decides whether to merge. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is presented as a behavior-preserving refactor, not a report of a currently failing user workflow. The relevant evidence needed is after-fix runtime equivalence across the four execution variants. Is this the best way to solve the issue? Unclear: centralizing repeated lifecycle logic is a plausible maintainability improvement, but it is the best solution only if real executions confirm that the variant-specific fallback, abort, terminal, and session contracts remain unchanged. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against a22ede72e494. Label changesLabel justifications:
Evidence reviewedPR surface: Source +302, Tests +333. Total +635 across 12 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
Merged via squash.
|
… pipelines (openclaw#111608) * refactor(agents): unify fallback run-entry across channel, command, memory, and follow-up paths * refactor(agents): keep run-entry contracts module-local * test(reply): derive run-entry params type locally
What Problem This Solves
Four separate pipelines wrapped
runWithModelFallback+runEmbeddedAgentwith their own copies of fallback-candidate construction, result classification, exhausted-result merging, retry indexing, abort projection, terminal-outcome normalization, and completed-session reconciliation: the channel reply path, the gateway command/RPC path, the memory-flush maintenance path, and the follow-up delivery path. The copies drifted (that drift class has produced real bugs), and every failover change had to be made four times.Why This Change Was Made
One shared
runEmbeddedAgentEntryhelper now owns the common lifecycle, with intentional per-path differences expressed as closed discriminated variants (channel-delivery/command-rpc/maintenance/followup-delivery, andpreserve/reconcile-completedsession handling) instead of caller-side plumbing — impossible states unrepresentable, and terminal projection normalized throughagent-run-terminal-outcome.tsas the repo mandates. Behavior is intentionally unchanged; genuinely different semantics (maintenance's thrown-errors-only fallback, follow-up's preserve-on-exhaustion, command's committed-cron-media retry guard, channel delivery evidence) remain explicit per variant. A detailed two-path/four-path comparison map with file:line cites is in the review artifacts.User Impact
No behavior change. Future failover/terminal fixes land once instead of four times; the divergence class that produced past regressions is structurally closed. One remaining direct call site (
src/cron/isolated-agent/run-executor.ts) is outside these four pipelines and noted as follow-up.Evidence
git diff --checkclean; autoreview clean (one earlier finding rejected with line-cited proof of abort forwarding).