Skip to content

fix(infra): import legacy plugin state partially (newest-first) instead of skipping when capacity is short - #109679

Merged
obviyus merged 3 commits into
mainfrom
fix/plugin-state-migration-partial-import
Jul 17, 2026
Merged

obviyus merged 3 commits into
mainfrom
fix/plugin-state-migration-partial-import

Conversation

@clawsweeper

@clawsweeper clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Fixes a regression from #108744 (13a52cf0a53): the startup preflight made legacy plugin-state imports all-or-nothing, so whenever the target namespace (or the 50k per-plugin cap) couldn't fit every missing legacy entry, the whole import was skipped. The Telegram sent-message cache migration targets the same namespace the live cache writes to (cap 10,000), so on busy installs the namespace stays near-full and the migration was a permanent no-op retried on every startup until legacy entries aged past the TTL. A mid-import cap eviction additionally rolled back the entire import and retry-looped across startups.

Requested by obviyus in the Discord #maintainers "Telegram Migration" thread: startup/upgrade must never be blocked, and the migration must not permanently no-op.

What changed

  • Partial, newest-first imports. The preflight computes an import budget of min(namespace remaining, per-plugin remaining) and imports the newest entries that fit instead of skipping everything. Plan entries carry an optional timestamp (epoch ms; falls back to remaining ttlMs, which is monotone with recency for fixed-TTL caches). The Telegram sent-message lister now provides it.
  • Eviction tolerance instead of whole-import rollback. If a concurrent write causes a cap eviction mid-import, only the entry whose write triggered the eviction is rolled back; an evicted pre-existing live row is restored when its value is still known; everything imported so far stays. The run pauses and defers the remainder.
  • Deferred remainder imports later. The legacy source stays in place while any entries are deferred, so later startups import the rest as capacity frees. Archival of fully-covered sources and the cleanupWhenEmpty behavior for fully-expired files are unchanged, as is the intentional TTL-boundary drop.
  • Consistent capacity math. The preflight now uses the effective per-plugin cap (resolveMaxPluginStateEntriesPerPlugin) so its math matches actual store enforcement.
  • Log messages now report partial progress, e.g. Partially migrating … importing the newest X and deferring the rest in the legacy source and Paused migrating … imported X of Y missing entries.

Tests

New/updated unit tests in doctor-state-migrations.test.ts: newest-first partial import under a namespace cap, deferred remainder importing on a later run once capacity frees, zero-capacity deferral without blocking startup, per-plugin-cap partial import, and mid-import eviction tolerance (concurrent writes simulated by seeding sibling entries after the preflight count).

Evidence / verification
  • Regression source: fix: prevent Telegram migration no-op loops #108744, commit 13a52cf0a53; skip site was src/infra/state-migrations.plugin-state.ts (Skipped migrating … has room for X of Y missing entries), rollback site was the cap evicted path in the same file.
  • Telegram sent-message cache: TELEGRAM_SENT_MESSAGE_CACHE_MAX_ENTRIES = 10_000, live cache and migration share telegram.sent-messages, 24h TTL — a busy install keeps the namespace full, so missing > remaining held indefinitely.
  • pnpm vitest run src/commands/doctor-state-migrations.test.ts → 89 passed
  • pnpm vitest run src/plugin-state/ → 64 passed
  • pnpm vitest run --config test/vitest/vitest.extension-telegram.config.ts extensions/telegram/src/state-migrations.test.ts extensions/telegram/src/send.test.ts → 182 passed
  • pnpm tsgo:all clean; oxlint / oxfmt --check clean on changed files

🤖 Generated with Claude Code

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram commands Command implementations size: M labels Jul 17, 2026
@obviyus obviyus self-assigned this Jul 17, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex review: needs maintainer review before merge. Reviewed July 17, 2026, 3:44 AM ET / 07:44 UTC.

