Skip to content

fix(clawhub): bound streaming metadata and error responses - #109092

Merged
obviyus merged 3 commits into
openclaw:mainfrom
Pick-cat:fix/clawhub-request-timeout-through-body
Sep 10, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
Pick-cat:fix/clawhub-request-timeout-through-body

Conversation

@Pick-cat

@Pick-cat Pick-cat commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where plugin searches could wait past the request timeout when ClawHub kept sending small metadata or error-body chunks.

Why This Change Was Made

Keep each request deadline active until its response consumer finishes. Successful archive downloads release that deadline after the status check and retain the existing chunk-idle timeout. Port the contributor's repair to the current split ClawHub modules and share response cleanup across metadata, downloads, and telemetry.

User Impact

Metadata and error responses stop at the existing request deadline. Progressing archive downloads can still take longer than 30 seconds. Error status, authentication, size limits, integrity checks, and read-only retry rules remain intact.

Evidence

  • Built openclaw plugins search against an isolated loopback registry: baseline success/error bodies remained pending until the test owner stopped them at 37 seconds; the candidate closed both near 30 seconds and preserved HTTP 400. Delayed headers consumed the same original deadline.
  • Built openclaw plugins install with an owned fixture: a 35-second archive installed once; stalled and non-success streams timed out; oversized and corrupt archives were rejected.
  • Independent public checks covered cross-origin token omission, one read retry, no write retry, unread telemetry cancellation, and removal of download scratch. All 16 scenarios passed.
  • 122 focused tests passed. Five new cases failed on the baseline; deliberate archive-policy and retry-cleanup regressions failed their controls. Two existing macOS-only auth cases were skipped on Linux. Native formatting, syntax lint, size/assertion checks, and the normal commit hook passed. Full checks run in CI.
  • The final correction uses the existing typed test helper and normal file mode. Production files are unchanged from the build used for the public behavior proof.

@clawsweeper

clawsweeper Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 1:39 AM ET / 05:39 UTC (Revision 15).

ClawSweeper review

What this changes

Keeps ClawHub metadata and error responses within the existing request deadline while preserving idle-based timeouts for successful archive downloads and cleaning up unread responses.

Merge readiness

✅ Ready for maintainer review

This fix remains necessary on current main and v2026.9.3. The updated branch resolves the prior porting and archive-compatibility concerns, has relevant real transport proof, and introduces no identified blocking defect.

Priority: P2
Reviewed head: a7aa9849a4d62c9238d97ce9b244d0a54be69bee

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused lifecycle repair with relevant runtime observations and resolved prior review concerns.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Reported built CLI runs exercised the changed ClawHub client through real loopback HTTP: dripping metadata/errors stopped near the existing 30-second deadline, HTTP 400 remained recognizable, and a progressing 35-second archive installed successfully; the final commit changes only test support.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Reported built CLI runs exercised the changed ClawHub client through real loopback HTTP: dripping metadata/errors stopped near the existing 30-second deadline, HTTP 400 remained recognizable, and a progressing 35-second archive installed successfully; the final commit changes only test support.
Evidence reviewed 8 items Current main still has the defect: The request timer is cleared immediately after fetch returns headers, while metadata and error readers subsequently use renewable chunk-idle timeouts. A continuing drip can therefore exceed the request budget.
Latest release remains affected: The v2026.9.3 source also clears the request timer after headers; the proposed response-lifetime repair is not present there.
Response lifetime and retry ownership: The shared response consumer retains the deadline through body consumption and releases resources in finally. Body failures remain outside request retries, and POST requests remain non-retryable.
Findings None None.
Security None None.

How this fits together

OpenClaw’s ClawHub client supplies registry metadata and archives to plugin and skill discovery and installation. It turns HTTP responses into parsed results, downloaded artifacts, or actionable errors.

