Skip to content

perf(media): share attachment playback metadata inspections - #158548

Merged
steipete merged 8 commits into
mainfrom
perf/l31-playback-metadata
Sep 26, 2026
Merged

steipete merged 8 commits into
mainfrom
perf/l31-playback-metadata

Conversation

@steipete

@steipete steipete commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Opening one audio or video attachment in multiple Control UI clients launches a separate ffprobe process for every metadata request, even when the playback inspection is already cached.

User Impact

Concurrent viewers share one inspection, and warm metadata requests launch no probe. Distinct files wait for bounded inspection capacity, disconnected requests release queued work, and access revocation prevents delayed file reads. A busy inspector preserves outgoing attachments and their original bytes; optional playback metadata may be absent. Outgoing reply creation uses immediate admission, so queued viewer requests cannot delay delivery. There are no protocol, configuration, dependency-version, or storage schema changes.

Why This Change Was Made

The existing playback inspection owner now retains duration and display dimensions alongside codec classification. Control UI metadata and managed attachment creation consume that result, replacing their separate pre-probes. Native byte playback retains its cheap passthrough path, replacements invalidate cached facts, and failed probes remain retryable.

The existing FIFO permit pool owns the two active inspection slots. The media owner bounds distinct pending work at 32 jobs, shares consumers by file identity, and removes an orphaned pending permit immediately. Shared work continues when another authorized viewer remains. The owner checks current authority before reopening a queued file and again before probing it; each consumer also checks its own authority before accepting the result. Byte-stream ownership supplies cancellation for byte requests.

Metadata callers release their descriptors before waiting. Saturation uses existing retryable metadata-unavailable and playback-preparing/HTTP 202 outcomes. Outgoing creation catches only the canonical busy error, preserving genuine authorization, cancellation, and preparation failures. Coherent helper moves keep the oversized Gateway modules within their line-cap ratchets.

Related: #158464 changes static serving in the same Control UI file; #158450 changes managed artifact handling. Their changes are in separate regions and do not implement this consolidation.

Evidence

The original optimization was measured through the actual assistant-media handler with a valid 100 ms WAV, ten concurrent synthetic HTTP requests, and real ffprobe children. Five paired rounds used fresh identities for cold batches on one shared host. No listener, external provider, or live Gateway was involved.

Ten-request batch Before After
Cold ffprobe children / peak concurrent children 10 / 10 1 / 1
Warm ffprobe children / peak concurrent children 10 / 10 0 / 0
Median cold batch wall time 74.076 ms 57.536 ms
Median warm batch wall time 72.813 ms 12.447 ms

Process counts held in every round. These timings describe the original component comparison, not final-head or end-to-end latency. The original real-process handler check also exercised replacement invalidation and transient probe failure recovery in 52.80 s wall.

The final actual-handler regressions use real file admission and deterministic probe/authority barriers. They cover cold/warm sharing, replacement, transient failures, third-file metadata, bounded backlog with retry, disconnects for metadata and byte playback, immediate reclamation of a full abandoned queue, and allowed-versus-revoked viewers at queued reopen and probe boundaries. A revoked-only viewer does not trigger the delayed read; another authorized viewer retains shared work. Managed creation tests verify retained original audio/video bytes at saturation and preserve the existing non-busy failure control.

Negative controls reproduced the defects before their repairs: missing duration/playback, an extra orphaned probe, rejected later work after 32 queued clients disconnected, a revoked viewer reopening/probing, and busy metadata causing outgoing delivery failure. Two initial retained-file assertions used the wrong fixture media root; they were corrected to use the persisted root and were not treated as product failures.

Before merging the repaired main, focused validation passed 511 tests across nine files:

node scripts/run-vitest.mjs src/gateway/control-ui-assistant-media-metadata.test.ts src/gateway/control-ui.http.test.ts src/gateway/managed-image-attachments.test.ts src/gateway/managed-image-attachments.authority.test.ts src/gateway/http-byte-range.test.ts src/media/playback-transcode.test.ts src/media/playback-transcode.staging.test.ts src/media/media-probe.test.ts src/shared/permit-pool.test.ts --maxWorkers=1

Pre-integration wall time: 160.41 s, including worker preparation. Gateway: 385 tests in 135.16 s; media: 123 tests in 9.48 s; permit pool: 3 tests in 0.572 s. New scenarios use deferred/event barriers, without sleeps, polling, or per-test Gateway boots.

