Skip to content

improve(tests): reduce database module-identity setup time - #148223

Merged
steipete merged 1 commit into
mainfrom
codex/agent-db-module-identity-fixture-main
Sep 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/agent-db-module-identity-fixture-main

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The agent-database module-identity test spends most of its time building a large fixture graph before it checks database ownership.

User Impact

There is no user-visible behavior change. The test continues to exercise the real native host, public SQLite SDK and independently transformed plugin graph, including shared connections, queues, statement caches, transactions, observers and registry invalidation.

Why This Change Was Made

Use the existing reply-admission sibling’s tsdown fixture configuration, which matches the packaged build approach, while retaining the original entrypoints and exports. An explicit function-identity assertion also verifies that the plugin really evaluates a separate graph; it passed with the original builder too.

Only one test changes (+18/-7 lines). Production code, schemas, loader/cache settings, assertions and the existing 45-second case and 30-second child deadlines are preserved.

Evidence

On one pinned local source snapshot, the same case with the graph-identity assertion improved from 16.31s to 11.77s; command wall time improved from 18.01s to 13.18s. Separate diagnostics measured fixture construction at 11.28s versus 4.07s and generated output at 64.07MB versus 47.87MB. Jiti loading increased from 4.48s to 5.19s, so the improvement comes from fixture construction.

The one-file change was then applied independently to a canonical main snapshot. Its full case passed in 10.77s and the existing reply-admission identity sibling passed in 16.65s. All 20 classified checks passed, and independent P2 review found no actionable findings with unchanged source inputs.

The original Linux CI timeout was not reproduced locally. This is a measured fixture-build improvement; exact-head CI remains necessary before claiming that timeout is resolved.

@clawsweeper

clawsweeper Bot commented Sep 14, 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 size: XS maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 14, 2026, 8:06 AM ET / 12:06 UTC.

ClawSweeper review

What this changes

The PR switches the database module-sharing test’s fixture build to tsdown and adds an assertion that the transformed plugin evaluates a separate module graph.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this is a focused, useful test-performance improvement that is absent from inspected main and the latest release. No actionable correctness defect was found.

Likely related people: steipete (routing candidate, medium confidence).

Priority: P3
Reviewed head: 5216939a7f48947cf1fc55cd7d7f83f4fe2bc219

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused improvement with preserved coverage, an established build pattern, and useful reported measurements; no actionable defect was found.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER association exempts this internal test-only PR from contributor runtime proof; its body reports timings and passing executions of the changed database fixture and its sibling.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER association exempts this internal test-only PR from contributor runtime proof; its body reports timings and passing executions of the changed database fixture and its sibling.
Evidence reviewed 7 items Verified introduced change: The merge-base-to-head diff changes only fixture compilation and adds the separate-function-identity assertion; existing behavioral assertions, cleanup, and 30-second child and 45-second case deadlines remain intact. The host-verified test merge also changes only this test.
Existing fixture pattern: The reply-admission sibling uses the same tsdown configuration, including workspace dependency bundling, the fs-safe exception, explicit .js output, and disabled config discovery. The changed test retains its own distinct database ownership coverage.
Direct dependency contract: The changed test directly imports tsdown, which package.json already pins to 0.23.0. Inspected dependency source confirms alwaysBundle overrides normal production-dependency externalization; output source also confirms the .js extension callback contract. GitHub resolves v0.23.0 to this dependency commit.
Findings None None.
Security None None.

How this fits together

This test builds native host and SQLite SDK fixtures, then loads a transformed plugin through OpenClaw’s plugin loader. It checks that independently evaluated modules still share database connections, queues, transaction observers, and cache lifecycles.

flowchart LR
  A[Host and SDK source] --> B[tsdown fixture build]
  B --> C[Native host and SDK]
  B --> D[Transformed plugin loader]
  C --> E[Shared database owner]
  D --> E
  E --> F[Ownership and lifecycle assertions]
Loading

Before merge

  • Resolve merge risk (P2) - The reported local speedup does not establish that the original Linux CI timeout is resolved.
Agent review details

