Repository navigation
fix(slack): infer file extensions for unnamed media uploads - #119399
Conversation
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs real behavior proof before merge. Reviewed August 4, 2026, 10:04 PM ET / August 5, 2026, 02:04 UTC. ClawSweeper reviewWhat this changesThis PR infers a filename extension from MIME metadata for unnamed Slack uploads and adds regression cases for that fallback. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 2 items remain Keep open: the focused Slack-plugin repair is correct on the reviewed source path, but the supplied evidence is mock-only and does not yet demonstrate an after-fix upload in a real Slack setup or qualifying gateway harness. Priority: P2 Review scores
Verification
How this fits togetherThe Slack plugin loads outbound media, chooses the filename passed to Slack’s external-upload API, then finalizes the uploaded file in the target channel. This change affects the filename-selection step without changing media loading, upload transport, or finalization. flowchart LR
A[Outbound media URL] --> B[Shared media loader]
B --> C[Filename selection]
C --> D[Slack upload URL request]
D --> E[Byte upload]
E --> F[Slack file finalization]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +3, Tests +97. Total +100 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain this plugin-local use of the shared MIME helper and attach redacted after-fix Slack upload proof showing the inferred filename before landing. Do we have a high-confidence way to reproduce the issue? No high-confidence real-world reproduction is attached: current source proves the unnamed fallback is Is this the best way to solve the issue? Yes: this is the narrowest maintainable repair because it changes the Slack-owned filename fallback and reuses the existing public MIME-normalization helper, matching the Discord precedence pattern. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6a8e11e63cee. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(slack): infer file extensions for unnamed media uploads This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Merged via squash.
|
* origin/main: (22 commits) refactor(plugins): consolidate lifecycle hook dispatch (#119429) fix(ci): stabilize TUI PTY proof ownership (#119420) test(system-agent): reduce suite setup overhead (#119424) fix(ui): keep session rail pill status from overlapping the headline (#119397) fix(discord): avoid doctor runtime loading (#119391) fix(media): decouple playback cache retention (#119417) fix(slack): infer upload filename extensions from MIME types (#119399) refactor(channels): unify configured binding resolution (#119414) refactor(google-meet): unify gateway and tool dispatch (#119413) test(state): reuse legacy database fixtures (#119423) fix(reset): preserve bootstrap guidance for dynamic models (#119179) fix(chutes): honor serving context limits (#119196) refactor(status): consolidate scan projections and lazy loaders (#119412) fix(status): status --all slows down with missing plugins (#119203) refactor(gateway): consolidate usage reporting and caches (#119409) perf(gateway): keep reload and recovery machinery off gateway cold start (#119094) fix(cli): align TaskFlow controller columns for wide text (#118801) fix: make startup migration restart guidance install-neutral (#119406) fix(ci): preserve cache warmer shard envelopes (#119403) fix(sessions): preserve compatible auth profiles on model changes (#117550) ...
…w#119399) Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Slack uploads without a source filename were sent as
uploadeven when their detected MIME type identified a PDF, PNG, MP3, or another known format. Slack classifies and previews uploaded files from their filename extension, so these otherwise valid documents, images, and audio files could render or unfurl incorrectly.Why This Change Was Made
The existing Slack upload owner now uses the already-public canonical MIME-to-extension helper when it must synthesize a filename. Operator-provided filenames, loader-provided filenames, explicit titles, unknown MIME types, missing MIME metadata, upload bytes, destinations, and existing network controls retain their current behavior.
User Impact
Unnamed Slack attachments now arrive as recognizable files such as
upload.pdf,upload.png, orupload.mp3; existing filenames and titles remain untouched.Evidence
fd08588246725e59cc6111dc1c92b1ede25b65b4; immutable parent:73535e4ede7eaa51cd4f97f4087657b05814e3d4; exact two-file full-index binary patch SHA-256:0dfd3d3d3d919adfab2fe9c075043bae6d8ba6de886d0c904da603b0c7c0310b.files.getUploadURLExternal({ filename, length })boundary for PDF, PNG, MP3, MIME aliases/parameters, explicit source/operator filenames, explicit titles, and unknown or absent MIME metadata. The Slack API is mocked; this does not claim a live Slack workspace.filename: stringand explicitly warns that a missing filename extension causes unexpected unfurl behavior. Existing publicopenclaw/plugin-sdk/media-mimeowns normalization and preferred extensions; no dependency, API endpoint, SDK surface, auth, configuration, storage, or protocol changes.gpt-5.6-solhigh-reasoning P3/no-web review found zero issues at 0.97 confidence; authenticated TruffleHog was clean.Real authenticated Gateway behavior proof
Exact-head mock-Gateway run 30970270285 passed: authenticated Gateway + mock OpenAI provider + real Slack WebClient produced upload.pdf (51 bytes) and upload.png (68 bytes), uploaded the original bytes, finalized both files, and returned successful operator-visible results.
The isolated Linux Blacksmith Testbox completed its exact-head runtime proof with process exit 0. The harness starts a real ephemeral authenticated OpenClaw Gateway, executes a genuine mock-model agent request, and submits three actual public
message.actionupload requests through the real Slack plugin, shared guarded media loader, installed Slack Web API client, authenticated mock Slack HTTP API, original-byte uploads, and real finalization calls.{ "verdict": "PASS", "head": "fd08588246725e59cc6111dc1c92b1ede25b65b4", "patchSha256": "0dfd3d3d3d919adfab2fe9c075043bae6d8ba6de886d0c904da603b0c7c0310b", "gateway": { "actualProcess": true, "authenticated": true }, "provider": { "mode": "mock-openai", "model": "mock-openai/gpt-5.6-luna", "requestCount": 1 }, "control": { "explicitFilename": "upload", "observedFilename": "upload" }, "after": { "pdf": { "filename": "upload.pdf", "contentType": "application/pdf", "bytes": 51, "completed": true }, "png": { "filename": "upload.png", "contentType": "image/png", "bytes": 68, "completed": true } }, "parentCommitExecuted": false, "liveSlackService": false, "liveModelProvider": false, "childNonLoopbackTcpDenied": true, "childNonLoopbackDnsDenied": true, "osLevelEgressIsolation": false, "cleanup": { "gatewayExited": true, "providerStopped": true, "slackFixtureClosed": true, "errorCount": 0 } }This directly resolves both ClawSweeper before-merge proof items and its requested rank-up move. The extensionless control is an actual Gateway request preserving explicit-filename behavior; the parent commit was authenticated but was not executed. Slack and the model are isolated mocks, not live external services.