The last outgoing-delivery regression holds both real inspection slots and invokes actual managed creation. Before immediate admission, it reached the lane's natural 120 s test deadline; afterward it passed in 26 ms on the first positive run. That run also exposed seven fixture ReferenceErrors caused by a removed import alias during helper extraction; restoring the alias fixed them, and the complete final cohort above passed. No timeout or assertion was weakened.

Earlier focused proof passed 510 tests in 367.35 s and a targeted replay passed 134 tests in 141.02 s. Production typechecking, all 25 selected test typecheck groups, typed lint, formatting, and the line/assertion ratchets passed. The all-in-one local changed-check run was not completed; its formatting and initialization-type findings were fixed and checked directly. Hosted exact-head CI remains the full landing gate.

Fresh independent Codex review of the complete staged candidate is scoped-clean through P2, with no accepted/actionable findings. The earlier lane's incomplete Vitest runs were superseded by the passing focused proof. No full local build or live Gateway swarm is claimed.

CI run 36215981273 failed the assertion-safety ratchet after an existing cast moved into the new error-classification module; fail-fast canceled the remaining selected jobs. The unnecessary cast was removed using the existing type narrowing, and its old file's allowance was tightened from 2 to 1. No failing CI job was rerun without a code correction.

CI run 36220093091 failed typed lint because the new authority regression compared a guaranteed boolean method result with false unnecessarily. The test now calls that method directly; local typed lint passed. Fail-fast canceled downstream checks. New CI runs followed source corrections; no jobs were rerun merely to obtain green.

CI run 36222683624 failed lint:no-chained-type-assertions in src/gateway/server-chat-progress-snapshot.ts, an unrelated main change. Main repair 66b812f26e725cd709e08860d2cb46ba496cd308 replaced that assertion chain with typed boxed-number coercion. Merged repaired main at 837fad120fbab0c0df0dd7bc7009dd90decfbd38 without conflicts; no rebase or CI rerun. The exact failing boundary-lint command now passes locally.

The final integration replay passed 506 tests across the same nine files in 86.95 s wall (380 Gateway, 123 media, 3 permit-pool tests). Current main's separate static-serving changes reduced the existing Control UI HTTP test count by five; this PR's playback regressions remain present. Fresh independent review against merged main is scoped-clean through P2. ClawSweeper completed review of merged head 37aaef2ded6d65947e9db3d2b03490e9553c2286 at 06:25 UTC with no actionable findings. Exact-head CI run 36223378189 passed, including the final openclaw/ci-gate at 06:34:41 UTC. Hosted boundary checks took 172 s and core lint took 271 s, including their job setup. No CI jobs were manually rerun.

@clawsweeper

clawsweeper Bot commented Sep 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 docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: L labels Sep 26, 2026
@steipete
steipete marked this pull request as ready for review September 26, 2026 01:42
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 2:25 AM ET / 06:25 UTC (Revision 6).

ClawSweeper review

What this changes

The branch shares audio and video attachment inspections across Control UI metadata, playback, and outgoing media creation, with bounded queueing and cancellation.

Merge readiness

✅ Ready for maintainer review

Keep open. Pinned main still performs a separate probe for each metadata request, while this PR remains a useful, well-supported candidate. The earlier review findings are addressed in the current source, and this review found no new actionable defect.

Priority: P2
Reviewed head: 37aaef2ded6d65947e9db3d2b03490e9553c2286

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong boundary proof and resolved earlier findings support a good patch; exact-head CI remains in progress.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The recorded real-ffprobe handler comparison observes fewer child processes after the change; final-head handler coverage uses real file admission and injected probe and revocation barriers to show shared results, canceled queued work, forbidden-viewer rejection before delayed I/O, and outgoing attachment preservation under saturation. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The recorded real-ffprobe handler comparison observes fewer child processes after the change; final-head handler coverage uses real file admission and injected probe and revocation barriers to show shared results, canceled queued work, forbidden-viewer rejection before delayed I/O, and outgoing attachment preservation under saturation. No stored-data contract changes.
Evidence reviewed 10 items Current main still repeats metadata probes: The pinned main handler probes the opened descriptor for each audio or video metadata request before calling the separate playback classifier.
Shared inspection and bounded admission: The PR head keys inspection jobs by file identity, joins same-file consumers, caps distinct pending jobs, and removes abandoned pending jobs.
Authority at delayed file effects: Queued inspection checks a live consumer before reopening the file and again before invoking the descriptor probe; the Control UI supplies its current-policy assertion.
Findings None None.
Security None None.

How this fits together

