Skip to content

perf(gateway): avoid preparing chat attachment workspaces twice - #184985

Merged
steipete merged 2 commits into
mainfrom
perf/chat-send-attachment-preparation-1870
Oct 26, 2026
Merged

steipete merged 2 commits into
mainfrom
perf/chat-send-attachment-preparation-1870

Conversation

@steipete

@steipete steipete commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Sandboxed file uploads repeat workspace preparation before chat.send can acknowledge the input. The first preparation was immediately released; media staging then repeated runtime classification, workspace initialization, and skill synchronization bookkeeping.

User Impact

Prepare the attachment workspace once while preserving file bytes/order, current mutation authority, cancellation cleanup, pre-ACK errors, managed-PDF fallback, and SSH filesystem-bridge behavior. No protocol, UI, configuration, or storage-schema change.

Why This Change Was Made

The chat attachment owner now retains its existing live workspace preparation through staging. Staging borrows it and disposes only preparations it creates itself. This removes duplicate work without a cache or weaker validation. Runtime production delta: +6 lines, required to distinguish borrowed from locally owned disposal; the separate benchmark is tooling. Other staging callers still acquire their own preparation.

Evidence

  • Regression fails on baseline 7f394ea14e2f: one sandboxed upload initializes its workspace twice. Candidate initializes it once. Both global agent owners retain their own exact file bytes.
  • Revoking managed-worktree ownership after preparation rejects the upload and creates no staging directory. Existing large-file, cancellation, PDF fallback, private-skill identity, history replay, SCP, and WebSocket cleanup-before-reply checks pass.
  • Focused checks: 55 tests across attachment-owner/lazy-handler/media-staging files; 2 private-skill tests; 12 selected transport/attachment tests. The 55-test batch completed in 138.77 s and the 12-test batch in 73.06 s. After the patch-identical rebase, 7 selected chat attachment tests passed again in 80.23 s; export-name collision checks and both source-closure files (26 tests) passed. Changed-file lint/format and pnpm tsgo:core passed. PR CI supplies broad proof.
  • Independent subagent review (autoreview route unavailable): clean through P2 after fixing the benchmark to require every expected staged filename in request order before byte verification.

CI follow-up

The first CI run found two PR-caused validation issues: the benchmark widened known fixture content to unknown, and the SSH staging test still mocked the previous preparation helper. The follow-up preserves the fixture's inferred string types with satisfies and migrates the SSH mock to the retained preparation handle; production code and measured behavior are unchanged. All five SSH tests now pass; changed-file lint/format and a standalone benchmark typecheck pass. A redundant sample-count summary that depended on another benchmark’s ambient type augmentation was removed; the complete raw allocation profile remains available. The follow-up received a clean independent review.

Two ACP provenance assertions in chat.directive-tags.test.ts fail because their expected user turns omit modelSelection. Both failures reproduce identically on the PR head and unchanged main 9d52e3c5b18b using the same focused test command. These inherited expectations are separate from attachment staging; no unrelated source changes or CI reruns were used to hide them.

The final CI run 40398880708 completed on 71a7fa2ff9bcde1fc1f1424c65f6afddf856b57b. Every selected non-aggregate job passed except the shard containing those two inherited ACP assertions; the aggregate gate remains red for that shard. All three PostgreSQL shards, typechecks, lint, source guards, attachment tests, and SSH staging passed. Hosted Codex review and the ClawSweeper re-review both report no actionable findings on this head. Landing uses the authorized inherited-failure exception, with baseline reproduction evidence.

Measurement

Warm attachment preparation on isolated synthetic state, with no provider calls; two warm-up operations per selected workload precede measurement. Three 300-operation untraced paired comparisons of twelve 4 KiB text attachments; two 300-operation paired allocation passes; mixed 4.12 MiB PNG / 1.00 MiB PDF / twelve-file batches; counterbalanced order. The benchmark verifies original and staged SHA-256 values. CPU/latency measure preparation; sampled main-thread allocation and GC include request normalization, verification, and cleanup. Allocation passes are diagnostic and are not used to gate timing.