Summary
Changes legacy plugin-state migration to import the newest capacity-safe subset, defer remaining entries, tolerate concurrent cap eviction, and preserve original creation timestamps.

PR surface: Source +131, Tests +247. Total +378 across 6 files.

Reproducibility: no. live current-main reproduction was established in this review, but the failure is source-reproducible: a near-full shared Telegram namespace makes the all-or-nothing preflight repeatedly skip every missing legacy row.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/plugin-state/plugin-state-store.ts, persistent cache schema: src/commands/doctor-state-migrations.test.ts, serialized state: src/infra/state-migrations.plugin-state.ts, unknown-data-model-change: src/commands/doctor-state-migrations.test.ts, unknown-data-model-change: src/infra/state-migrations.plugin-state.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: canonical
Canonical: #109679
Summary: This PR is the canonical follow-up for the capacity regression introduced by the already-merged Telegram migration preflight change.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] Merging changes shipped upgrade behavior from all-or-nothing migration to partial, newest-first imports with deferred retry, so maintainers must explicitly accept the new persisted-state semantics.
  • [P1] An error in capacity or eviction restoration could discard fresher Telegram sent-message cache rows or leave legacy sources retrying across startups, affecting bot-sent-message recognition and reaction event handling.

Maintainer options:

  1. Land after owner approval and exact-head gates (recommended)
    Merge once the assigned owner confirms partial-import upgrade semantics and the current head completes required checks.
  2. Pause for a source-blind upgrade run
    Require an end-to-end openclaw doctor --fix scenario with a near-full Telegram namespace before approving the migration behavior.

Next step before merge

  • No mechanical patch defect remains; the next action is owner approval of the upgrade semantics followed by completion of exact-head checks.

Maintainer decision needed

  • Question: Should upgrades replace the shipped all-or-nothing plugin-state import with newest-first partial imports that retain the legacy source until the remainder fits?
  • Rationale: Both behaviors are internally consistent, but the choice changes persisted-state upgrade and eviction semantics for existing installations and therefore needs explicit owner acceptance.
  • Likely owner: obviyus — The discussion identifies @obviyus as requesting the migration behavior and the PR is assigned to them.
  • Options:
    • Approve bounded partial imports (recommended): Accept the branch semantics because they keep startup non-blocking while making forward migration progress without treating old rows as fresh.
    • Keep all-or-nothing imports: Retain the shipped behavior and accept that capacity-constrained namespaces may defer the full legacy source until enough space becomes available.

Security
Cleared: The diff changes internal migration and SQLite write behavior without adding dependencies, external code execution, permissions, secrets access, or supply-chain surface.

Review details

Best possible solution:

Use the bounded newest-first migration with original-age preservation and deferred remainder, then land it only after exact-head gates pass and the migration owner confirms the upgrade semantics.

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

No live current-main reproduction was established in this review, but the failure is source-reproducible: a near-full shared Telegram namespace makes the all-or-nothing preflight repeatedly skip every missing legacy row.

Is this the best way to solve the issue?

Yes, this is the narrowest maintainable fix found: capacity-bounded newest-first imports make progress without blocking startup, while the migration-only timestamp path preserves existing eviction ordering.

AGENTS.md: unclear because the file could not be read completely.

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

Label changes

Label justifications:

  • P1: The regression can make a real Telegram upgrade migration permanently no-op on busy installations, leaving a broken channel-state workflow across startups.
  • merge-risk: 🚨 compatibility: The PR changes persisted plugin-state migration, capacity, retry, and eviction behavior for existing installations during upgrade.
  • merge-risk: 🚨 message-delivery: Incorrect migration or eviction handling could remove or defer Telegram sent-message records used to recognize bot-authored messages and emit reaction events.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a ClawSweeper bot PR, so the external-contributor proof gate does not apply; focused tests and CI remain supporting validation rather than live behavior proof.
Evidence reviewed

PR surface:

Source +131, Tests +247. Total +378 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 5 172 41 +131
Tests 1 260 13 +247
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 432 54 +378