The Gateway turns local attachment files into metadata and playable responses for Control UI clients, and prepares managed attachments for outgoing replies. Its media inspection path supplies display facts and playback decisions after checking file identity and request access.

flowchart LR
  A[Local attachment] --> B[Gateway media request]
  C[Current viewer access] --> B
  B --> D[Shared inspection queue]
  D --> E[File identity and access checks]
  E --> F[Metadata and playback choice]
  F --> G[Control UI or outgoing reply]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +162, Tests +431, Docs +11, Other 0. Total +604 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 9 452 290 +162
Tests 7 801 370 +431
Docs 1 11 0 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 18 1265 661 +604

Review metrics

Metric Value Why it matters
Real probe processes Ten-request batches: cold 10 → 1; warm 10 → 0 The recorded handler measurement directly addresses the PR's concurrency goal.
Code growth Production net +162 lines; tests and test support net +431 lines Production growth funds shared admission and access checks while replacing duplicate probing; the added tests cover the earlier concrete failures.

Technical review

Best possible solution:

Keep one bounded, access-scoped inspection owner that preserves original outgoing attachments when optional playback facts are unavailable.

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

Yes. Pinned main invokes a descriptor probe for each audio or video metadata request, and the PR records a real-process ten-request handler comparison; this reviewer did not execute the path.

Is this the best way to solve the issue?

Yes. Consolidating inspections in the existing playback owner removes the duplicate probe path while preserving bounded admission and current-access checks.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded attachment playback performance improvement with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster 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 recorded real-ffprobe handler comparison observes fewer child processes after the change; final-head handler coverage uses real file admission and injected probe and revocation barriers to show shared results, canceled queued work, forbidden-viewer rejection before delayed I/O, and outgoing attachment preservation under saturation. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The recorded real-ffprobe handler comparison observes fewer child processes after the change; final-head handler coverage uses real file admission and injected probe and revocation barriers to show shared results, canceled queued work, forbidden-viewer rejection before delayed I/O, and outgoing attachment preservation under saturation. No stored-data contract changes.

Evidence

What I checked:

  • Current main still repeats metadata probes: The pinned main handler probes the opened descriptor for each audio or video metadata request before calling the separate playback classifier. (src/gateway/control-ui.ts:454, 837fad120fba)
  • Shared inspection and bounded admission: The PR head keys inspection jobs by file identity, joins same-file consumers, caps distinct pending jobs, and removes abandoned pending jobs. (src/media/playback-transcode.ts:270, 37aaef2ded6d)
  • Authority at delayed file effects: Queued inspection checks a live consumer before reopening the file and again before invoking the descriptor probe; the Control UI supplies its current-policy assertion. (src/media/playback-transcode.ts:178, 37aaef2ded6d)
  • Outgoing delivery under saturation: Managed outgoing creation requests immediate inspection admission and treats only the canonical busy result as optional metadata loss. (src/gateway/managed-image-attachments.ts:1457, 37aaef2ded6d)
  • Forbidden and allowed viewer coverage: The actual assistant-media handler test uses real file admission and injected revocation at queued reopen and probe boundaries; revoked viewers receive 404 while an authorized shared viewer retains work. (src/gateway/control-ui-assistant-media-metadata.test.ts:369, 37aaef2ded6d)
  • Recorded behavior proof and prior review: The captured PR body reports real-ffprobe handler batches changing from 10 to 1 cold children and 10 to 0 warm children, plus a 506-test post-integration replay. The prior completed review at c496076 retained no findings.

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • Dallin Romney: 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 (5 earlier review cycles)
  • reviewed September 25, 2026, 9:59 PM ET / September 26, 2026, 01:59 UTC sha unknown :: blocked before merge. :: [P1] Preserve metadata when distinct-file inspection slots are full
  • reviewed 2026-09-26T03:09:28.019Z sha 7765014 :: blocked before merge. :: [P2] Bound and release pending playback inspections
  • reviewed 2026-09-26T03:57:55.308Z sha 704722b :: needs real behavior proof before merge. :: [P1] Keep outgoing attachments when inspection is busy | [P2] Release abandoned jobs from queue capacity | [P2] Recheck read authority before a queued file reopen
  • reviewed 2026-09-26T05:19:59.911Z sha 5b215e2 :: blocked before merge. :: [P1] Keep optional inspection from delaying outgoing replies
  • reviewed 2026-09-26T06:10:56.825Z sha c496076 :: needs maintainer review before merge. :: none

Queue distinct playback inspections behind the existing two-probe limit while sharing pending work by file identity. Release caller-owned descriptors before waiting; the inspection owner reopens and validates the captured identity.