flowchart TD
  A[Plugin and skill operations] --> B[ClawHub HTTP request]
  B --> C{Response type}
  C --> D[Metadata or error body]
  C --> E[Successful archive]
  D --> F[Keep original request deadline]
  E --> G[Keep chunk idle timeout]
  F --> H[Return result or error and release resources]
  G --> H
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +42, Tests +276. Total +318 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 5 268 226 +42
Tests 1 276 0 +276
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 544 226 +318

Review metrics

None.

Technical review

Best possible solution:

Use one response-lifetime owner to bound metadata and errors while preserving progressing archives, existing authentication, and non-replayed writes.

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

Yes: current main clears its timer after headers, allowing periodically arriving metadata or error chunks to renew the idle timeout beyond the request budget; the supplied loopback observations corroborate this mechanism.

Is this the best way to solve the issue?

Yes: the repair belongs in the shared response lifecycle, and the explicit successful-archive exception preserves the existing long-transfer contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0153d84c02af.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove merge-risk: 🚨 availability: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: Repairs excessive waits during registry discovery and installation without evidence of a widespread urgent outage.
  • 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 (live_output): Reported built CLI runs exercised the changed ClawHub client through real loopback HTTP: dripping metadata/errors stopped near the existing 30-second deadline, HTTP 400 remained recognizable, and a progressing 35-second archive installed successfully; the final commit changes only test support.
  • proof: sufficient: Contributor real behavior proof is sufficient. Reported built CLI runs exercised the changed ClawHub client through real loopback HTTP: dripping metadata/errors stopped near the existing 30-second deadline, HTTP 400 remained recognizable, and a progressing 35-second archive installed successfully; the final commit changes only test support.

Evidence

What I checked:

  • Current main still has the defect: The request timer is cleared immediately after fetch returns headers, while metadata and error readers subsequently use renewable chunk-idle timeouts. A continuing drip can therefore exceed the request budget. (src/infra/clawhub-client.ts:200, 0153d84c02af)
  • Latest release remains affected: The v2026.9.3 source also clears the request timer after headers; the proposed response-lifetime repair is not present there. (src/infra/clawhub-client.ts:200, 1391f7cd2d40)
  • Response lifetime and retry ownership: The shared response consumer retains the deadline through body consumption and releases resources in finally. Body failures remain outside request retries, and POST requests remain non-retryable. (src/infra/clawhub-client.ts:256, a7aa9849a4d6)
  • Prior archive concern resolved: The common archive consumer releases the absolute deadline only after confirming a successful HTTP status. All five archive acquisition paths use this consumer, retaining existing byte limits, integrity checks, and idle timeout behavior. (src/infra/clawhub-artifacts.ts:94, a7aa9849a4d6)
  • Real production-path observations: The supplied PR body reports built plugin-search runs against a real loopback registry: baseline drips remained pending at 37 seconds, while candidate success/error bodies stopped near 30 seconds and retained HTTP 400. A built plugin-install run completed a progressing 35-second archive, with separate stalled, oversized, corrupt, retry, authentication, and cleanup controls. The live REST body matched the supplied snapshot; review context sourceRevision was fa18d2cabc386d80270aca1f9ecc6bf4c7fb09562d5a47d837ed3b725477cefa. These are reported runtime observations, not executions performed during this review. (a7aa9849a4d6)
  • Proof continuity and regression coverage: GitHub confirms the final commit changes only the deferred helper in the new deadline test, preserving the production code used for the reported proof. The complete test covers dripping metadata/errors, successful long archives, telemetry cancellation, and retry cleanup. Tests were inspected but not executed in this read-only review. (src/infra/clawhub-deadline.test.ts:1, a7aa9849a4d6)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • 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.

History

