Repository navigation
feat(cloud): compress workspace manifest transfers - #142242
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 12:50 PM ET / 16:50 UTC (Revision 4). ClawSweeper reviewWhat this changesCompress 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +78, Tests +290, Docs +2. Total +370 across 8 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
5f3055c to
259a8d6
Compare
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.
259a8d6 to
a4f4137
Compare
|
Merged via squash.
|
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.
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
a4f4137dd7e404341baa0ff0b90937aa7405e3e4passed 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
a4f4137dd7e404341baa0ff0b90937aa7405e3e4after 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.