Replace the capacity-fallback expectation with an HTTP regression that failed on the prior head with missing duration and transcode classification. It now covers queued same-file sharing and descriptor disposal. Independent Codex review is clean through P2.
@steipete

Copy link
Copy Markdown
Contributor Author

Addressed the capacity finding in 7765014. Distinct inspections now wait behind the two-probe limit, queued same-file requests share their result, and callers release source descriptors before waiting. The inspection owner reopens and verifies the captured file identity.

The HTTP regression failed on the previous head with missing duration and transcode classification, then passed with the correction. Final focused validation passed 256 tests across five files; fresh independent Codex review is clean through P2. The PR body contains the commands and measured cost. Exact-head CI is running.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 26, 2026
Limit distinct queued inspections to 32 behind two active probes. Track consumer cancellation within the shared identity-keyed owner, skip orphaned queued work, and keep live consumers when another viewer disconnects.

Return existing retryable metadata-unavailable and playback-preparing outcomes at saturation. Bind byte inspection cancellation to the byte-stream owner, preserve descriptor identity checks, and move coherent helpers out of oversized Gateway modules.

Overflow and abandoned-work HTTP regressions failed on the prior head. The final focused cohort passed 496 tests across seven files; independent Codex review is clean through P2.
@steipete

Copy link
Copy Markdown
Contributor Author

Addressed bounded admission and cancellation in 704722b. The inspection owner admits two active probes plus 32 distinct pending jobs. A full queue produces retryable metadata unavailability or the existing playback-preparing response. Each consumer can detach; a queued job with no live consumers skips its probe, while another live viewer retains shared work. Byte requests use cancellation from their byte-stream owner.

The actual-handler overflow and abandoned-work regressions failed on the previous head. Final validation passed 496 tests across seven files, including a disconnected byte-playback request and later live work. Independent Codex review is clean through P2; formatting, lint, and line-cap ratchets passed. The PR body records the complete proof and measured cost. Exact-head CI is running.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 26, 2026
Remove the unnecessary type assertion exposed by moving error classification to its own module. The assertion-safety ratchet and targeted lint pass; independent review is clean through P2.
Reuse the FIFO permit pool to reclaim orphaned pending inspection slots immediately. Revalidate each viewer at queued file-open and probe boundaries while retaining shared work for authorized viewers. Keep outgoing media and original bytes when optional inspection is busy.

The negative controls reproduced queue starvation, late reads after revocation, and failed outgoing attachments. Validation passed 510 focused tests plus a 134-test final replay, production and test typechecks, and fresh independent review through P2. Move unchanged policy and fixture helpers to their existing owners to satisfy line caps.

Complete the assertion-safety cleanup by shrinking the control-ui.ts allowance from 2 to 1. The prior removal left a stale allowance; the ratchet now passes with this exact shrink.
@steipete

Copy link
Copy Markdown
Contributor Author

Addressed the remaining findings in 5b215e2:

  • The existing FIFO permit pool removes orphaned pending work immediately. The handler regression fills all 32 pending slots, disconnects those viewers, and admits later live work before the two active probes finish.
  • Outgoing audio/video creation handles only the canonical busy-inspection error as optional metadata loss. The returned attachment, persisted record, and exact original bytes survive; non-busy failure behavior remains covered.
  • Queued inspection checks current authority before safe-open and again before probing. Actual-handler tests distinguish allowed and revoked viewers both while queued and during safe-open. The revoked-only source is not reopened when revoked in the queue and is not probed when revoked during open; another authorized viewer retains shared work. All descriptors close.

These cases failed for the intended reasons before the repair and now pass. The expanded suite passed 510 tests across nine files; the final replay passed 134 tests across five files. Production and all test typecheck shards pass, and fresh independent review is clean through P2. The PR body records the exact commands, timings, original real-ffprobe evidence, and CI failure cause. The current head's hosted CI is running.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 26, 2026
Use immediate permit admission for managed outgoing media while retaining shared active and cached inspections. Busy capacity preserves the attachment without optional playback facts instead of queueing delivery behind viewer requests.

Prove actual managed creation completes with both inspection slots held. The final focused run passed 511 tests in 160.41 seconds, all 25 test type groups and typed lint passed, and fresh independent review found no actionable issues through P2. Restore the extracted fixture alias and simplify the authority test boolean check caught by hosted lint.
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head c496076 fixes the remaining outgoing-delivery delay. Managed creation now requests immediate admission: it reuses cached or active same-file inspection, but never joins queued work or waits for a free slot. The canonical busy outcome preserves the outgoing attachment and original bytes without optional playback metadata. The existing FIFO permit pool remains the sole admission owner.