Twelve-file workload Base Candidate Change
Workspace initializations/upload 2 1 −50%
Sampled main-thread allocation, MiB/batch 23.36 16.72 -28.4%
Main-thread CPU, ms/batch (paired mean) 102.24 79.62 -22.1%
Mean preparation latency, ms 235.82 233.56 -1.0%
Mean of arm p95 latency, ms (300 samples/arm) 430.08 515.64 +19.9%

Allocation repeated closely: base 23.343/23.380 MiB and candidate 16.688/16.743 MiB. CPU and wall time are host-sensitive. The primary mean latency is neutral; its tail is near the adverse threshold, not a latency-win claim. The third untraced pair was predeclared after opposite-sign p95 deltas. No arm was excluded.

Short mixed samples appeared slower, but four matched identical-source A/A pairs produced many-file mean deltas of +45%, +58%, −26%, and +72%. The protocol was extended from 90 to 300 fixed operations per arm, with fresh AB/BA and four fresh A/A pairs, leaving natural GC and maintenance enabled.

Longer mixed workload (100 samples/case/arm) Base mean, ms Candidate mean, ms Change
image 47.68 47.06 -1.3%
pdf 88.30 59.19 -33.0%
many 246.73 216.52 -12.2%

Fresh longer A/A control deltas (many-file mean latency): +5.0%, -30.5%, +18.2%, +50.9%.

These are warm owner measurements, not cold-start, full Gateway ACK, or concurrent-turn measurements. The duplicate-work deletion uses focused owner proof; it makes no claim to remove an entire observed send delay. No load was sent to an operator Gateway. SSH still resolves its filesystem bridge separately.

Reproduce with the header commands in scripts/perf/chat-send-attachments-measure.ts, using immutable baseline/candidate copies of the two owner files via --owner-dir, fresh --state-dir paths, --workload many --iterations 300, a separate --allocations pass, and --workload mixed --iterations 300. JSON reports source SHA-256/load receipts, per-kind GC, sample counts, host load, RSS and heap.

All arms: CPU, preparation latency, GC, event loop, memory, and host load

B = baseline, C = candidate; controls all load B. Allocation rows are traced diagnostics. Mixed latency below is the many-file subcase. Loop p99 values include their sample count; mixed per-case p95/p99 values have fewer samples and remain context. RSS/heap are end-of-arm snapshots, not retained-heap claims.

