Repository navigation
refactor(agents): retire unused private session layers - #177664
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 changesRemoves unused private session settings accessors, tree-navigation machinery, and an orphaned HTTP timeout parser. Example: Global compaction settings contain reserveTokens: 32768, and the session disables compaction.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR is a useful, maintainer-directed cleanup of unused private code. I found no actionable introduced defect; the supported SDK boundary remains intact and exact-head CI is green. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe embedded agent runtime prepares settings snapshots and constructs private AgentSession objects; retained settings operations feed agent execution and queued global persistence, while the public SDK exposes transcript managers and separately bound extension actions. flowchart TD
A[Global and project settings] --> B[Prepared settings snapshot]
B --> C[Private SettingsManager]
C --> D[Embedded AgentSession]
C --> E[Queued global settings writer]
F[Public agent sessions SDK] --> G[Transcript managers and extension actions]
Technical reviewBest possible solution: Retire the unreachable private paths while retaining the existing settings, transcript, and extension owners as this PR does. Do we have a high-confidence way to reproduce the issue? This is a refactor rather than a reported runtime bug; source inspection confirms the removed accessors have no remaining runtime callers and the public extension navigation path is independent. Is this the best way to solve the issue? The diff is a focused deletion using existing owners: it preserves the live extensionRunner getter, specializes the existing global writer, and adds no compatibility shim or competing state owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2cd23b665868. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -576, Tests -123, Other -2. Total -701 across 19 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 19, 2026, 4:06 PM ET / 20:06 UTC. |
|
Merged via squash.
|
Drop five forwarding exports left unused by #177664. Preserve canonical branch summaries, extension event types, and persisted package and warning settings.
Drop five forwarding exports left unused by openclaw#177664. Preserve canonical branch summaries, extension event types, and persisted package and warning settings.
What Problem This Solves
The private embedded-session runtime still carries unused settings accessors, an uncalled tree-navigation layer, and a parser whose only caller is one of those accessors. They duplicate responsibilities already supplied by the prepared settings snapshot and supported transcript/extension owners.
User Impact
No intended user-visible change or operator action. All persisted setting keys and types remain, along with global/project reads, overrides, snapshots, queued writes, locks, nested sibling merging, malformed-file refusal and error attribution. Public transcript navigation, extension commands, shared summary generation and compaction remain.
Why This Change Was Made
Remove 69 unused private SettingsManager accessors and the additional branch-summary accessor orphaned by deleting the uncalled private AgentSession tree layer. Narrow its orphaned project writer to the global writes that actually run. Delete the orphan HTTP idle-timeout parser. Move the live extensionRunner getter unchanged onto concrete AgentSession.
The packaged
openclaw/plugin-sdk/agent-sessionsentrypoint selects neither AgentSession, SettingsManager nor the private session factory; the stable package has the same boundary. Returned public ExtensionRunner contexts expose transcript managers and discrete actions, not these private objects. Its public navigateTree handler is independently supplied and remains. This is not a Plugin SDK, config, protocol, persisted schema, durability, retention, permission or dependency change. Phase E standalone session memory and all its machinery and tests are untouched.Against the pinned base, 576 net production lines removed across six production files. Two inventories shrink only by entries for deleted code/tests. Tests of deleted private entrypoints leave with their implementation; all retained metadata, cancellation, write settlement, publication, saved-default, storage scope and error assertions stay.
Best-effort tradeoffs accepted
Evidence
Complete owner/caller, public/stable/returned-object and provenance inspection; author simplification pass keeps existing owners without a compatibility shim, new export, cast or test-only production seam. Fresh isolated independent P0–P2 review is scoped-clean, with final source verification complete.
Fresh focused proof passes: 293 cases in 16 files across six configurations, including prompt-prefix stability, all four subprocess storage cases, saved-default publication and compaction admission. Targeted native typecheck (20 explicit roots), typed lint (14 TypeScript files), format, runtime cycles (0), static cycles (0), and all 14 lint-suppression cases pass. Source hashes were checked after the serial proof. The changed-check planner was run in dry-run mode only; full check-changed was not run.
The earlier focused run exposed implicit SDK mock setup inherited from a removed test and subprocess calls hidden inside source strings. Fixtures now establish their own complete stream and observe retained effective thinking levels or global-only saved-default snapshots. No assertion, timeout, retry or skip was relaxed. Fresh independent repaired-candidate review completed scoped-clean at P0–P2, with final source verification.
Local commands ran serially at nice10, focused wrapper Vitest with one worker, and isolated HOME/OpenClaw/XDG state. Format 1,045 ms; types 9,138 ms; typed lint 66,862 ms; focused wrapper 504,963 ms; runtime cycles 73,766 ms; static cycles 142,732 ms; suppressions 33,311 ms. Broad local builds, E2E, full check-changed and whole-graph typechecking are not run; exact-head PR CI is the broad gate.
The post-publication dependency-free detector scanned 23,278 production files in one nice10 process on this exact head. Both measured settings seeds (
s-3c1558a5c78e,s-68f5c2864693) are absent. Test/support net removal is 124 lines, separate from the 576 production-line reduction. No whole-tree exhaustion claim.