Repository navigation
test(core): remove orphan test exports - #122500
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 2:56 AM ET / 06:56 UTC. ClawSweeper reviewWhat this changesRemoves zero-caller test-only exports and makes the Gateway usage fixture return the canonical SQLite session marker expected by detail handlers. Merge readinessKeep open: this maintainer-authored cleanup has a coherent, narrow test-boundary fix and no correctness finding; wait for exact-head CI before merge. Priority: P3 Review scores
Verification
How this fits togetherGateway usage detail requests resolve a stored session into a canonical SQLite transcript marker before loading time-series or log data. The changed fixture represents that resolution boundary, while the other edits narrow internal test-only interfaces. flowchart LR
A[Gateway usage request] --> B[Stored session lookup]
B --> C[Canonical SQLite target]
C --> D[Usage detail loader]
E[Test-only exports] --> F[Current test consumers]
F --> G[Focused regression coverage]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -9, Tests +7. Total -2 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain only the current test-facing interfaces and land the fixture update after exact-head CI confirms the cleanup against the current base. Do we have a high-confidence way to reproduce the issue? Yes, source identifies a deterministic focused path: run the sessions-usage suite against the base and PR head; this read-only review did not execute it. Is this the best way to solve the issue? Yes. Deleting zero-caller test interfaces and injecting the resolver's canonical marker is narrower and more maintainable than preserving aliases or relying on a retired store-path shape. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1fd7eedb3304. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for
OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/tmp/openclaw-vitest-orphan-core-final node scripts/run-vitest.mjs src/gateway/server-methods/usage.test.ts src/gateway/server-methods/usage.sessions-usage.test.ts src/gateway/server-methods/usage.sessions-usage-cache.test.ts src/gateway/openai-http.test.ts src/gateway/openai-http.usage.test.ts src/infra/session-cost-usage.test.ts extensions/memory-core/src/dreaming-startup-cleanup.test.ts extensions/memory-core/src/dreaming-narrative.test.ts extensions/qa-lab/src/suite-runtime-agent-session.test.ts test/dreaming-startup-cleanup.e2e.test.tsThe E2E project rebuilt TypeScript and bundled plugin assets successfully.
pnpm plugin-sdk:surface:check
OPENCLAW_TESTBOX=1 scripts/pr prepare-run 122500It accepted the hosted exact-head gates with Blacksmith/Testbox was unavailable as a standalone local executable on this host, so pre-push trusted heavy proof used the documented local fallback; native prepare subsequently verified hosted exact-head CI. Delta: test-support production -9 lines, focused test fixture +7 net lines, overall -2. |
|
Merged via squash.
|
What Problem This Solves
Three core test-only surfaces retained eight unused exports after their original direct tests were removed or moved to owner boundaries. While validating their removal, the current
mainGateway usage suite also exposed a stale file-era mock: it passed a retired JSON store path into the real canonical SQLite resolver, causing seven tests to fail before usage loading.Why This Change Was Made
Remove only the zero-caller aliases/properties while retaining every live production function and public compatibility export. Update the Gateway composition fixture to return a canonical SQLite marker explicitly; the dedicated infra resolver suite continues to own real SQLite identity and stale-target behavior.
User Impact
No intended user-visible change. Gateway usage, OpenAI HTTP image limits, SQLite transcripts, and Plugin SDK runtime behavior are unchanged. Test-support surface is smaller, and the previously red
sessions.usagesuite passes again against canonical storage semantics.Evidence
sessions.usagefailures on cleanmain; all returnedINVALID_REQUESTbefore the export cleanup was involved.pnpm plugin-sdk:surface:checkpassed with no package-exported forbidden subpaths.git diff --check: clean.AI-assisted maintenance cleanup; callers, public compatibility boundaries, storage ownership, retained resolver proof, and current-main failure behavior were reviewed directly.