Arm n (ops / many) Main CPU ms/op Many mean / p95 ms GC ms/op / ms/min / max ms Loop p99 ms (n) RSS / heap MiB Host load 1m start→end
01-base-many 300 / 300 71.21 165.5 / 273.7 0.834 / 292.9 / 6.80 2.64 (44222) 994.4 / 189.0 23.0→16.0
02-candidate-many 300 / 300 78.16 227.7 / 629.7 0.736 / 187.7 / 22.39 3.25 (55847) 981.6 / 194.6 17.2→20.1
03-candidate-many 300 / 300 87.55 265.4 / 602.5 0.792 / 172.9 / 19.45 3.97 (63136) 966.9 / 195.5 20.2→29.4
04-base-many 300 / 300 143.88 324.7 / 628.4 1.042 / 185.2 / 9.04 4.59 (77325) 819.6 / 225.4 30.6→35.2
05-base-many (allocation) 300 / 300 109.97 252.2 / 366.6 0.953 / 220.1 / 5.86 3.18 (64504) 1025.6 / 193.4 33.2→28.2
06-candidate-many (allocation) 300 / 300 95.28 223.6 / 316.0 0.744 / 192.6 / 23.36 3.76 (56710) 1010.1 / 179.5 23.6→23.0
07-candidate-many (allocation) 300 / 300 92.10 270.3 / 419.7 0.766 / 164.2 / 24.96 3.67 (66290) 1005.7 / 200.8 21.8→22.8
08-base-many (allocation) 300 / 300 120.36 305.9 / 875.4 1.467 / 277.5 / 58.72 7.32 (68653) 896.6 / 230.7 32.9→31.0
09-base-mixed 90 / 30 51.67 222.4 / 287.0 0.770 / 378.9 / 4.89 3.01 (9152) 1256.0 / 195.7 31.9→28.4
10-candidate-mixed 90 / 30 44.41 273.9 / 673.9 0.710 / 312.5 / 4.96 2.88 (10159) 1248.7 / 193.6 25.5→25.8
11-candidate-mixed 90 / 30 51.27 228.8 / 559.8 1.604 / 776.0 / 54.43 4.78 (8273) 1240.7 / 196.5 24.6→26.0
12-base-mixed 90 / 30 54.14 193.9 / 218.8 0.749 / 419.0 / 4.94 3.08 (8113) 1275.2 / 202.8 26.4→24.4
13-base-many 300 / 300 91.62 217.2 / 388.2 0.912 / 244.6 / 13.24 3.02 (55258) 1038.0 / 277.6 17.9→23.8
14-candidate-many 300 / 300 73.14 207.6 / 314.7 0.655 / 183.6 / 21.75 2.78 (53741) 998.5 / 223.7 21.7→18.2
15-control-a-mixed 90 / 30 60.62 282.0 / 602.0 0.855 / 360.7 / 6.41 4.01 (10225) 1264.3 / 209.2 24.0→26.0
16-control-b-mixed 90 / 30 84.80 409.3 / 713.9 1.337 / 384.7 / 23.62 4.50 (14334) 1225.6 / 178.9 30.0→30.9
17-control-b-mixed 90 / 30 58.66 399.0 / 1150.3 0.861 / 254.7 / 5.91 5.43 (12509) 1258.8 / 200.6 28.5→26.2
18-control-a-mixed 90 / 30 59.97 253.2 / 369.3 1.082 / 473.2 / 26.66 3.58 (10030) 1273.7 / 198.9 27.6→28.9
19-control-a-mixed 90 / 30 69.37 317.2 / 730.8 0.801 / 302.0 / 5.69 3.98 (11205) 1274.0 / 199.0 28.3→27.9
20-control-b-mixed 90 / 30 57.14 234.2 / 363.4 1.062 / 503.1 / 24.87 3.04 (9499) 1255.1 / 184.1 27.4→26.0
21-control-b-mixed 90 / 30 97.16 598.5 / 901.8 1.201 / 239.5 / 7.14 5.54 (19657) 1254.8 / 186.5 35.8→41.9
22-control-a-mixed 90 / 30 86.70 348.2 / 486.4 0.863 / 284.5 / 5.52 4.76 (12508) 1266.4 / 187.3 44.2→43.5
23-long-base-mixed 300 / 100 60.18 229.1 / 358.2 0.716 / 340.4 / 9.60 3.68 (30392) 1309.2 / 205.2 39.7→38.4
24-long-candidate-mixed 300 / 100 34.21 187.1 / 247.3 0.598 / 364.0 / 4.16 2.56 (25086) 1329.8 / 206.4 34.0→30.8
25-long-candidate-mixed 300 / 100 40.56 245.9 / 419.5 0.679 / 324.8 / 5.83 3.49 (30301) 1290.4 / 190.4 27.5→25.1
26-long-base-mixed 300 / 100 58.95 264.3 / 351.7 0.874 / 377.1 / 22.46 3.30 (33872) 1150.0 / 182.9 25.8→23.4
27-long-control-a-mixed 300 / 100 55.54 258.8 / 409.0 0.827 / 360.9 / 21.89 2.97 (34289) 1215.8 / 193.6 24.6→25.5
28-long-control-b-mixed 300 / 100 66.81 271.7 / 354.5 0.800 / 328.0 / 8.49 4.12 (34769) 1191.3 / 194.8 30.3→32.3
29-long-control-b-mixed 300 / 100 86.56 403.6 / 677.0 0.859 / 248.0 / 7.28 5.34 (46153) 1206.7 / 200.5 38.5→37.9
30-long-control-a-mixed 300 / 100 101.74 580.5 / 1233.0 1.197 / 244.9 / 23.95 6.75 (57934) 1084.9 / 189.6 46.5→48.6
31-long-control-a-mixed 300 / 100 72.61 305.3 / 458.5 0.816 / 304.0 / 10.31 4.22 (38178) 1199.7 / 198.8 55.2→39.8
32-long-control-b-mixed 300 / 100 78.09 360.9 / 606.8 1.038 / 331.5 / 13.54 4.41 (43455) 1138.3 / 205.0 36.3→43.6
33-long-control-b-mixed 300 / 100 95.51 460.5 / 760.1 1.217 / 295.6 / 37.24 8.16 (48312) 1170.0 / 203.8 38.6→48.6
34-long-control-a-mixed 300 / 100 72.96 305.2 / 522.1 0.771 / 289.1 / 5.59 4.63 (36889) 1160.4 / 200.8 40.3→33.5

