Repository navigation
refactor(agents): keep attempt settings directly in memory - #178049
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: needs maintainer review before merge. What this changesThis PR stores attempt-local settings directly in memory and removes unused persistence, reload, and storage paths. Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: the maintainer-approved simplification removes unused private machinery while preserving production settings ownership, precedence, and reload behavior; no actionable defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherSettings preparation reads and merges global, plugin, and project inputs; the attempt-local manager layers runtime overrides and supplies settings to agent sessions and provider requests. flowchart TD
A[Stored settings] --> B[Settings preparation]
C[Plugin settings] --> B
B --> D[Attempt settings manager]
E[Runtime overrides] --> D
D --> F[Agent session]
F --> G[Provider requests]
Technical reviewBest possible solution: Keep the existing preparation and file-storage owners while using synchronous attempt-local settings with runtime overrides applied last. Do we have a high-confidence way to reproduce the issue? This refactor claims no user-visible bug; source inspection confirms the redundant serialization and persistence machinery on the existing in-memory construction path. Is this the best way to solve the issue? The change is a focused simplification using existing owners, with no replacement abstraction, competing state owner, or public SDK expansion. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 08d20d2856f5. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -187, Tests -158, Other 0. Total -345 across 16 files. Added test files: 0. View PR surface stats
Review metrics
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 20, 2026, 1:25 AM ET / 05:25 UTC. |
|
Merged via squash.
|
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 #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 #178407; 73 net production and 398 fixture/support lines removed. Standalone session memory is unchanged.
…178049) * refactor(agents): keep attempt settings directly in memory * chore(agents): shrink settings assertion baseline
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.
What Problem This Solves
The attempt-local SettingsManager still serializes prepared settings through an in-memory JSON store, queues synchronous writes, snapshots modified fields, and carries file reload/error/persistence paths. Neither production factory constructs a file-backed manager: preparation already reads and merges global, plugin, and project settings before creating the attempt-local manager.
User Impact
No intended user-visible change or operator action. Prepared settings, per-attempt defaults and runtime overrides keep their existing precedence; persisted settings and their actual storage owner remain unchanged.
Why This Change Was Made
Keep settings and runtime overrides directly in memory and apply setters synchronously. Delete the unreachable file-backed manager factories, write tail, persistence merge/error tracking, flush/reload methods, and orphan in-memory storage. Remove the redundant settings reload from extension reload; real extension/resource/model reload and queue-mode resynchronization remain.
Actual FileSettingsStorage reads, locking, atomic replacement, permissions and stored Settings shapes are unchanged. Retired-key, malformed-file and read-error coverage moves to the actual preparation/read boundaries. Prepared snapshot isolation/invalidation, override precedence, provider retry, explicit transport and model/default publication remain protected.
This is a focused widely-imported owner/agents-area slice, below the campaign's usual size floor to keep CI attribution narrow. No Plugin SDK export, config, protocol, schema, durability, retention, permission, dependency or Phase E session-memory change.
Best-effort tradeoffs accepted
Evidence
Net production delta: +22/-209, 187 lines removed, across five production files; tests/support +145/-303, 158 lines removed. Fifteen source/test paths plus one shrink-only assertion-baseline correction (16 paths total).
Source/caller/provenance inspection, author simplification and test audit complete. Independent isolated Codex review was scoped-clean at P0–P2 (confidence .96); final source verified. Subsequent edits only collapsed identical subprocess arguments, restored whitespace and made an orphan storage interface private, deriving its fixture type from the actual reader.
Serial isolated focused proof: 264 distinct behavioral cases across 15 files pass, covering settings/preparation/storage, explicit transport/provider retry, real extension reload/queue resynchronization, model admission/default publication/notifications, prompt-prefix stability and attempt/context-engine/abort consumers. 17 suppression/wrapper audits pass. Runtime cycles 0; Madge cycles 0. Targeted production and test typechecks, actual touched-file typed lint, formatting, staged line-cap ratchet and changed-check dry-run pass; final production/test types took 22.4/21.9 seconds and final typed lint 54.3 seconds.
All test state used task-owned HOME/OpenClaw/XDG directories, nice 10 and one worker, with heavy commands serialized. No full local build, E2E, broad check-changed or whole-graph typecheck.
Initial exact-head CI39370778575 correctly caught an authored baseline omission: settings-manager now has three grandfathered type assertions rather than eight. Its assertion-safety ratchet job118458331649 failed; correction84a85d40dcc97 reduces the baseline from eight to three, not expanded or bypassed. Focused assertion-safety validation passes115.9s; all17 suppression/wrapper audits pass89.6s. Runtime implementation and its independent review are unchanged.
Final exact-head CI39371962311 succeeded on84a85d40dcc9705b2b261e527f26b43fd069c3dd. Both actual extension typed-lint stripes118462419895 and118462419817 passed on this final head. Complete127-check inventory has no failed or nonterminal check; the one cancelled metadata context is superseded by its successful same-head context, not missing suite proof. No CI rerun or green-only push.