Repository navigation
fix(media): preserve Matroska extensions after byte detection - #133383
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 1:31 PM ET / 17:31 UTC. ClawSweeper reviewWhat this changesThe PR normalizes byte-detected Matroska MIME values to OpenClaw’s canonical Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep this PR open for normal maintainer review: current main still passes the detector’s Matroska spelling through without an Priority: P2 Review scores
Verification
How this fits togetherMedia Core classifies attachment bytes and filenames into a MIME type used by media storage and delivery code. Its normalized result determines the saved filename extension and downstream media handling. flowchart LR
A[Attachment bytes] --> B[Byte MIME detector]
C[Filename and header hints] --> D[MIME normalization]
B --> D
D --> E[Canonical MIME type]
E --> F[Extension lookup]
F --> G[Saved media filename]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +1, Tests +8. Total +9 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Merge the shared Matroska synonym and retain the focused byte-detection regression coverage, so all consumers receive the established canonical MIME before extension lookup. Do we have a high-confidence way to reproduce the issue? Yes, with high confidence from source and supplied exact-head evidence: Is this the best way to solve the issue? Yes. Folding the detector spelling at the existing MIME synonym boundary is cleaner than adding media-store fallbacks, and matches the established AVI alias pattern. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2548efddff51. 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) |
|
Exact-head behavior proof for The regression enters the real @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer review confirms this is the shared normalization fix: pinned The contributor's exact-head proof records one failing detector regression before the mapping, all 190 tests passing afterward, and a real media-store save/read preserving all 16 fixture bytes with the The latest ClawSweeper review has no remaining source finding or rank-up move. Production grows by one necessary synonym; tests add eight lines. No new configuration, parser, storage schema, or format family. Release-note context: byte-detected Matroska attachments retain their canonical |
|
Merged via squash.
|
…cked-delivery * origin/main: fix(ui): wait for restored draft before clearing (openclaw#133575) fix(deps): update fast-uri security patches (openclaw#133572) test: reduce workflow sanity fixture cleanup time (openclaw#133588) fix(media): normalize detected Matroska MIME (openclaw#133383) refactor(docker): retire ClawDock shell helpers (openclaw#133594) perf(browser): reuse snapshot refs and screenshot metadata (openclaw#133598) perf: load web chat history in larger, faster batches (openclaw#133565) fix(plugins): keep bundled plugins bundled when selected by plugins.load.paths (openclaw#133584) test: isolate shared /tmp session-store paths in runner and health suites (openclaw#133568) fix(cron): avoid no-op schedule repair writes (openclaw#133552)
What Problem This Solves
Briefly describe the problem and fix:
video/matroska, while OpenClaw's filename and extension tables usevideo/x-matroska. Extensionless or mislabeled MKV input therefore loses the canonical.mkvmapping after sniffing.Change Type
Scope
Verification
Evidence
node scripts/run-vitest.mjs packages/media-core/src/mime.test.tsfailed only the new regression: expectedvideo/x-matroska, receivedvideo/matroska(189 passed, 1 failed).origin/main, the same focused suite passes: 190/190.[email protected]detector returns{ ext: "mkv", mime: "video/matroska" }for the regression header.9fb8cb5b791c081f71de623d54f24347aa7f2720, Node 24.16.0): a byte-sniffed Matroska buffer was persisted asvideo/x-matroskawith.mkv, then fetched byte-for-byte (storedBytes=16,fetchedBytes=16,bytesMatch=true).User Impact
Byte-detected Matroska attachments retain the same canonical MIME and
.mkvextension behavior as filename-detected MKV files.Risks and Rollback
video/matroska.AI Assistance
AI-assisted by Codex. I reviewed the implementation, dependency behavior, focused red/green test, and final commit-scoped review.