Skip to content

feat(cloud): compress workspace manifest transfers - #142242

Merged
steipete merged 1 commit into
mainfrom
codex/workspace-manifest-gzip
Sep 9, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/workspace-manifest-gzip

Conversation

@steipete

@steipete steipete commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Related: #134931, #142237, #143133

What Problem This Solves

Cloud workspace synchronization sends immutable file manifests as uncompressed JSON, even when the node can accept compression. Large workspaces therefore transfer more manifest data than necessary.

Why This Change Was Made

Negotiate fast gzip for manifest responses and decode it in the node transfer client. Reuse the existing Control UI encoding-selection rules, preserve identity clients, bound both wire bytes and decoded bytes at 64 MiB, and keep manifest digests tied to decoded content. The Gateway rechecks live transfer authority after compression before sending a response.

This is a standalone extraction from #134931: eight files, 446 added and 76 removed lines. It adds no prepared workspaces, pool state, configuration, dependencies, or protocol-version change.

User Impact

Capable workers transfer fewer manifest bytes. Clients that do not request gzip retain plain responses. Corrupt, unsupported, oversized, or cancelled responses fail without replacing the workspace.

Evidence

  • The current candidate at a4f4137dd7e404341baa0ff0b90937aa7405e3e4 passed 235 tests across ten files, with one existing Windows-only skip. Coverage includes identity compatibility, encoding quality values and 406 responses, post-compression revocation, digest mismatch, corrupt/truncated/stacked encodings, wire/decoded size limits, cancellation, and the landed upload-cancellation and stream-fixture boundaries.

  • The full changed-file gate passed against 73b4086ff658973fb9ae07fa208c49ca8de82a67, including production and test typechecks, all three dead-export scans, lint, schema/store guards, and runtime import cycles. Formatting and documentation validation also passed.

  • Independent P2 review found no actionable defects. Reconciliation onto the current base preserved the seven-file code/test patch byte for byte; only the existing documentation paragraph moved to the new cloud session lifecycle page. All eight committed files match the validated candidate.

  • A real authenticated loopback HTTP exchange prepared and transferred a synthetic 12,000-file manifest through the production transfer handler and node HTTP transport, verified identical decoded content, and cleaned up its resources. Identity used 1,755,103 wire bytes; gzip used 548,761, a 68.73% reduction. Median response completion plus decoding was 2.97 ms for identity and 14.04 ms for gzip. This demonstrates reduced transfer size and its local processing cost; it does not establish cloud startup or network latency improvement.

  • CI run 34378045922 passed on exact head a4f4137dd7e404341baa0ff0b90937aa7405e3e4 after one targeted artifact-job retry. The first job lost most of its 20-minute budget to repeated cache-service HTTP 500s; build/upload/smokes passed, but artifact checks were interrupted. The unchanged-head retry completed those checks and the aggregate gate without source, timeout, or cache-policy changes.

@clawsweeper

clawsweeper Bot commented Sep 8, 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 docs Improvements or additions to documentation gateway Gateway runtime size: L maintainer Maintainer-authored PR labels Sep 8, 2026
@steipete
steipete marked this pull request as ready for review September 8, 2026 14:45
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 12:50 PM ET / 16:50 UTC (Revision 4).

ClawSweeper review

What this changes

Compress workspace manifest downloads with negotiated gzip, preserve uncompressed clients, and validate bounded decoded contents before applying the workspace.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused improvement absent from current main. No actionable correctness or security defects were found, and the supplied real HTTP measurements support the claimed reduction in transfer size.

Priority: P2
Reviewed head: a4f4137dd7e404341baa0ff0b90937aa7405e3e4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with relevant real HTTP observations, meaningful boundary coverage, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied authenticated loopback observations exercise the production Gateway transfer handler and real node HTTP transport, showing identical decoded manifest contents with 68.73% fewer wire bytes; inspected boundary tests supplement this with rejection and cancellation coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied authenticated loopback observations exercise the production Gateway transfer handler and real node HTTP transport, showing identical decoded manifest contents with 68.73% fewer wire bytes; inspected boundary tests supplement this with rejection and cancellation coverage.
Evidence reviewed 8 items Pinned scope and live PR state: The introduced delta is merge-base 73b4086 to the reviewed head. The test merge records the pinned base followed by that exact head. A live REST read confirmed that the PR remains open and unmerged at the reviewed SHA.
Compression preserves live authorization: The handler authenticates the transfer before compression, bounds compressed output, then checks current authorization immediately before writing the response. The service check includes current context identity, owner epoch, session binding, capability membership, expiration, and cancellation.
Bounded decoding and unchanged manifest identity: The node accepts gzip, identity, and absent encoding; rejects unsupported encodings; and bounds both compressed and decoded streams. The decoded bytes reach the existing manifest parser before staging and workspace replacement. This boundary uses OpenClaw transfer code and Node HTTP/zlib, without a dependency on the Codex harness contract.
Findings None None.
Security None None.

How this fits together

The Gateway sends workspace inventories to worker nodes before they materialize session files. This change affects the HTTP representation of those inventories while preserving their contents, digest checks, and transfer authorization.

flowchart LR
  A[Workspace inventory] --> B[Gateway transfer authorization]
  B --> C[Choose gzip or plain JSON]
  C --> D[Recheck live authority]
  D --> E[Node bounded decoding]
  E --> F[Validate manifest digest]
  F --> G[Apply workspace]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +78, Tests +290, Docs +2. Total +370 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 5 154 76 +78
Tests 2 290 0 +290
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 446 76 +370

Review metrics