Security

None.

PR surface

Tests +11. Total +11 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 18 7 +11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 18 7 +11

Review metrics

Metric Value Why it matters
Reported matched case timing 16.31s before → 11.77s after The supplied measurement supports a meaningful setup-cost improvement without relaxing test deadlines.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the complete database ownership regression while reducing fixture construction cost through the established sibling build configuration.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the complete database ownership regression while reducing fixture construction cost through the established sibling build configuration.

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

Not applicable to this performance cleanup; the body supplies comparative timings but explicitly leaves the Linux timeout unreproduced. No tests were executed during this read-only review.

Is this the best way to solve the issue?

Yes: the patch reuses an established fixture-build pattern, preserves the meaningful behavioral checks, and strengthens verification that the transformed graph is independent.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is an internal test-performance improvement with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER association exempts this internal test-only PR from contributor runtime proof; its body reports timings and passing executions of the changed database fixture and its sibling.

Label justifications:

  • P3: This is an internal test-performance improvement with no production behavior change.
  • 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: The supplied MEMBER association exempts this internal test-only PR from contributor runtime proof; its body reports timings and passing executions of the changed database fixture and its sibling.

Evidence

What I checked:

  • Verified introduced change: The merge-base-to-head diff changes only fixture compilation and adds the separate-function-identity assertion; existing behavioral assertions, cleanup, and 30-second child and 45-second case deadlines remain intact. The host-verified test merge also changes only this test. (src/state/openclaw-agent-db-module-identity.test.ts:46, 5216939a7f48)
  • Existing fixture pattern: The reply-admission sibling uses the same tsdown configuration, including workspace dependency bundling, the fs-safe exception, explicit .js output, and disabled config discovery. The changed test retains its own distinct database ownership coverage. (src/auto-reply/reply/reply-turn-admission.module-identity.test.ts:37, 5216939a7f48)
  • Direct dependency contract: The changed test directly imports tsdown, which package.json already pins to 0.23.0. Inspected dependency source confirms alwaysBundle overrides normal production-dependency externalization; output source also confirms the .js extension callback contract. GitHub resolves v0.23.0 to this dependency commit. (src/features/deps.ts, ced9a2c7f3a7)
  • Current main still uses the original builder: The fetched main revision still imports esbuild and uses its original fixture configuration, so this optimization remains distinct work. (src/state/openclaw-agent-db-module-identity.test.ts:5, 7eb75ef60712)
  • Latest release check: The supplied latest release, v2026.9.4, also imports esbuild in this test. Its blob was unavailable locally, so the source was inspected through GitHub. (src/state/openclaw-agent-db-module-identity.test.ts:5, 3a9d69db306c)
  • Reported performance evidence: The complete supplied PR body reports matched case timings of 16.31s before and 11.77s after, fixture construction of 11.28s versus 4.07s, and passing database and reply-admission cases on a canonical-main snapshot. It explicitly does not claim reproduction or resolution of the original Linux CI timeout. These are contributor-reported measurements, not reviewer executions. (5216939a7f48)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@steipete

Copy link
Copy Markdown
Contributor Author

The merge-risk item is retained as a measurement limitation: this PR reduces fixture construction cost; it does not claim to reproduce or definitively fix the original intermittent Linux timeout. The same-machine comparison retains the complete database ownership regression, adds an independently evaluated graph assertion, and reduces construction from 11.28s to 4.07s using the existing reply-admission fixture configuration. The original 45-second case and 30-second child deadlines are unchanged. Jiti itself was slightly slower in the diagnostic pair, which is reported in the body.

The chosen mitigation is the review's first option: retain the complete ownership regression and land the measured setup improvement after exact-head CI is green. Subsequent normal-main and dependent-PR observations will establish whether the intermittent timeout persists. We will not weaken deadlines, retries, graph independence, or ownership assertions to declare it fixed.

@steipete
steipete merged commit afc14c7 into main Sep 14, 2026
100 checks passed
@steipete
steipete deleted the codex/agent-db-module-identity-fixture-main branch September 14, 2026 13:05
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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