Skip to content

test(qa): cover Gateway usage and memory APIs - #118995

Merged
vincentkoc merged 1 commit into
mainfrom
test/qa-gateway-usage-memory-apis
Aug 3, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
test/qa-gateway-usage-memory-apis

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Adds repeatable QA coverage for the authenticated Gateway usage and memory API surface after SQLite-backed session usage details were restored in #118918.

Scope

  • Starts an isolated token-authenticated Gateway with deterministic SQLite session state.
  • Verifies usage.status, usage.cost, sessions.usage, sessions.usage.timeseries, and sessions.usage.logs.
  • Confirms canonical stored sessions no longer expose the retired sessionFile field.
  • Verifies invalid session references return an actionable INVALID_REQUEST.
  • Verifies doctor.memory.status reports explicit unavailability when the memory plugin is disabled.
  • Registers gateway.usage-and-memory-apis in the QA scenario catalog.

Evidence

  • Exact commit: 5d11394cc21c75ee7a2b4d763f9ff2d47f11afa4
  • Rebased onto frozen main head 3d65ea2a1b54f4ef1dea66a6e2b17bf6a61836e7
  • Blacksmith Testbox: tbx_01kz4v4pv0qma561phz10e5xkg
  • Focused Gateway E2E: 1/1 passed
  • QA coverage lookup: exactly one matching scenario; no live requirements
  • Path-scoped pnpm check:changed: passed the fail-safe all-lanes gate
  • Exact-head hosted preparation: passed (hosted_exact_or_recent_parent)
  • Direct-Codex autoreview: clean, no accepted/actionable findings; patch correct (0.99)
  • Testbox run: https://github.com/openclaw/openclaw/actions/runs/30857968475
  • LOC: production 0; QA scenario +26; E2E test +345

ClawSweeper Disposition

  • Exact head 5d11394cc21c75ee7a2b4d763f9ff2d47f11afa4 reviewed with no findings and no security concern.
  • Latest rank-up move applied: the durable review and its rank-up section were read before landing.
  • The stored-data heuristic is not applicable: this PR changes no production schema, migration, cache, or persisted runtime state; its SQLite database exists only inside isolated test state.

Dependency

Built on the landed prerequisite #118918 at d3ea24c669da8148be7df27d47dfca7d662b378b.

Changelog not required: test-only QA coverage.

AI-assisted: yes. The implementation and evidence above were reviewed before submission.

@vincentkoc vincentkoc self-assigned this Aug 3, 2026
@vincentkoc
vincentkoc force-pushed the test/qa-gateway-usage-memory-apis branch from 6d812b2 to 5d11394 Compare August 3, 2026 22:31
@vincentkoc
vincentkoc marked this pull request as ready for review August 3, 2026 22:32
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 7:08 PM ET / 23:08 UTC.

ClawSweeper review

What this changes

Adds a QA scenario and authenticated WebSocket end-to-end test for Gateway usage summaries, SQLite-backed session details, invalid session handling, and disabled-memory status.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for normal maintainer review. The test-only PR adds valid authenticated Gateway regression coverage for the already-landed SQLite usage repair, with no blocking correctness or security finding.

Priority: P3
Reviewed head: 5d11394cc21c75ee7a2b4d763f9ff2d47f11afa4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused transport-level regression test with a clean test-only scope and no supported defect finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored test-only PR is outside the external-contributor proof gate; its body and completed checks nevertheless report an isolated authenticated Gateway run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored test-only PR is outside the external-contributor proof gate; its body and completed checks nevertheless report an isolated authenticated Gateway run.
Evidence reviewed 5 items Clean test-only diff: The branch adds one QA YAML scenario and one E2E test; git's whitespace check is clean.
Real Gateway boundary is exercised: The test seeds a canonical session, starts a token-authenticated Gateway, and calls the public usage and memory RPCs over WebSocket.
Current Gateway contracts match the assertions: Current handlers resolve canonical SQLite targets, reject invalid keys, and serve the asserted usage detail RPCs; disabled memory returns an explicit unavailable projection.
Findings None None.
Security None None.

How this fits together

QA Lab registers YAML scenarios that execute isolated runtime tests. This test seeds canonical SQLite session data, sends authenticated Gateway RPCs, and verifies the usage and memory-status responses operators receive.