Metric Value Why it matters
Observed transfer tradeoff 68.73% fewer wire bytes; 2.97 ms identity versus 14.04 ms gzip The supplied loopback measurement demonstrates bandwidth savings while making the added local processing cost explicit.
Production and test balance Production +78 net lines; tests +290 net lines Production growth provides bounded compression and decoding while reusing the existing negotiation policy; added coverage targets compatibility and failure boundaries.

Root-cause cluster

Relationship: canonical
Canonical: #142242
Summary: This is the focused manifest-compression extraction; the umbrella and merged validation repairs cover broader or distinct work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep compression within the existing transfer boundary, with identity compatibility, bounded decoding, unchanged manifest digests, and live authorization immediately before response delivery.

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

Not applicable as a defect reproduction: this is a performance improvement, and current-main source confirms that manifests are transferred uncompressed.

Is this the best way to solve the issue?

Yes. Reusing HTTP negotiation and changing only the transfer representation is a narrow solution that preserves existing workspace and authorization contracts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 627b1e84acaa.

Labels

Label justifications:

  • P2: This is a bounded cloud transfer efficiency improvement with preserved identity compatibility and no demonstrated urgent regression.
  • 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): The supplied authenticated loopback observations exercise the production Gateway transfer handler and real node HTTP transport, showing identical decoded manifest contents with 68.73% fewer wire bytes; inspected boundary tests supplement this with rejection and cancellation coverage.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied authenticated loopback observations exercise the production Gateway transfer handler and real node HTTP transport, showing identical decoded manifest contents with 68.73% fewer wire bytes; inspected boundary tests supplement this with rejection and cancellation coverage.

Evidence

What I checked:

  • Pinned scope and live PR state: The introduced delta is merge-base 73b4086 to the reviewed head. The test merge records the pinned base followed by that exact head. A live REST read confirmed that the PR remains open and unmerged at the reviewed SHA. (a4f4137dd7e4)
  • Compression preserves live authorization: The handler authenticates the transfer before compression, bounds compressed output, then checks current authorization immediately before writing the response. The service check includes current context identity, owner epoch, session binding, capability membership, expiration, and cancellation. (src/gateway/worker-environments/node-workspace-transfer-http.ts:226, a4f4137dd7e4)
  • Bounded decoding and unchanged manifest identity: The node accepts gzip, identity, and absent encoding; rejects unsupported encodings; and bounds both compressed and decoded streams. The decoded bytes reach the existing manifest parser before staging and workspace replacement. This boundary uses OpenClaw transfer code and Node HTTP/zlib, without a dependency on the Codex harness contract. (src/node-host/node-worker-transfer-client.ts:110, a4f4137dd7e4)
  • Compatibility and failure coverage: Read both added test files fully. They exercise real loopback HTTP negotiation, identity peers, invalid and revoked tokens, corrupt/truncated gzip, unsupported encodings, digest mismatch, both byte limits, cancellation, and preservation of existing workspace contents on failure. Existing Control UI tests cover encoding quality and sidecar fallback. Tests were inspected, not executed during this read-only review. (src/node-host/node-worker-transfer-client.encoding.test.ts:64, a4f4137dd7e4)
  • Real production HTTP observations: The supplied complete PR body, captured under sourceRevision 8fc3ec215e721df908bf00b366bd7a8bc7b33685db9845cd56ede89fba7d9a8d, reports an authenticated production-handler/node-transport exchange of a synthetic 12,000-file manifest: identical decoded contents, 1,755,103 identity bytes versus 548,761 gzip bytes, and median completion plus decoding of 2.97 ms versus 14.04 ms. It explicitly limits the claim to transfer size and local processing cost. (a4f4137dd7e4)
  • Still necessary on current main: Fetched main still returns raw manifest JSON and downloads it without requesting or decoding gzip. The related merged upload-cancellation and fixture repairs do not implement compression. Inspection of the latest release's transfer blob was unavailable, so no shipped-fix claim is made. (src/gateway/worker-environments/node-workspace-transfer-http.ts:221, 627b1e84acaa)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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 (3 earlier review cycles)
  • reviewed 2026-09-08T14:45:13.403Z sha 5f3055c :: blocked before merge. :: none
  • reviewed 2026-09-08T14:51:12.826Z sha 5f3055c :: needs maintainer review before merge. :: none
  • reviewed 2026-09-09T14:27:16.661Z sha 259a8d6 :: needs maintainer review before merge. :: none

Negotiate bounded gzip for workspace manifests and share HTTP decoding with existing callers. Preserve authorization, cancellation and decoded-size limits while retaining identity transfers for other clients.

Current-source 235 tests, full changed checks and docs validation pass. Real authenticated HTTP proof sends the identical 12000-file manifest in 548761 bytes rather than 1755103, a 68.73 percent reduction. Existing independent review applies to the unchanged implementation; documentation follows the current session-lifecycle page.
@steipete
steipete force-pushed the codex/workspace-manifest-gzip branch from 259a8d6 to a4f4137 Compare September 9, 2026 16:38
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 9, 2026
@steipete
steipete merged commit e23df62 into main Sep 9, 2026
314 of 316 checks passed
@steipete
steipete deleted the codex/workspace-manifest-gzip branch September 9, 2026 17:40
@steipete

steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
Negotiate bounded gzip for workspace manifests and share HTTP decoding with existing callers. Preserve authorization, cancellation and decoded-size limits while retaining identity transfers for other clients.

Current-source 235 tests, full changed checks and docs validation pass. Real authenticated HTTP proof sends the identical 12000-file manifest in 548761 bytes rather than 1755103, a 68.73 percent reduction. Existing independent review applies to the unchanged implementation; documentation follows the current session-lifecycle page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR 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 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