Skip to content

fix(e2e): read bounded plugin summaries during upgrade checks - #178801

Closed
ChuLaiTheGreat wants to merge 2 commits into
openclaw:mainfrom
ChuLaiTheGreat:fix/e2e-bounded-plugin-index-summary-20261020
Closed

ChuLaiTheGreat wants to merge 2 commits into
openclaw:mainfrom
ChuLaiTheGreat:fix/e2e-bounded-plugin-index-summary-20261020

Conversation

@ChuLaiTheGreat

@ChuLaiTheGreat ChuLaiTheGreat commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The native upgrade-survivor recipe can finish updating a package, then fail while reading plugins.installedIndex: the stored JSON exceeds the E2E reader’s 1 MiB aggregate cap, even when the fields needed by its assertions fit within that cap. The two failing consumers only need complete install receipts and each plugin’s pluginId, enabled, and rootDir.

User Impact

Release validators can complete the upgrade checks when unrelated plugin catalogue metadata exceeds the full-reader limit. This changes validation tooling; it does not deploy or change a production runtime.

Why This Change Was Made

Add an explicit bounded summary reader for those two consumers. SQLite projects the required fields before returning JSON to Node; install receipts and their unknown fields remain complete. The projection preserves JSON types, missing fields and plugin order. Its required JSON is still capped at 1 MiB in UTF-8 bytes. The original full reader, writers, migration assertions and aggregate limit remain unchanged. Failure diagnostics expose only byte counts and plugin count.

Evidence

  • The Doctor-budget consumer regression fails against the pinned upstream base with ETOOBIG before invoking the new summary export. The final negative run uses the exact final test file against that base and fails on the expected ETOOBIG, not on a missing export or setup error.
  • The final index-reader suite passes 29 cases: oversized catalogue metadata, oversized required receipts and roots, UTF-8 byte limits, boolean/null/missing-field preservation, schema variants, fallback, and committed versus uncommitted WAL visibility.
  • The owning assertion suite (79 cases) and Doctor-budget suite (5 cases) passed on the preceding tree. The only subsequent change adds two pairs of braces in the index test; all three production modules and both other suites remain byte-identical. The Doctor fixture computes a budget; it does not execute Doctor.
  • The owning script-test type graph, typed lint for the three MJS files and test file, format, source line caps, assertion-safety and mock ratchets pass, with no allowance changes.
  • The global max-lines check still fails on three unchanged upstream UI files. The same native failure was reproduced on the pinned base plus an unrelated Gateway fixture; the UI files, configuration and guard blobs are identical. No UI source or limit is changed here.

Native upgrade-survivor proof

The complete native published-package sqlite-volume survivor recipe passes in run 39504398170, job 118909878709, completed 20 October 2026 at 22:49 UTC. Candidate package source is 09517e7ab48747e2935ffbab41d3c90d2bde4202 (tree fb409e5571e51267017a43b478f9052f5ce886c3); the actual mounted E2E tooling is public PR #178801, 637db088c3fb0edcf516c74d63892becbbd7466e (tree 10e70ebae01184a134d2b01eefffebb37f3f5bdc, sole parent 5a0b5006). The native entry point is bash scripts/e2e/upgrade-survivor-docker.sh, installing the complete candidate tarball through the shipped updater from published [email protected].

  • Full native publishable package: 122,402,366 bytes, SHA-256 80bef2833f9ee9f8327a32f16d9ab6ec2d78ee084bb684802827d4c4f903799e. Complete registry source/version/integrity validation passes for all four required packages.
  • The update succeeds in 1,444.545 seconds against the unchanged 1,500-second command budget. Docker/lane budgets remain 2,280 seconds / 2,580,000 ms, with the original 12 GiB / four-CPU fixture, original assertions and volume quotas.
  • The real index is still oversized: 1,063,044 raw bytes, including 1,060,022 plugin-array bytes and 2,314 install-receipt bytes. The required projection is 14,353 bytes, preserving complete receipts and 76 plugin entries. This is a fresh run of the unchanged scenario, not a claim that the earlier 1,063,050-byte failed artifact was recovered.
  • All 49 named phase end states pass, including automatic migration, survival, Gateway history, Doctor idempotence, Gateway restart, post-restart history and final restarted survival. The synthetic volume retains 4,800 sessions, 23,890 events and 2,200 cron jobs. Gateway RPC verifies eight conversation samples across two agents before and after restart; their complete exported sample arrays and message digests are identical.
  • The actual changed Doctor-budget consumer runs: persisted totals are 4,803 sessions / 23,893 events / 2,203 cron jobs / nine enabled distinct plugin roots, yielding the native 717-second budget. Doctor idempotence completes in 276 seconds and the native assertions pass afterward. The three additional baseline records explain the difference from the volume-only counts above.

Selected redacted native terminal output (the full job log is linked above):

