Skip to content

fix(gateway): hot-reload automatic compaction settings - #118010

Merged
steipete merged 2 commits into
mainfrom
codex/issue-114654-compaction-hot-reload
Aug 2, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/issue-114654-compaction-hot-reload

Conversation

@steipete

@steipete steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #114654

Root cause

Gateway hot reload classified automatic compaction settings as a full restart even though the active runtime can apply them through the existing reload path. That made a config-only compaction change interrupt the Gateway instead of taking effect in place.

Fix

  • Treat the automatic compaction settings as hot-reloadable in the canonical gateway reload plan.
  • Keep the implementation to one production line; the remaining changes are regression coverage for planning, handler behavior, and live Gateway behavior.

Verification

Agent Transcript

Redacted agent workflow transcript

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Aug 2, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 11:14 AM ET / 15:14 UTC.

ClawSweeper review

What this changes

The PR makes existing automatic-compaction settings reload in the running Gateway and adds planner, handler, and isolated Gateway regression coverage.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

This is still necessary: current main classifies the affected subtree through the broad agents no-op rule, so a compaction-only edit never reaches the Gateway hot-reload handler. The PR promotes that existing configuration subtree to the canonical hot-reload plan and its added coverage matches the handler’s existing prepared-runtime refresh path; there are no actionable patch defects found. It remains open because it is maintainer-labeled and the current GitHub snapshot still has required checks in progress on a behind-but-clean branch.

Priority: P1
Reviewed head: ada789da40b763f12652aa4388ebab46fe2bfe23

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused root-cause fix with source-backed regression coverage and reported live Gateway proof; final readiness depends on the exact refreshed head completing its in-progress required checks.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied PR context records a 1/1 live Gateway automatic-compaction scenario and links the remote validation run; focused tests and the existing proof: sufficient review label corroborate that after-fix behavior.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied PR context records a 1/1 live Gateway automatic-compaction scenario and links the remote validation run; focused tests and the existing proof: sufficient review label corroborate that after-fix behavior.
Evidence reviewed 5 items Current-main defect: The current base rules have explicit hot rules for neighboring agent defaults but no agents.defaults.compaction rule; the later broad agents rule is a no-op, so these paths do not create a hot reason.
Existing hot-reload owner path: Every committed hot reload invalidates prepared model-runtime snapshots and then refreshes them using the candidate configuration before logging the applied hot reasons, so the proposed planner rule reaches the established owner boundary rather than adding a parallel mechanism.
Proposed canonical repair: The PR adds exactly one planner rule for agents.defaults.compaction; its remaining changes are focused regression tests for classification, handler behavior, and the Gateway scenario described in the linked issue.
Findings None None.
Security None None.

How this fits together

Gateway configuration changes are diffed into a reload plan, which decides whether to do nothing, refresh runtime state in place, or restart the Gateway. Automatic compaction settings feed model and transcript-compaction behavior, so their plan classification determines whether future compactions see an edited configuration.

flowchart LR
  A[OpenClaw config edit] --> B[Gateway config diff]
  B --> C[Reload plan classification]
  C -->|current main: no-op| D[No runtime update]
  C -->|PR: hot reload| E[Gateway hot-reload handler]
  E --> F[Prepared model runtime refresh]
  F --> G[Later automatic compaction]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is cleanly mergeable but behind main; refresh the exact merge head and let the in-progress required checks complete before landing.
  • Resolve merge risk (P1) - The maintainer label requires an explicit maintainer merge decision even though the source review found no patch defect.
  • Complete next step (P2) - This maintainer-labeled P1 repair already has a focused, viable implementation; the remaining action is to review the refreshed merge head and complete required CI rather than dispatch another fix worker.
Agent review details

Security

None.

PR surface

