Skip to content

fix(qa-lab): credential lease requests fail on oversized Convex broker responses - #98619

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
ZengWen-DT:fix/qa-lab-convex-broker-response-limit
Jul 1, 2026
Merged

vincentkoc merged 1 commit into
openclaw:mainfrom
ZengWen-DT:fix/qa-lab-convex-broker-response-limit

Conversation

@ZengWen-DT

@ZengWen-DT ZengWen-DT commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where QA-lab live transports could read an unbounded Convex credential broker response body before parsing broker errors. A malformed or hostile broker failure could force Slack, Telegram, WhatsApp, and Discord live credential acquisition, release, or heartbeat paths to buffer far more text than the broker contract needs.

Why This Change Was Made

The shared credential lease helper now reads Convex broker responses through OpenClaw's bounded provider HTTP reader. Ordinary acquire, release, and heartbeat responses use a 1 MiB ceiling, while chunk hydration keeps using the existing configured payload ceiling so large credential payloads continue to travel through the broker's chunk marker path.

User Impact

QA-lab live transports now fail cleanly when the shared Convex broker returns an oversized response body. Normal small broker responses and chunked credential payload hydration continue to work as before.

Evidence

  • Before: postConvexBroker() used raw response.text() for every Convex broker response, so a non-JSON or error response could be fully materialized before status handling.
  • Premise: the Convex broker stores large credential payloads as __openclawQaCredentialPayloadChunksV1 markers plus /payload-chunk records once the serialized payload spans multiple 256,000-character chunks, so ordinary acquire/release/heartbeat responses do not need the 64 MiB payload ceiling.
  • After, real runtime proof outside Vitest: ran node --import tsx --input-type=module with a loopback node:http broker that streamed a 4 MiB HTTP 500 response through the real fetch path into acquireQaCredentialLease():
broker=http://127.0.0.1:44809
stream_total_bytes=4194304
error=Convex credential acquire failed for kind "telegram": Convex credential broker: text response exceeds 1048576 bytes
requests=1
request_path=/qa-credentials/v1/acquire
bytes_written_before_close=1179648
closed_before_full_body=true
  • Regression coverage: node scripts/run-vitest.mjs extensions/qa-lab/src/live-transports/shared/credential-lease.runtime.test.ts passed, 1 file / 19 tests.
  • CI drift blocker: rebased onto latest upstream/main and verified the formerly failing temp-dir route now includes src/transcripts/store.test.ts with node --input-type=module importing buildVitestRunPlans() from scripts/test-projects.test-support.mjs.
  • git diff --check upstream/main...HEAD passed.
  • pnpm build passed.
  • Local Codex autoreview after the rebase and loopback proof: no accepted/actionable findings.

AI-assisted: yes.

@ZengWen-DT
ZengWen-DT force-pushed the fix/qa-lab-convex-broker-response-limit branch from 738c52f to 9284678 Compare July 1, 2026 12:57
@ZengWen-DT
ZengWen-DT force-pushed the fix/qa-lab-convex-broker-response-limit branch from 9284678 to 674b0dd Compare July 1, 2026 12:58
@clawsweeper

clawsweeper Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 10:22 AM ET / 14:22 UTC.

Summary
The PR caps ordinary qa-lab Convex credential broker responses at 1 MiB, keeps chunk payload hydration on the configured payload limit, and adds buffered plus streaming oversized-response tests.

PR surface: Source +11, Tests +123. Total +134 across 2 files.

Reproducibility: yes. Current main reads postConvexBroker() responses with raw response.text() before error handling, and the PR body plus added tests exercise an oversized loopback broker response; I did not execute tests because this review is read-only.

Review metrics: 1 noteworthy metric.

  • Broker response caps: 3 ordinary calls capped, 1 chunk path preserved. Acquire, release, and heartbeat get a fixed 1 MiB response ceiling while payload chunk hydration keeps the existing configured payload ceiling.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
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.

Next step before merge

  • No ClawSweeper repair lane is needed; the branch is a useful implementation PR with sufficient proof and clean live checks.

Security
Cleared: The diff reduces unbounded response-body buffering and adds no new dependency, workflow, script, permission, or secret-handling surface.

Review details

Best possible solution:

Land this narrow bounded-read fix through normal maintainer review, keeping official chunked credential payload hydration on its configured payload cap.

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

Yes. Current main reads postConvexBroker() responses with raw response.text() before error handling, and the PR body plus added tests exercise an oversized loopback broker response; I did not execute tests because this review is read-only.

Is this the best way to solve the issue?

Yes. This is the best fix shape: it applies the cap at the shared credential lease boundary, reuses the existing SDK bounded reader, and avoids duplicating per-transport or local stream-reading logic.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output from a loopback HTTP broker run outside Vitest showing the cap error and early stream close.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal output from a loopback HTTP broker run outside Vitest showing the cap error and early stream close.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a normal-priority qa-lab live credential reliability and resource-bounding bugfix with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal output from a loopback HTTP broker run outside Vitest showing the cap error and early stream close.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output from a loopback HTTP broker run outside Vitest showing the cap error and early stream close.
Evidence reviewed

PR surface:

Source +11, Tests +123. Total +134 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 12 1 +11
Tests 1 123 0 +123
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 135 1 +134

What I checked:

Likely related people:

  • joshavant: Authored and merged the PR that added the Convex credential broker, HTTP endpoints, and shared credential lease helper used by this PR. (role: introduced behavior / feature owner; confidence: high; commits: 3d07dfbb65ba; files: extensions/qa-lab/src/live-transports/shared/credential-lease.runtime.ts, qa/convex-credential-broker/convex/credentials.ts, qa/convex-credential-broker/convex/http.ts)
  • vincentkoc: Recently changed the same shared credential lease helper and tests to cap and validate chunked credential payloads, directly adjacent to this response-limit work. (role: recent area contributor; confidence: high; commits: 7fc5a72433d1, e451a4e8752a; files: extensions/qa-lab/src/live-transports/shared/credential-lease.runtime.ts, extensions/qa-lab/src/live-transports/shared/credential-lease.runtime.test.ts)
  • steipete: Recently maintained the same helper's broker timeout handling and appears repeatedly in the file's recent path history. (role: recent area contributor; confidence: medium; commits: c8f5a2e0e2e4; files: extensions/qa-lab/src/live-transports/shared/credential-lease.runtime.ts, extensions/qa-lab/src/live-transports/shared/credential-lease.runtime.test.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.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 1, 2026
@ZengWen-DT
ZengWen-DT force-pushed the fix/qa-lab-convex-broker-response-limit branch from 674b0dd to d3a59de Compare July 1, 2026 13:57
@ZengWen-DT

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 1, 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: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 1, 2026
@vincentkoc
vincentkoc merged commit eb87566 into openclaw:main Jul 1, 2026
119 of 124 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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