flowchart LR
A[QA scenario catalog] --> B[Gateway E2E test]
B --> C[Isolated SQLite session state]
C --> D[Authenticated Gateway]
D --> E[Usage and memory RPCs]
E --> F[Response assertions]
F --> G[QA coverage result]
Loading

Before merge

  • Resolve merge risk (P1) - The provided context omits the latest ClawSweeper comment content, so its rank-up moves must be checked before landing.
  • Complete next step (P2) - No repair lane is needed because the review found no actionable defect; this maintainer-owned PR remains for normal review.
Agent review details

Security

None.

PR surface

Tests +345, Other +26. Total +371 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 345 0 +345
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 26 0 +26
Total 2 371 0 +371

Review metrics

Metric Value Why it matters
Production versus test LOC production +0, tests +371 The added surface is entirely QA coverage, so it introduces no production behavior or upgrade contract.

Stored data model

Persistent data-model change detected: migration/backfill/repair: qa/scenarios/runtime/gateway-usage-memory-apis.yaml, persistent cache schema: test/e2e/qa-lab/runtime/gateway-usage-memory-apis.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep this transport-level regression coverage in QA Lab and land it once the existing ClawSweeper rank-up instructions and current merge result are confirmed.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep this transport-level regression coverage in QA Lab and land it once the existing ClawSweeper rank-up instructions and current merge result are confirmed.

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

Not applicable: this PR adds regression coverage for a merged fix rather than reporting a new unresolved bug.

Is this the best way to solve the issue?

Yes. Exercising the authenticated Gateway transport with real isolated SQLite state is stronger and more maintainable than duplicating handler-level mocks.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is test-only regression coverage with no current user-facing defect or 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: This MEMBER-authored test-only PR is outside the external-contributor proof gate; its body and completed checks nevertheless report an isolated authenticated Gateway run.

Label justifications:

  • P3: This is test-only regression coverage with no current user-facing defect or 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: This MEMBER-authored test-only PR is outside the external-contributor proof gate; its body and completed checks nevertheless report an isolated authenticated Gateway run.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Authored the merged SQLite usage-resolution repair that this PR covers and is the most recent identifiable contributor to the current owner path. (role: recent area contributor; confidence: high; commits: d3ea24c669da; files: src/gateway/server-methods/usage.ts, test/e2e/qa-lab/runtime/gateway-usage-memory-apis.e2e.test.ts)

Rank-up moves

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

  • Confirm the latest ClawSweeper rank-up moves before landing.

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.

@vincentkoc
vincentkoc merged commit e110b56 into main Aug 3, 2026
152 of 157 checks passed
@vincentkoc
vincentkoc deleted the test/qa-gateway-usage-memory-apis branch August 3, 2026 23:11
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit to clawSean/openclaw that referenced this pull request Aug 3, 2026
* origin/main: (1301 commits)
  fix(sms): align MMS retries with network timeouts (openclaw#119002)
  test(qa): cover composed tool result consumption (openclaw#118991)
  test(cron): cover delivery outcomes (openclaw#118993)
  test(qa): cover guarded media fetch boundaries (openclaw#118857)
  test(qa): cover music generation controls (openclaw#118901)
  test(qa): cover core vision routing (openclaw#118861)
  test(qa): cover Gateway usage and memory APIs (openclaw#118995)
  fix(docker): use authenticated gateway health command (openclaw#118996)
  test(plugins): align tool fixtures with owner policy (openclaw#118959)
  test(qa): cover managed gateway service lifecycle (openclaw#118855)
  test(qa): cover audio proxy and limit handling (openclaw#118863)
  test(qa): cover PDF extraction dispatch (openclaw#118860)
  test(ui): add service-worker update primary QA proof (openclaw#118805)
  test(qa): cover CLI onboarding and plugin install sources (openclaw#118882)
  test(qa): cover remote logging boundaries (openclaw#118951)
  fix(sms): retry transient MMS failures before durable adoption (openclaw#118994)
  test(qa): cover video generation invocation (openclaw#118864)
  test(qa): cover media reference intake (openclaw#118858)
  test(qa): cover image generation task lifecycle (openclaw#118915)
  feat(sms): track Twilio delivery status (openclaw#118665)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab 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: 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