Repository navigation
refactor(agents): trust maintenance-owned prepared facts - #175226
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR calls the maintenance coordinator directly, uses the public Agent context-hook type, and removes redundant copies, assertions, and timeout nonces. Example: A parent run times out while a child completion arrives during compaction recovery.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authorized refactor removes redundant bookkeeping while preserving the existing maintenance, replay, and timeout-recovery contracts; no actionable introduced defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherCLI and embedded agent preparation wait for session maintenance before reading history; replay preparation supplies model context, and timeout recovery controls whether child completions wait or are suppressed. flowchart LR
A[CLI and embedded runs] --> B[Session maintenance coordinator]
B --> C[Transcript read and replay]
C --> D[Model request]
D --> E[Timeout recovery]
E --> F[Abandonment record]
F --> G[Child completion handling]
Technical reviewBest possible solution: Retain the direct coordinator calls and simpler internal bookkeeping while preserving the existing replay, resource-lifetime, and timeout-recovery contracts. Do we have a high-confidence way to reproduce the issue? This PR is a behavior-preserving refactor rather than a reported runtime bug; review used source and supplied evidence without executing target code. Is this the best way to solve the issue? The direct coordinator and public Agent type remove redundant paths, while the retained checks and nonmutating helpers preserve the relevant contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4a2c8498afcb. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -33, Tests -28, Other -1. Total -62 across 29 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 17, 2026, 2:34 AM ET / 06:34 UTC. |
|
Landing under the campaign's inherited-failure admin exception and rule10 exact-head fallback. Reviewed and signed head: e4b82ef. Exact CI39010054871 completed. Fresh paginated enumeration with filter=all contains150checks:71success,73intentional skips,1neutral,2failures,3superseded metadata cancellations, zero pending. Dependency and security-sensitive legacy statuses are successful; the CI gate remains honestly red for the failure below.
The main-flakes inventory and last six completed scheduled runs were consulted, including39006528379/39002992814/38999305057/38995631641/38991549274/38988964265. The type defect is newer than their matching inventory; the independent unrelated-PR diagnostics and unchanged main owner/test provide the counterevidence. No unrelated runtime or E2E failure is included in this exception. The original head's mock-export fingerprint defect was ours and was repaired: the overflow-compaction mock now passes through the real owner while preserving its mocked operation, and the obsolete exact allowance was deleted. That gate passes on the current head. No assertion, timeout, retry, skip, baseline expansion, suppression or protected tool was weakened. Independent original P0-P2 review completed scoped-clean0.88; the exact two-file repair has fresh isolated scoped-clean0.99 review and final source verification. The current-head hosted maintainer review reports no findings; formal/inline reviews contain no outstanding finding. Hosted exact-head jobs provide the broad proof. Local suppression-policy proof passed3/3; no local maintenance CLI/Gateway E2E claim is made. Best-effort tradeoffs remain explicit in the PR body; Phase E, security/FIFO/settlement and data durability are untouched. The native landing initializer twice failed managed-worktree allocation with OPENCLAW_STATE_LEASE_ABORTED after the bounded infrastructure budget; both operations/processes/locks were reconciled without any merge intent. Campaign rule10 therefore authorizes the direct squash API with the exact reviewed SHA guard. Native writer verified as steipete; commit author and committer verified as Peter Steinberger with a good signature. Merge success will be reported only after readback and squash ancestry verification. |
- prepare.ts: main's comment lines (openclaw#175226, openclaw#168244) kept; the history gate stays inline on replayableTarget(cliHistoryWriter) as on the branch, so the file does not grow past its line-cap count - cli-runtime.test.ts: main's rewrite (openclaw#174630); the branch's it.for over assertCurrent and assertPrivateInputCurrent and its two private-input tests move into it, and createContext takes ClaudeCliExecuteContext overrides; cli-runtime.test-harness.ts and cli-runtime.private-input.test.ts deleted (the split only kept the old file under the line cap) - history-boundary.test.ts: branch fixture import plus main's prepareCliHistoryCompactionBoundary import (openclaw#175090) - docs/.generated config baseline regenerated with pnpm config:docs:gen - cli-backends.md: main's opaque-login paragraphs (openclaw#174457) now name the attestNativeLogin opt-in
…5226) * refactor(agents): consolidate maintenance facts and ownership * test(agents): preserve maintenance mock exports
What Problem This Solves
Agent preparation reaches the maintenance coordinator through a forwarding wrapper, repeats already-proven context assertions, and copies/freezes owner-prepared data. Timeout recovery adds a separate nonce despite already holding the exact abandonment record.
What Changed
Use the canonical coordinator directly across every caller/test, preserving disposal and transcript-read ordering. Type context hooks through the public Agent member rather than a cast-only view. Reuse stable internal media/history/context values, keep the pre-order Responses invariant and effect-boundary currentness check, and use exact abandonment-record identity for timeout restoration.
Best-effort tradeoffs accepted
Evidence
Serial suppression check on installed primary at source23's repaired head passed3/3 in one shard (121.30s), maxWorkers1 and task-isolated state. This is suppression-policy proof, not maintenance runtime proof; exact-head CI remains the broad gate.
Twenty-nine paths,11 production files:35 net production lines removed. The exact assertion ratchet shrinks7→5, and one obsolete closed-mock allowance is deleted after its factory becomes a real-module passthrough. All16 old wait-wrapper references migrated; no public SDK export/barrel was removed. Existing kept behavioral assertions remain.
Full production/test diff and owner/caller simplification inspected. Public Agent.transformContext and nonmutating replay contracts verified. Independent isolated P0-P2 review completed scoped-clean, confidence0.88, including final source verification.
Whitespace checks passed. Source-only checkout has no independent install; no local runtime/type pass claimed. Exact-head hosted CI owns broad proof under the shared-host budget. No schema, config/protocol values, dependencies, security/FIFO/settlement or Phase E change.
Original exact-head CI found the migrated overflow-compaction mock's changed closed-factory fingerprint. Repair preserves its mocked operation, passes through real exports, and deletes only the old allowance; fresh isolated P0-P2 review completed scoped-clean0.99 with final source verification. Separately, core test types report untouched config-health
usingdeclarations against its removed Disposable contract; this remains visible in observed main9a35d1a and is recorded separately, not waived as green.