Source +1, Tests +383. Total +384 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 0 +1
Tests 3 383 0 +383
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 384 0 +384

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #114654
Summary: This PR is the focused candidate fix for the reported compaction-reload no-op; its planner rule and tests directly cover that issue’s stated mechanism.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the existing compaction configuration contract, classify its subtree as hot in the single Gateway reload planner, and land only after the rebased head has completed required CI.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the existing compaction configuration contract, classify its subtree as hot in the single Gateway reload planner, and land only after the rebased head has completed required CI.

Do we have a high-confidence way to reproduce the issue?

Yes, from current source: an agents.defaults.compaction.* path falls through to the broad agents no-op rule, while the only runtime refresh is reached through a non-no-op hot plan. This read-only review did not execute the failing Gateway scenario locally.

Is this the best way to solve the issue?

Yes. Adding the precise existing configuration subtree to the canonical Gateway reload plan is the narrowest owner-boundary repair because the established hot handler already publishes the candidate configuration and refreshes prepared model runtime state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 807506381a03.

Labels

Label justifications:

  • P1: This fixes an existing Gateway configuration edit that can silently leave later automatic compactions using stale runtime state.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied PR context records a 1/1 live Gateway automatic-compaction scenario and links the remote validation run; focused tests and the existing proof: sufficient review label corroborate that after-fix behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied PR context records a 1/1 live Gateway automatic-compaction scenario and links the remote validation run; focused tests and the existing proof: sufficient review label corroborate that after-fix behavior.

Evidence

What I checked:

  • Current-main defect: The current base rules have explicit hot rules for neighboring agent defaults but no agents.defaults.compaction rule; the later broad agents rule is a no-op, so these paths do not create a hot reason. (src/gateway/config-reload-plan.ts:138, 807506381a03)
  • Existing hot-reload owner path: Every committed hot reload invalidates prepared model-runtime snapshots and then refreshes them using the candidate configuration before logging the applied hot reasons, so the proposed planner rule reaches the established owner boundary rather than adding a parallel mechanism. (src/gateway/server-reload-hot.ts:497, 807506381a03)
  • Proposed canonical repair: The PR adds exactly one planner rule for agents.defaults.compaction; its remaining changes are focused regression tests for classification, handler behavior, and the Gateway scenario described in the linked issue. (src/gateway/config-reload-plan.ts:98, 2cf8a1b92c6b)
  • History and ownership: Blame assigns the current reload-rule block to the recent Gateway configuration work in commit 70394e190c; the adjacent hot-reload runtime path was subsequently maintained by the provider-auth reload repair in commit d2ad3e4229. (src/gateway/config-reload-plan.ts:83, 70394e190cf1)
  • Proof and CI state from review context: The PR body reports 371 focused owner tests and a 1/1 live Gateway automatic-compaction run; the supplied context carries proof: sufficient, while the current check snapshot still lists build, lint, type, QA, and compact test jobs as in progress. (ada789da40b7)

Likely related people:

  • wangyan2026: Current blame attributes the relevant base reload-rule region to this contributor’s recent configuration-plan commit. (role: recent reload-plan contributor; confidence: high; commits: 70394e190cf1; files: src/gateway/config-reload-plan.ts)
  • Qiong: Recent history shows this contributor maintained the adjacent Gateway hot-reload recovery behavior, including whether unrelated hot changes rewarm provider state. (role: recent hot-reload runtime contributor; confidence: medium; commits: d2ad3e42295b; files: src/gateway/server-reload-hot.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase or refresh the exact merge head if needed, then confirm the currently in-progress required checks finish successfully.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-02T14:40:56.029Z sha 2cf8a1b :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 38a5d39 into main Aug 2, 2026
120 checks passed
@steipete
steipete deleted the codex/issue-114654-compaction-hot-reload branch August 2, 2026 15:38
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
* fix(gateway): hot-reload automatic compaction settings

* test(gateway): isolate compaction hot-reload e2e coverage

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: agents.defaults.compaction.* reload is classified as a no-op but the value is captured per process — edits silently never apply

1 participant