Repository navigation
refactor(agents): read prepared settings directly - #178407
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 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. |
|
Codex review: blocked before merge. What this changesThis PR reads prepared settings directly from their existing files and removes the unused private storage backend, writer, and associated fixtures. Example: Global settings.json contains defaultThinkingLevel set to high.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it completes a useful, maintainer-directed simplification, and review found no actionable code defect. Priority: P3 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherAgent preparation reads global, plugin, and project settings, applies existing precedence and trust policy, and supplies immutable snapshots to attempt-local managers and provider retry preparation. flowchart TD
A[Global settings file] --> D[Direct settings reader]
B[Project settings file] --> D
D --> E[Prepared settings snapshot]
C[Enabled plugin settings] --> E
E --> F[Trust policy and merge]
F --> G[Attempt settings and retry preparation]
Technical reviewBest possible solution: Retain the direct reader and complete settings-loading compatibility validation before merging. Do we have a high-confidence way to reproduce the issue? This is a refactor rather than a reported bug; source confirms that current main constructs the private backend solely for production reads. Is this the best way to solve the issue? The direct path is the smallest complete cutover: it reuses the existing parser, preserves settings ownership and trust policy, and removes the obsolete writer together with its callers and tests. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2d03d5632a69. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -73, Tests -398. Total -471 across 6 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 20, 2026, 8:54 AM ET / 12:54 UTC. |
|
Maintainer disposition: the review reports no actionable findings. This changes no stored data model: the Settings fields, global/project paths, JSON/object validation, error handling, trust policy, and new/reset-session refresh boundary remain intact. The production writer was already retired in #178049; this PR removes its unused implementation and read-side coordination. The reader never modifies existing file bytes. Full fresh-install and stable-upgrade Gateway execution remains an explicit proof gap, as disclosed in the body. I’m treating the generic compatibility-proof hold as advisory for this internal, format-preserving cut, supported by source review and successful exact-head CI 39423745313. No scanner policy, fixture, permission, or schema is changed to release the hold. |
Read prepared global and project settings directly through their existing parser and paths. Remove the private single-implementation backend, unused writer, read locks, and writer-only fixtures after openclaw#178049 retired production persistence. Keep ENOENT-only absence handling, native filesystem errors, trust/sanitization, refresh boundaries, and user file bytes. Old/private writers or overlapping external edits may produce an old/empty/error snapshot until fresh preparation; this best-effort read never writes user settings. Targeted types, ordinary typed lint, formatting, caps, zero runtime/static cycles, independent review, and exact-head CI 39423745313 passed. Local runtime gaps and unrun opt-in Gateway/upgrade proof are disclosed. The generic automated proof hold is advisory; review identified no code finding. PR openclaw#178407; 73 net production and 398 fixture/support lines removed. Standalone session memory is unchanged.
Remove orphaned context-engine assertions and the already-current convergence table after openclaw#178340 and openclaw#178341. Keep webhook, MCP authority, and JSON-target helpers local after openclaw#178399, openclaw#172026, and openclaw#178407; replace the test-only skill-authoring reset seam with module isolation.
What Problem This Solves
Settings preparation still constructs a private storage backend and acquires writer locks even though the production settings writer has been retired.
User Impact
No settings migration or public contract change. Global and project settings keep their paths, keys, trust policy, and new/reset-session refresh boundary. Reads leave user files untouched. An overlapping external edit can produce an old, empty, or error snapshot until fresh preparation.
Why This Change Was Made
After #178049 made SettingsManager attempt-local and memory-only, preparation became the sole production consumer of FileSettingsStorage, only for reads. Replace that private single-implementation protocol/class with the existing scope reader taking a path; delete its orphan writer, lock machinery, and writer-only process harness. Migrate the isolated QA fixture's settings seed to direct file setup before Gateway readiness.
The reader opens directly and treats only ENOENT as absence. JSON/object validation and all other filesystem errors remain intact, including the ENOTDIR repair from the earlier review. Existing actual-file/reset/trust/plugin/model preparation tests remain; obsolete backend tests move to native file-error coverage rather than a replacement production seam.
This is a six-path owner area split: 73 net production and 398 net fixture/support lines removed (471 overall). Standalone session memory, public SDK/protocol/config shapes, and database schemas/durability/retention/permissions are unchanged.
Best-effort tradeoffs accepted
Evidence
The exact six-file composition passed targeted types, formatting, ordinary type-aware lint of all five core files and the E2E fixture, line caps, runtime/static cycles (zero), and independent P0–P2 review with no actionable findings. The temporary switch for another PR's repair was reversed by replaying these six exact postimages; all input hashes still match the reviewed candidate.
Fresh focused execution passed all three attempt-local SettingsManager cases and all 14 suppression checks. The next Gateway shard hit a worker-cache miss and began broad compiler preparation; only this task's compiler and runner were stopped to honor the local build budget. That attempt is incomplete, not a product failure or a pass. Fresh native-file, preparation/reset/trust, agent-settings, utility-harness, and prompt-prefix runtime results remain exact-head CI obligations. Earlier signed-input focused proof is historical, not a fresh current-base run.
The opt-in cron/Gateway E2E fixture has source and targeted-type/lint coverage but has not been executed locally; broad builds/E2E are outside this campaign's local proof budget. No timeout, retry, skip, assertion, baseline or suppression weakening.