Review history (14 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-17T05:42:13.724Z sha d8aae19 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-31T05:57:12.412Z sha d8aae19 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T19:22:06.002Z sha d8aae19 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-08T22:40:56.508Z sha d8aae19 :: needs changes before merge. :: none
  • reviewed 2026-08-14T09:18:02.487Z sha d8aae19 :: needs changes before merge. :: none
  • reviewed August 20, 2026, 1:48 AM ET / 05:48 UTC sha unknown :: needs changes before merge. :: none
  • reviewed 2026-08-26T07:05:41.952Z sha d8aae19 :: needs changes before merge. :: none
  • reviewed 2026-09-04T20:35:40.949Z sha d8aae19 :: blocked before merge. :: none

@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 16, 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.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 17, 2026
@Pick-cat
Pick-cat force-pushed the fix/clawhub-request-timeout-through-body branch from a97623c to 058b160 Compare July 17, 2026 02:38
@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 17, 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.

Re-review progress:

@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. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 17, 2026
@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 17, 2026
Move the wall-clock deadline release to after the success-status check in
archive callers so non-2xx archive error bodies stay bounded by the request
deadline instead of falling back to chunk-idle protection.

Previously `releaseAfterHeaders` cleared the timer at the transport layer
before callers could distinguish successful archives from error responses.
Now each archive caller calls `release()` only after confirming `response.ok`,
while non-archive paths let the `finally` block manage the deadline.

Add a loopback regression test for a continuously dripping 400 archive error
body to prove the wall-clock bounds it within the configured budget.

Co-Authored-By: nebulacoder-v8.0 <[email protected]>
@Pick-cat
Pick-cat force-pushed the fix/clawhub-request-timeout-through-body branch from ecb99af to d8aae19 Compare July 17, 2026 04:56
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jul 17, 2026
Port the response lifetime fix to the split ClawHub owners. Keep metadata and error bodies under each request deadline, and release successful archives into their existing chunk-idle timeout. Dispose unread responses and discarded retry attempts through the shared lifecycle owner.
@obviyus
obviyus requested review from a team and steipete as code owners September 10, 2026 03:46
@obviyus obviyus changed the title fix(clawhub): keep request deadline through response body fix(clawhub): bound streaming metadata and error responses Sep 10, 2026
@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Security-sensitive guard cleared

This PR no longer has blocked security-sensitive file changes. A future security-sensitive change requires a fresh /allow-security-sensitive-change comment after the guard blocks that new head SHA.

  • Current SHA: a7aa9849a4d62c9238d97ce9b244d0a54be69bee

@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Sep 10, 2026
@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph guard cleared

This PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh /allow-dependencies-change comment after the guard blocks that new head SHA.

  • Current SHA: a7aa9849a4d62c9238d97ce9b244d0a54be69bee

Use the existing deferred helper under the repository ES2023 type declarations. Preserve the native Promise behavior and all deadline assertions.
@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label Sep 10, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Sep 10, 2026
@obviyus
obviyus merged commit f253920 into openclaw:main Sep 10, 2026
227 checks passed
@obviyus

obviyus commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Pick-cat!

Proof: Built plugin search and install commands passed 16 independent loopback scenarios. All 122 focused tests passed, including seven deadline/cleanup cases with demonstrated baseline or mutation failures.

  • Bug: Progressing metadata and error bodies could keep a request open after its deadline.
  • Fix: Keep each deadline active through response consumption; release it only for successful archives, and dispose unread responses and retry attempts.
Before After
Metadata and HTTP 400 bodies stayed pending until the test owner stopped them at 37 seconds. Both closed near the original 30-second deadline; delayed headers did not restart it.
Successful archives used progress-based streaming. A 35-second archive still installed once; stalls, oversized responses and integrity failures were rejected.

CI: The final exact-head run passed. Fresh ClawSweeper review found no actionable findings or security concerns.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
…109092)

Keep each ClawHub request deadline active through metadata and error-body consumption. Successful archive responses retain their existing chunk-idle timeout so progressing downloads can outlive the metadata deadline.

Port the contributor's fix to the current split modules, share archive status handling, and dispose unread responses and discarded read retries. Preserve authentication, size limits, strict decoding, integrity checks, and the rule against retrying writes.

Co-authored-by: Ayaan Zaidi <[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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L stale Marked as stale due to inactivity 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