GC detail below is count / total ms / maximum pause ms. Major-GC percentiles remain context when fewer than 50 collections occur.

Arm Minor GC Major GC Incremental GC
01 282 / 212.9 / 1.83 7 / 33.5 / 6.80 7 / 3.8 / 0.60
02 201 / 165.9 / 2.87 6 / 51.4 / 22.39 6 / 3.5 / 1.17
03 200 / 176.3 / 4.29 9 / 55.2 / 19.45 9 / 6.1 / 2.67
04 284 / 269.2 / 3.45 7 / 40.3 / 9.04 7 / 3.0 / 0.54
05 283 / 250.8 / 3.46 7 / 31.9 / 5.86 7 / 3.2 / 0.63
06 202 / 173.6 / 3.61 6 / 47.0 / 23.36 6 / 2.5 / 0.49
07 202 / 181.3 / 7.63 5 / 46.0 / 24.96 5 / 2.5 / 0.52
08 322 / 366.3 / 58.72 8 / 67.6 / 22.62 8 / 6.2 / 1.43
09 44 / 43.8 / 1.85 6 / 22.8 / 4.89 6 / 2.7 / 0.47
10 25 / 28.3 / 4.01 8 / 31.9 / 4.96 8 / 3.7 / 0.59
11 24 / 27.4 / 2.47 10 / 111.2 / 54.43 10 / 5.8 / 0.88
12 46 / 45.3 / 3.79 5 / 19.6 / 4.94 5 / 2.5 / 0.67
13 284 / 235.0 / 2.36 6 / 36.0 / 13.24 6 / 2.8 / 0.54
14 201 / 153.8 / 1.38 5 / 40.2 / 21.75 5 / 2.5 / 0.54
15 47 / 57.9 / 6.41 4 / 17.2 / 5.48 4 / 1.8 / 0.49
16 43 / 56.1 / 3.02 10 / 59.6 / 23.62 10 / 4.7 / 0.52
17 44 / 44.7 / 1.76 7 / 29.0 / 5.91 7 / 3.8 / 0.65
18 44 / 45.1 / 2.16 6 / 49.0 / 26.66 6 / 3.2 / 0.55
19 45 / 47.3 / 2.57 5 / 22.2 / 5.69 5 / 2.6 / 0.55
20 44 / 43.2 / 1.50 7 / 48.7 / 24.87 7 / 3.8 / 0.59
21 45 / 64.9 / 3.97 8 / 38.4 / 7.14 8 / 4.8 / 0.95
22 45 / 49.2 / 2.12 6 / 25.1 / 5.52 6 / 3.3 / 0.62
23 152 / 143.6 / 1.60 15 / 63.5 / 9.60 15 / 7.6 / 0.61
24 85 / 81.0 / 1.41 24 / 86.6 / 4.16 24 / 11.7 / 0.59
25 83 / 83.9 / 3.77 28 / 107.7 / 5.83 28 / 12.2 / 0.52
26 153 / 155.2 / 4.30 16 / 99.0 / 22.46 16 / 7.9 / 0.61
27 150 / 147.8 / 2.51 18 / 91.0 / 21.89 18 / 9.2 / 0.59
28 149 / 154.0 / 2.95 20 / 77.1 / 8.49 20 / 8.7 / 0.48
29 153 / 178.1 / 6.38 18 / 70.7 / 7.28 18 / 8.9 / 0.60
30 150 / 220.5 / 7.35 23 / 125.9 / 23.95 23 / 12.9 / 1.13
31 154 / 171.0 / 2.80 15 / 67.2 / 10.31 15 / 6.7 / 0.68
32 149 / 199.2 / 11.30 21 / 101.1 / 13.54 21 / 11.2 / 0.68
33 150 / 201.1 / 3.96 23 / 152.5 / 37.24 23 / 11.4 / 0.87
34 150 / 154.5 / 3.72 18 / 67.8 / 5.59 18 / 9.0 / 0.56

