Repository navigation
refactor: simplify worker and model fallback handling - #152268
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 18, 2026, 8:10 PM ET / September 19, 2026, 00:10 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR consolidates worker message handling, model fallback logic, and agent-run setup while preserving existing retry, delivery, and error-reporting behavior. Merge readiness⛔ Blocked before merge - 1 item remains No actionable introduced defect found. The source and author’s clarification resolve the previous migration concern; this protected, maintainer-authored cleanup remains distinct from the earlier merged fix. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s agent runners select models and execute user or scheduled turns. Worker adapters exchange validated requests and responses with the Gateway, which records transcripts and enforces live execution ownership. flowchart TD
A[User or scheduled turn] --> B[Agent run setup]
B --> C[Model fallback selection]
C --> D[Local or worker execution]
D --> E[Validated Gateway requests]
E --> F[Transcript and delivery evidence]
D --> G[Error classification]
G --> C
F --> H[Reply or terminal failure]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -1004, Tests +34, Other -1. Total -971 across 28 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Retain the shared internal owners while preserving closed worker schemas, live authority checks, delivery custody, and existing persisted values. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes behavior-preserving cleanup, and source review found no introduced defect requiring reproduction. Is this the best way to solve the issue? Yes: consolidating repeated projections and setup under existing owners is a maintainable approach, and the inspected changes preserve the relevant contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c9584688c461. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Reviewed the automated data-model flag against the exact diff at
Existing proof includes the passing memory-flush, memory-flush-session, agent-runner-memory, stale-token preflight, and private-transcript suites. Those exercise persisted fresh/stale usage, compaction-cycle guards, transcript accounting, cancellation, and retained session state. No migration is needed because the stored representation and its readers/writers remain unchanged. The path-based compatibility flag is resolved by this source and behavior evidence; the review reports no actionable code finding. |
|
Merged via squash.
|
* commit 'ca69b4d25dfcd488acc6ba1d878e4b4252f40cd2': (325 commits) perf(gateway): streamline config reload comparison (#152279) fix(xai): reject invalid UTF-8 OAuth responses (#111737) fix(release): accept waived advisory performance evidence for stable publication (#152290) fix: deliver watcher results while other sessions are busy (#152287) perf(media): reuse attachment filename classification (#152274) refactor(build): reuse forwarded option scanning (#152293) chore(diagnostics-otel): revert unapproved duration-bucket merge (#152292) fix: stop chat media reads after access changes (#152219) fix(test): use Gateway WebSocket transport in network fixtures (#152143) improve: retain quota refresh evidence from successful CI runs (#152173) improve(gateway): reduce memory used by session selection (#152260) perf(agents): use keyed subagent capability lookups (#152263) refactor(matrix): centralize media metadata assembly (#149128) chore(ui): refresh control ui locales (#152276) feat: open Crabbox apps beside the conversation (#152094) refactor: simplify worker and model fallback handling (#152268) perf(codex): reconcile session catalogs incrementally (#152257) fix(ui): keep submitted prompts visible across session startup (#152241) perf(sessions): move automatic maintenance database work to workers (#148630) fix: preserve reply metadata through outbound preparation (#152231) ...
Related: #152028.
What Problem This Solves
Worker inference and model fallback have repeated message projections, error metadata handling, and request setup that must be kept in sync.
User Impact
Internal cleanup with unchanged failure messages, retry behavior, delivery semantics, and worker protocol contracts. No configuration or data migration is required.
Why This Change Was Made
Removes 1,004 net production lines, including all replacement helpers and excluding tests, configuration, and documentation. Validated incoming worker messages use their schema-owned shape; outgoing provider messages retain explicit field projection. Error handling reuses existing field readers and shared mappings, while runner inputs and RPC outcome handling share their existing owners.
Live authority checks, cancellation, synchronous inference acknowledgment, replay limits, private error redaction, late session snapshots, and delivery evidence remain intact. Tests gain malformed-content and array/order coverage. The assertion baseline only shrinks where casts were removed.
Evidence
All runtime proof used isolated fixtures; no production Gateway was changed.
Compatibility Review
The automated memory-helper data-model flag was checked against the exact diff: storage schemas, versions, field values, and read/write owners are unchanged. No migration is needed. Source and behavior evidence.