The regression invokes actual managed creation while both inspection slots remain held. It reached the natural 120 s test deadline before the repair, then passed in 26 ms on the first positive run. The final nine-file cohort passed 511 tests in 160.41 s; all 25 selected test typecheck groups and typed lint passed. Fresh independent review of the complete candidate and the final staged correction found no actionable issues through P2. The hosted lint finding was also fixed by directly calling the guaranteed boolean authority method.

The body records the full proof, earlier fixture failures, CI failures and their causes. Please review this exact head, including immediate admission, shared consumers, cancellation and current-authority checks.

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 26, 2026
Merge origin/main at 837fad1 after CI 36222683624 failed on an unrelated chained cast in server-chat-progress-snapshot.ts. Main repair 66b812f removes the invalid assertion chain.

Automatic integration was conflict-free. The exact boundary lint command passes, the focused nine-file cohort passes in 86.95 seconds, and independent review of the candidate against the merged main found no actionable issues through P2.
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 37aaef2 merges repaired main without conflicts after CI 36222683624 failed on an unrelated main defect: the chained cast in server-chat-progress-snapshot.ts, fixed by main commit 66b812f. This preserves the reviewed playback change; it does not rebase the branch or rerun the failed CI jobs.

The exact failed boundary-lint command passes locally. The post-merge nine-file playback/Gateway/permit-pool replay passes 506 tests in 86.95 s, and fresh independent review of the complete candidate against merged main is scoped-clean through P2. Your previous candidate review established no remaining findings. Please refresh the exact-head review for this integration commit.

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 2c914a1 into main Sep 26, 2026
226 of 228 checks passed
@steipete
steipete deleted the perf/l31-playback-metadata branch September 26, 2026 06:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

* perf(media): share playback metadata inspections

* test(media): isolate playback metadata route coverage

* fix(media): retain metadata while inspection slots are busy

Queue distinct playback inspections behind the existing two-probe limit while sharing pending work by file identity. Release caller-owned descriptors before waiting; the inspection owner reopens and validates the captured identity.

Replace the capacity-fallback expectation with an HTTP regression that failed on the prior head with missing duration and transcode classification. It now covers queued same-file sharing and descriptor disposal. Independent Codex review is clean through P2.

* fix(media): bound and cancel pending playback inspections

Limit distinct queued inspections to 32 behind two active probes. Track consumer cancellation within the shared identity-keyed owner, skip orphaned queued work, and keep live consumers when another viewer disconnects.

Return existing retryable metadata-unavailable and playback-preparing outcomes at saturation. Bind byte inspection cancellation to the byte-stream owner, preserve descriptor identity checks, and move coherent helpers out of oversized Gateway modules.

Overflow and abandoned-work HTTP regressions failed on the prior head. The final focused cohort passed 496 tests across seven files; independent Codex review is clean through P2.

* fix(media): use narrowed attachment error codes

Remove the unnecessary type assertion exposed by moving error classification to its own module. The assertion-safety ratchet and targeted lint pass; independent review is clean through P2.

* fix(media): preserve queued read authority and outgoing attachments

Reuse the FIFO permit pool to reclaim orphaned pending inspection slots immediately. Revalidate each viewer at queued file-open and probe boundaries while retaining shared work for authorized viewers. Keep outgoing media and original bytes when optional inspection is busy.

The negative controls reproduced queue starvation, late reads after revocation, and failed outgoing attachments. Validation passed 510 focused tests plus a 134-test final replay, production and test typechecks, and fresh independent review through P2. Move unchanged policy and fixture helpers to their existing owners to satisfy line caps.

Complete the assertion-safety cleanup by shrinking the control-ui.ts allowance from 2 to 1. The prior removal left a stale allowance; the ratchet now passes with this exact shrink.

* fix(media): keep optional inspection off the outgoing queue

Use immediate permit admission for managed outgoing media while retaining shared active and cached inspections. Busy capacity preserves the attachment without optional playback facts instead of queueing delivery behind viewer requests.

Prove actual managed creation completes with both inspection slots held. The final focused run passed 511 tests in 160.41 seconds, all 25 test type groups and typed lint passed, and fresh independent review found no actionable issues through P2. Restore the extracted fixture alias and simplify the authority test boolean check caught by hosted lint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime 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: XL 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