@clawsweeper

clawsweeper Bot commented Oct 26, 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 gateway Gateway runtime scripts Repository scripts size: M labels Oct 26, 2026
@steipete
steipete marked this pull request as ready for review October 26, 2026 20:24
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T20:50:16.150747Z 71a7fa2 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR retains one live workspace preparation through chat attachment staging and releases it afterward.

Example: Upload twelve 4 KiB text files to a sandboxed chat session.

  • Before: Workspace preparation runs twice before acknowledgement.
  • After: Workspace preparation runs once while preserving attachment bytes and order.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused implementation with useful production-owner evidence; the previous finding is resolved and no new actionable defect was identified.
Proof confidence 🦐 gold shrimp (3/6) Sufficient (live_output): The maintainer reports production attachment-owner runs preserving exact bytes across agent workspaces and rejecting a managed worktree revoked after preparation without new staged files; the committed regression reaches the real preparation and guarded filesystem owners. Ordinary proof is exempt for this maintainer-authored PR, and the authority-specific evidence is sufficient. Inspected screenshots belong to the earlier SSH fix and establish no new performance result.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Sandboxed file uploads perform unnecessary workspace initialization and skill synchronization before acknowledgement.
Reason: The maintainer-authored direction removes measurable duplicate work with a small production change and explicitly limits its performance claims.

Merge readiness

✅ Ready for maintainer review

This PR removes duplicate workspace preparation without an identified production regression. The prior SSH fixture finding is fixed; the current CI failure also occurs on main.

Priority: P2
Reviewed head: 71a7fa2ff9bcde1fc1f1424c65f6afddf856b57b

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway chat.send parses uploads into managed media, prepares the selected sandbox workspace, and stages files before acknowledging the request.

flowchart LR
  A[Chat upload] --> B[Managed media parser]
  B --> C[Chat attachment owner]
  C --> D[Live workspace preparation]
  D --> E[Media staging]
  E --> F[Guarded filesystem write]
  F --> G[Attachment facts and acknowledgement]
Loading

Technical review

Best possible solution:

Reuse the existing live preparation through staging while retaining current-authority checks and caller-owned disposal.

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

Current-main source shows the chat owner preparing and releasing a workspace before staging prepares it again; the PR reports a baseline failure for the two-initialization case.

Is this the best way to solve the issue?