What I checked:

Likely related people:

  • steipete: Authored and merged the capacity-preflight behavior in pull request fix: prevent Telegram migration no-op loops #108744, whose all-or-nothing semantics this PR revises. (role: introduced current behavior; confidence: high; commits: 13a52cf0a530; files: src/infra/state-migrations.plugin-state.ts, src/commands/doctor-state-migrations.test.ts, extensions/telegram/src/sent-message-cache.ts)
  • obviyus: The PR discussion identifies @obviyus as requesting the non-blocking partial migration behavior, and the timeline shows assignment for this follow-up. (role: requesting reviewer and assignee; confidence: medium; files: src/infra/state-migrations.plugin-state.ts, extensions/telegram/src/sent-message-cache.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (3 earlier review cycles)
  • reviewed 2026-07-17T05:48:30.700Z sha e2f5d6c :: needs changes before merge. :: [P1] Preserve legacy age in the eviction order
  • reviewed 2026-07-17T07:01:25.893Z sha 1971dfc :: needs maintainer review before merge. :: none
  • reviewed 2026-07-17T07:34:33.333Z sha 59588cd :: needs maintainer review before merge. :: none

@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the P1 in 1971dfc6: imported legacy rows now keep their original created_at via a migration-only write path (recommended option 1), with a regression test proving the next live write evicts the migrated row, not fresher pre-existing state.

What changed
  • pluginStateRegister accepts an internal createdAtMs override; normal plugin-facing register behavior is unchanged (src/plugin-state/plugin-state-store.sqlite.ts).
  • New registerMigratedPluginStateEntry facade export — migration-only, validates inputs like register, preserves the legacy timestamp (src/plugin-state/plugin-state-store.ts). Not exposed on the plugin SDK keyed-store surface.
  • The migration runner routes imports and mid-import cap-eviction restores through this path, so restored pre-existing rows also keep their original created_at instead of being re-stamped (src/infra/state-migrations.plugin-state.ts).
  • Regression test: seed a fresh live row → partially import an older legacy row → one more live write; asserts the migrated row (persisted createdAt === 2000) is evicted and the fresher pre-existing row survives (src/commands/doctor-state-migrations.test.ts).

Local runs (all green):

  • node scripts/run-vitest.mjs src/commands/doctor-state-migrations.test.ts — 90 passed
  • node scripts/run-vitest.mjs src/plugin-state/ — 64 passed
  • node scripts/run-vitest.mjs extensions/telegram/src/state-migrations.test.ts — 9 passed
  • pnpm tsgo, oxlint shards, oxfmt --check, git diff --check — clean

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@clawsweeper clawsweeper Bot added 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 17, 2026
openclaw-clawsweeper[bot] and others added 2 commits July 17, 2026 07:26
…r-nothing

PR #108744 (13a52cf) made the startup preflight skip a legacy
plugin-state import entirely whenever the target namespace (or the
per-plugin cap) could not fit every missing entry, and rolled back the
whole import when a mid-import cap eviction was detected. For caches
whose migration targets the same namespace the live cache writes to
(e.g. the Telegram sent-message cache), a busy install keeps the
namespace near-full, so the migration became a permanent no-op that
retried on every startup until legacy entries aged out.

- Import newest-first up to the remaining capacity (namespace and
  per-plugin) instead of skipping everything; entries carry an optional
  timestamp (falling back to remaining TTL) for recency ordering.
- On a mid-import cap eviction, roll back only the entry whose write
  triggered the eviction, restore the evicted live row when its value
  is still known, and keep everything imported so far.
- Leave the legacy source in place while entries remain deferred so
  later startups import the remainder as capacity frees; archival of
  fully-covered or empty sources is unchanged.
- Preflight now uses the effective per-plugin cap so capacity math
  matches store enforcement.

Requested by obviyus: startup/upgrade must never be blocked and the
migration must not permanently no-op.

Co-Authored-By: Claude Fable 5 <[email protected]>
…y write path

Imported legacy rows previously went through the normal register path,
which stamps created_at with the import time. Because cap eviction
removes the smallest created_at first, older migrated rows became the
newest rows in the namespace, so the next live write could evict fresher
pre-existing entries before the legacy ones. Route imports (and mid-import
restores) through a migration-only write that keeps the legacy timestamp,
and add a regression test proving the next live write evicts the migrated
row instead of the fresher existing row.

Co-Authored-By: Claude Fable 5 <[email protected]>
@clawsweeper
clawsweeper Bot force-pushed the fix/plugin-state-migration-partial-import branch from 1971dfc to 59588cd Compare July 17, 2026 07:28
@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (59588cd3, was 62 behind) — clean rebase, no conflicts, addressing the remaining P1 refresh items from the review.

Local verification after rebase (all green)
  • node scripts/run-vitest.mjs src/commands/doctor-state-migrations.test.ts — 90 passed
  • node scripts/run-vitest.mjs src/plugin-state/ — 64 passed
  • node scripts/run-vitest.mjs extensions/telegram/src/state-migrations.test.ts — 9 passed
  • pnpm tsgo, oxlint, oxfmt --check, git diff --check — clean

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper automerge

1 similar comment
@obviyus

obviyus commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper automerge

@clawsweeper

clawsweeper Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor Author

🦞🔧
ClawSweeper automerge is enabled.

Draft PRs stay fix-only until GitHub marks them ready for review. Pause with /clawsweeper stop.

Automerge progress:

  • 2026-07-17 08:24:51 UTC review queued 01f2bb9ea6aa (queued)

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label Jul 17, 2026
@obviyus
obviyus merged commit 2dee283 into main Jul 17, 2026
125 checks passed
@obviyus
obviyus deleted the fix/plugin-state-migration-partial-import branch July 17, 2026 10:38
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
steipete added a commit that referenced this pull request Oct 13, 2026
Share existing config-path and retired-media traversal owners. Remove speculative
rollback, retry, reentry, and diagnostic freshness machinery while preserving
security effect checks, ordinary cleanup settlement, resource bounds, and public
config, CLI, protocol, and persisted-data shapes. Phase E is untouched.

Production delta: 335 net lines removed (+97/-432) across 16 old files.
Focused proof: 311 tests in 25 files; final embedding/shutdown proof: 91 tests
in 4 files. Independent scoped review found no actionable P0-P2 findings.
Published as a branch only under the campaign's below-500 rule, not a PR.

Best-effort tradeoffs accepted

- Overlapping failed env publications may require reload/restart instead of ordered compensation; #105289/#103736 document synthetic harness proof, not a human actual-use report.
- Failed in-process restart preparation/emission requires explicit config reapply or manual restart; #105289/#160375 describe synthetic timing, not a transient transport failure.
- A mount changed during sampling may briefly be attributed to its parent filesystem until the next snapshot; #149792 uses forced mount fixtures, without a human incident.
- CLI provider cleanup is attempted once; #113471's blocked-close fixtures do not establish a transient failed-close incident, and the CLI exits on cleanup failure.
- Requested-head CI details are a snapshot until refresh; #148464's synthetic push/rerun interleavings do not justify rereading the head and check inventory after fetching jobs.
- A malformed catalog resolver may repeat rejection until the existing 16-fallback bound instead of an earlier identity bailout; #92175/#89456 are synthetic trust-harness work, and every trust check remains.
- Model normalizers must not reenter the same resolver; #156076's callback reentry is synthetic. Measured lookup caches and ordinary callback errors/order remain.
- Offline plugin-state imports assume no unsupported same-destination writer after capacity preflight; #109679's ordinary near-capacity import remains fixed, while concurrent eviction compensation came from synthetic sibling seeding.
- A delayed update verification reply may repeat a terminal broadcast or briefly show old status; #160592 supplies synthetic ordering proof, while durable effect idempotency, FIFO, repair authority, and shutdown joining remain.
- A malformed reply from the fixed inline CA worker may fail instead of using a dedicated invalid-result fallback; #112338/#112336 do not report a human malformed-message incident. Timeout/error/exit handling remains.
- Failed Gateway embedding cleanup blocks only its agent/provider scope until restart instead of retaining provider objects and retrying close; #113471 documents synthetic blocked-close proof, not a human failed-close incident. Local FIFO cleanup, remote concurrency, abort handling, authority, and normal shutdown settlement remain.
steipete added a commit that referenced this pull request Oct 13, 2026
…#170826)

* refactor: simplify older agent and channel execution paths

Consolidate duplicate payload and metadata projections under their existing owners. Simplify internal bookkeeping and bounded cache invalidation while retaining public SDK contracts, security-effect authority, ordinary concurrency, and durable user state.

* refactor: retain branch cache pending complete old-code cutover

Withdraw the branch-cache cluster because completing its unused-export cleanup requires an infra owner touched this week. Preserve the original cache, regression assertions, and docs. The remaining old-code lane removes 424 net production lines and is branch-only under the campaign BELOW-500 rule.

* refactor: simplify old gateway, config, and CLI bookkeeping

Share existing config-path and retired-media traversal owners. Remove speculative
rollback, retry, reentry, and diagnostic freshness machinery while preserving
security effect checks, ordinary cleanup settlement, resource bounds, and public
config, CLI, protocol, and persisted-data shapes. Phase E is untouched.

Production delta: 335 net lines removed (+97/-432) across 16 old files.
Focused proof: 311 tests in 25 files; final embedding/shutdown proof: 91 tests
in 4 files. Independent scoped review found no actionable P0-P2 findings.
Published as a branch only under the campaign's below-500 rule, not a PR.

Best-effort tradeoffs accepted

- Overlapping failed env publications may require reload/restart instead of ordered compensation; #105289/#103736 document synthetic harness proof, not a human actual-use report.
- Failed in-process restart preparation/emission requires explicit config reapply or manual restart; #105289/#160375 describe synthetic timing, not a transient transport failure.
- A mount changed during sampling may briefly be attributed to its parent filesystem until the next snapshot; #149792 uses forced mount fixtures, without a human incident.
- CLI provider cleanup is attempted once; #113471's blocked-close fixtures do not establish a transient failed-close incident, and the CLI exits on cleanup failure.
- Requested-head CI details are a snapshot until refresh; #148464's synthetic push/rerun interleavings do not justify rereading the head and check inventory after fetching jobs.
- A malformed catalog resolver may repeat rejection until the existing 16-fallback bound instead of an earlier identity bailout; #92175/#89456 are synthetic trust-harness work, and every trust check remains.
- Model normalizers must not reenter the same resolver; #156076's callback reentry is synthetic. Measured lookup caches and ordinary callback errors/order remain.
- Offline plugin-state imports assume no unsupported same-destination writer after capacity preflight; #109679's ordinary near-capacity import remains fixed, while concurrent eviction compensation came from synthetic sibling seeding.
- A delayed update verification reply may repeat a terminal broadcast or briefly show old status; #160592 supplies synthetic ordering proof, while durable effect idempotency, FIFO, repair authority, and shutdown joining remain.
- A malformed reply from the fixed inline CA worker may fail instead of using a dedicated invalid-result fallback; #112338/#112336 do not report a human malformed-message incident. Timeout/error/exit handling remains.
- Failed Gateway embedding cleanup blocks only its agent/provider scope until restart instead of retaining provider objects and retrying close; #113471 documents synthetic blocked-close proof, not a human failed-close incident. Local FIFO cleanup, remote concurrency, abort handling, authority, and normal shutdown settlement remain.

* refactor: defer pricing cache cleanup touched on main

Withdraw the usage-format production and paired test changes after main landed afc559c, keeping the hard seven-day old-code exclusion. Both files match the pre-campaign base, so main retains its interrupted-stream usage repair. The remaining reviewed o05/o06 union removes 713 net production lines across 42 files.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…openclaw#170826)

* refactor: simplify older agent and channel execution paths

Consolidate duplicate payload and metadata projections under their existing owners. Simplify internal bookkeeping and bounded cache invalidation while retaining public SDK contracts, security-effect authority, ordinary concurrency, and durable user state.

* refactor: retain branch cache pending complete old-code cutover

Withdraw the branch-cache cluster because completing its unused-export cleanup requires an infra owner touched this week. Preserve the original cache, regression assertions, and docs. The remaining old-code lane removes 424 net production lines and is branch-only under the campaign BELOW-500 rule.

* refactor: simplify old gateway, config, and CLI bookkeeping

Share existing config-path and retired-media traversal owners. Remove speculative
rollback, retry, reentry, and diagnostic freshness machinery while preserving
security effect checks, ordinary cleanup settlement, resource bounds, and public
config, CLI, protocol, and persisted-data shapes. Phase E is untouched.

Production delta: 335 net lines removed (+97/-432) across 16 old files.
Focused proof: 311 tests in 25 files; final embedding/shutdown proof: 91 tests
in 4 files. Independent scoped review found no actionable P0-P2 findings.
Published as a branch only under the campaign's below-500 rule, not a PR.

Best-effort tradeoffs accepted

- Overlapping failed env publications may require reload/restart instead of ordered compensation; openclaw#105289/openclaw#103736 document synthetic harness proof, not a human actual-use report.
- Failed in-process restart preparation/emission requires explicit config reapply or manual restart; openclaw#105289/openclaw#160375 describe synthetic timing, not a transient transport failure.
- A mount changed during sampling may briefly be attributed to its parent filesystem until the next snapshot; openclaw#149792 uses forced mount fixtures, without a human incident.
- CLI provider cleanup is attempted once; openclaw#113471's blocked-close fixtures do not establish a transient failed-close incident, and the CLI exits on cleanup failure.
- Requested-head CI details are a snapshot until refresh; openclaw#148464's synthetic push/rerun interleavings do not justify rereading the head and check inventory after fetching jobs.
- A malformed catalog resolver may repeat rejection until the existing 16-fallback bound instead of an earlier identity bailout; openclaw#92175/openclaw#89456 are synthetic trust-harness work, and every trust check remains.
- Model normalizers must not reenter the same resolver; openclaw#156076's callback reentry is synthetic. Measured lookup caches and ordinary callback errors/order remain.
- Offline plugin-state imports assume no unsupported same-destination writer after capacity preflight; openclaw#109679's ordinary near-capacity import remains fixed, while concurrent eviction compensation came from synthetic sibling seeding.
- A delayed update verification reply may repeat a terminal broadcast or briefly show old status; openclaw#160592 supplies synthetic ordering proof, while durable effect idempotency, FIFO, repair authority, and shutdown joining remain.
- A malformed reply from the fixed inline CA worker may fail instead of using a dedicated invalid-result fallback; openclaw#112338/openclaw#112336 do not report a human malformed-message incident. Timeout/error/exit handling remains.
- Failed Gateway embedding cleanup blocks only its agent/provider scope until restart instead of retaining provider objects and retrying close; openclaw#113471 documents synthetic blocked-close proof, not a human failed-close incident. Local FIFO cleanup, remote concurrency, abort handling, authority, and normal shutdown settlement remain.

* refactor: defer pricing cache cleanup touched on main

Withdraw the usage-format production and paired test changes after main landed 7a00a9f, keeping the hard seven-day old-code exclusion. Both files match the pre-campaign base, so main retains its interrupted-stream usage repair. The remaining reviewed o05/o06 union removes 713 net production lines across 42 files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge commands Command implementations merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. 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.

1 participant