sqlite-volume sessions=4800 events=23890 cronJobs=2200
plugin-index-summary {"raw":1063044,"summary":14353,"installRecords":2314,"plugins":1060022,"diagnostics":2,"pluginCount":76}
SQLite volume idempotence doctor completed in 276s (budget 717s).
sqlite-volume Gateway RPC verified 8 conversations across 2 agents
Upgrade survivor Docker E2E passed [email protected] scenario=sqlite-volume candidate=2026.10.5 updateRestartMode=manual idempotence=276s startup=143s updateRestart=manuals healthz=1s readyz=1s status=13s.
PACKAGE_SUMMARY {"head": "09517e7ab48747e2935ffbab41d3c90d2bde4202", "tree": "fb409e5571e51267017a43b478f9052f5ce886c3", "exit": 0}

The job is terminal success, with native driver exit 0 and successful final phase receipts. The four explicitly inspected host-owned package/image/mount/registry containers settle at exit 0 without OOM or a remaining PID; no unavailable inner-container inspect receipt is invented. Exported summaries are tail-limited and redacted, so the conclusion also uses the complete phase entries, valid targeted Gateway/budget receipts and native terminal result. This is synthetic package compatibility and actual shipped CLI/Gateway execution; it provides no live model/Telegram/account proof, production deployment, Clarity-10.3 migration qualification or idle-RAM comparison.

Related validation: #178124.

Conflict resolution on 21 October 2026

Head 0917b711a0e82b9f277b384bb9aaee892545169f integrates main 8c6ce699b3464044322e36d075e6ac219fe058a0 to resolve the test-fixture conflict introduced by upstream #179728. It preserves the upstream withSqlite cleanup/table refactor and this PR's extra fixture fields; the asynchronous WAL writer retains explicit rollback and close. All three production MJS modules are byte-identical to 637db088. Native Git also merges this head cleanly with the later main ce009c218d71084796395b9f83d7ee289b3b0f7d.

Fresh checks on tree de762b94f224e504eaff5ac22b8aec9c21bd9f2d: the index-reader file passes 29 cases and the Doctor-budget file passes five; the full native root-scripts type graph, typed lint for the test and three MJS files, and formatting pass. The combined test command still exited 2 because the remaining assertion suite initially lacked its declared QuickJS compile dependency. After that dependency was installed, its compiled-subprocess preparation hit the isolated 3.5 GiB container limit (Docker OOM event; compiler exit 137), before any assertion case ran. The subsequent fresh native assertion run now passes all 79 cases, with actual Docker State.ExitCode=0, PID 0, no OOM and verified container removal. It uses a 4 GiB container, a 1,536 MiB Node heap and two native compiler threads under the unchanged production parent caps. Together with the completed 29 index and five Doctor cases, this qualifies 113 distinct cases on the published tree; duplicated reporter summaries are counted once. The failed setup and OOM runs remain disclosed and are not relabeled as successes. The earlier assertion runs and complete shipped upgrade-survivor execution above retain their original tree identities; the packaged E2E has not been rerun or relabeled as a new-head packaged proof. At the final current-head readback, all 114 observed checks are terminal: 59 success, 54 skipped and one neutral, with no failure or running check. Skipped and neutral checks are not counted as test passes.

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. scripts Repository scripts size: M labels Oct 20, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 20, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Oct 20, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The PR adds a bounded SQLite summary reader for upgrade assertions and Doctor-budget measurement while preserving complete install receipts.

Example: An upgrade fixture contains a 1,063,044-byte plugin index with 76 plugins.

  • Before: Upgrade checks reject the full index because it exceeds the 1 MiB reader limit.
  • After: The checks consume a 14,353-byte required projection and complete successfully.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, useful repair with shipped-entry-point upgrade evidence, meaningful boundary coverage, passing current-head CI, and no open finding; persisted formats and writers remain unchanged.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Supplied native output from bash scripts/e2e/upgrade-survivor-docker.sh shows an upgrade from [email protected] exercising both changed consumers against an oversized index and completing survival, Doctor, and restart checks; GitHub confirms the linked job succeeded, and the exercised production modules are unchanged on the reviewed head.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Release validators can finish updating the package and then fail because irrelevant plugin catalogue metadata exceeds the validation reader's limit.
Reason: This restores the existing upgrade-validation contract with a narrow tooling change and preserves the original quotas, complete receipts, and frozen-schema compatibility.

Merge readiness

✅ Ready for maintainer review

This PR provides a focused fix for false upgrade-validation failures that remain possible on current main; no actionable correctness or security finding remains.

Priority: P2
Reviewed head: 0917b711a0e82b9f277b384bb9aaee892545169f

Before merge

None.

Findings

None.

Agent review details

How this fits together

The shared E2E plugin-index helper reads persisted plugin state and supplies install receipts and plugin fields to release-validation assertions and Doctor-budget calculation.

flowchart TD
  A[Persisted plugin index] --> B[Existing schema selector]
  B --> C[Bounded SQL projection]
  C --> D[Complete receipts and selected plugin fields]
  D --> E[Upgrade survival assertions]
  D --> F[Doctor budget calculation]
  B --> G[Unchanged full index reader]
Loading

Technical review

Best possible solution:

Use the existing helper's bounded projection for these two consumers while retaining complete-index reads for callers that compare catalogue metadata.

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

Current-main source rejects the entire persisted index above 1 MiB, and the contributor reports an exact-base negative control failing with ETOOBIG through the Doctor-budget consumer; no target code was executed during this review.

Is this the best way to solve the issue?

The fix addresses the read boundary without increasing quotas, dropping receipt fields, changing persisted state, or weakening upgrade assertions; the added reader strategies reuse existing schema selection and fallback ownership.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7db22d13bf4e.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit bccb649 adds scripts/e2e/lib/plugin-index-sqlite.mjs:170 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bccb649077f0; files: scripts/e2e/lib/plugin-index-sqlite.mjs)
  • Peter Steinberger: Raw commit 9f8e3f6 adds scripts/e2e/lib/upgrade-survivor/sqlite-volume.mjs:37 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9f8e3f657e8f; files: scripts/e2e/lib/upgrade-survivor/sqlite-volume.mjs)

PR surface

Tests +208, Other +121. Total +329 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 212 4 +208
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 132 11 +121
Total 4 344 15 +329

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The defect blocks a specific release-validation scenario without changing deployed runtime behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-20T22:26:01.049Z sha 637db08 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-20T23:00:32.032Z sha 637db08 :: needs maintainer review before merge. :: none

Reviewed October 21, 2026, 6:37 PM ET / 22:37 UTC (Revision 3).

@ChuLaiTheGreat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The requested after-fix native upgrade-survivor execution is now terminal success: https://github.com/ChuLaiTheGreat/openclaw/actions/runs/39504398170 (job 118909878709, native exit 0). I updated the PR body with redacted terminal excerpts, exact candidate/tooling identities, package digest, phase outcomes and limits.

Actual shipped updater: published [email protected] → complete source 09517e7 package. Actual E2E tooling: public 637db088 / #178801, native upgrade-survivor-docker.sh. The unchanged oversized-index fixture now reports 1,063,044 raw → 14,353 required bytes; all complete install receipts remain present. All 49 named phase end states pass, including automatic migration, survival, Gateway history, Doctor idempotence, Gateway restart and final survival. The actual Doctor-budget consumer computes 717 seconds from persisted counts and nine roots; Doctor completes in 276 seconds. Eight Gateway conversation samples across two agents have identical exported records/message digests before and after restart. Volume-only assertions retain 4,800 sessions / 23,890 events / 2,200 cron jobs.

Package build/registry/updater and installed identity pass; update takes 1,444.545 s against the unchanged 1,500 s command budget. The earlier failed runs remain disclosed; quotas, assertions, timeouts and resource caps are unchanged. This is genuine shipped CLI/Gateway synthetic execution, without live Telegram/model calls, client credentials, production deployment or a Clarity-10.3 migration/RAM claim.

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 20, 2026
@ChuLaiTheGreat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 0917b711a0e82b9f277b384bb9aaee892545169f resolves the main-branch SQLite fixture conflict while retaining the upstream cleanup refactor and the asynchronous WAL test's rollback/close. GitHub confirms mergeability.

The updated description records the fresh checks and their exact limits: 29 index cases and five Doctor-budget cases completed successfully; the unchanged assertion suite subsequently passes all 79 cases with native container exit 0, PID 0, no OOM and verified removal. The full native script-test type graph, typed lint and formatting pass. Earlier setup failures and the compiler OOM remain disclosed. All three production MJS files remain byte-identical to 637db088; the prior complete upgrade-survivor proof remains attributed to that tooling commit. Broad current-head CI is still pending.

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
steipete added a commit that referenced this pull request Oct 22, 2026
The E2E SQLite reader applied its byte cap before projecting fields, so large unrelated catalog metadata aborted upgrade checks. It now projects complete receipts and required plugin fields first, preserving the full reader's limits. Supersedes #178801, thanks @ChuLaiTheGreat.

Co-authored-by: Samuel Benainous <[email protected]>
@steipete

Copy link
Copy Markdown
Contributor

Thank you @ChuLaiTheGreat! We re-implemented this fix in #180458, which landed with you credited as co-author. Closing this one as superseded.

@steipete steipete closed this Oct 22, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
…law#180458)

The E2E SQLite reader applied its byte cap before projecting fields, so large unrelated catalog metadata aborted upgrade checks. It now projects complete receipts and required plugin fields first, preserving the full reader's limits. Supersedes openclaw#178801, thanks @ChuLaiTheGreat.

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

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts 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.

2 participants