The patch uses the existing writer preparation rather than adding a cache or competing owner, and keeps other staging callers' acquisition behavior intact.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Pre-ACK chat attachment ownership keeps the original intent (ff9c932: Kept private attachment operations in their existing caller while preserving routing, authority, cleanup, and payload behavior.)
  • Workspace preparation lifetime keeps the original intent (4008c32: Retained writer ownership until attachment effects settle and checked current authority before filesystem mutation.)
  • SSH staging and fixture keeps the original intent (af75a8d: Used the guarded remote filesystem bridge for reused SSH workspaces while retaining host-readable originals and private-skill identity.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +6, Tests +37, Other +373. Total +416 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 12 6 +6
Tests 6 61 24 +37
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 373 0 +373
Total 9 446 30 +416

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦪 silver shellfish.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: A bounded performance improvement removes repeated work from sandboxed attachment preparation before acknowledgement.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦪 silver shellfish.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-26T20:42:12.820Z sha ffda9205454ae1d9b2d94b105aba202041d96a91 :: needs changes before merge. :: [P2] Migrate the SSH upload fixture to the owned workspace helper

Reviewed October 26, 2026, 4:58 PM ET / 20:58 UTC (Revision 2).

Retain the live workspace preparation through pre-ACK media staging so sandboxed file uploads do not repeat workspace initialization and skill synchronization. Preserve mutation authority, cancellation, PDF fallback, and caller-owned disposal. Add work-count and revocation regressions plus a reproducible synthetic attachment benchmark.
@steipete
steipete force-pushed the perf/chat-send-attachment-preparation-1870 branch from ffda920 to 71a7fa2 Compare October 26, 2026 20:48
@steipete

Copy link
Copy Markdown
Contributor Author

Fixed the SSH fixture finding in 71a7fa2ff9bcde1fc1f1424c65f6afddf856b57b: it now mocks prepareSandboxWorkspaceForSession with the retained workspace, current-authority assertion, and disposal contract. All five existing SSH staging tests pass, including the upload path and byte-preservation assertions.

The same follow-up fixes the benchmark fixture typing found by CI. Changed-file lint/format and the standalone benchmark typecheck pass; production code and the measured allocation calculation are unchanged. The PR body includes the corrections, measurement limits, and the independently reproduced inherited ACP assertion failures.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

Inherited CI attribution for head 71a7fa2ff9bcde1fc1f1424c65f6afddf856b57b:

The failed shard in run 40398880708 contains exactly two failures in src/gateway/server-methods/chat.directive-tags.test.ts:

  • injects ACP system provenance into the agent-visible body
  • leaves ACP bridge user persistence to the agent runtime

Both receive additional __openclaw.modelSelection metadata absent from their expected user turn. The same two assertions fail identically on the original PR head and unchanged main 9d52e3c5b18b, using:

node scripts/run-vitest.mjs src/gateway/server-methods/chat.directive-tags.test.ts --maxWorkers=1 -t 'injects ACP system provenance|leaves ACP bridge user persistence'

Each focused run reports 2 failed / 132 skipped. On the current CI head the failing shard reports 2 failed / 134 passed; the failure signatures are unchanged. This PR changes only the workspace-preparation mock in that test file, not ACP turn metadata or these assertions. The PR-caused benchmark type errors and SSH fixture failure from the first run are fixed: check-test-types and checks-node-changed-1 now pass. Other checks are still finishing; this attribution does not claim the full run is green.

@steipete
steipete merged commit 86f3fb6 into main Oct 26, 2026
126 of 129 checks passed
@steipete
steipete deleted the perf/chat-send-attachment-preparation-1870 branch October 26, 2026 21:15
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
…claw#184985)

* perf(gateway): avoid preparing chat attachment workspaces twice

Retain the live workspace preparation through pre-ACK media staging so sandboxed file uploads do not repeat workspace initialization and skill synchronization. Preserve mutation authority, cancellation, PDF fallback, and caller-owned disposal. Add work-count and revocation regressions plus a reproducible synthetic attachment benchmark.

* test(gateway): align attachment benchmark types and SSH fixture
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant