Skip to content

fix(slack): retain unavailable attachments alongside downloads - #129708

Merged
steipete merged 3 commits into
mainfrom
codex/qa-slack-partial-attachment-fallback-20260825
Aug 26, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/qa-slack-partial-attachment-fallback-20260825

Conversation

@steipete

@steipete steipete commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When Slack sends a mixture of downloadable and unavailable attachments, OpenClaw must deliver successful files while preserving useful fallback references for the failures. The initial repair tried to match successful files using rendered placeholder filenames; Slack's actual downloader gives HTTP Content-Disposition precedence over the original event filename, so ID-less renamed attachments were falsely reported as unavailable.

Track authoritative attachment identity at the Slack media producer instead of inferring identity from rendered output. The producer records exact successfully resolved SlackFile objects, reuses canonical preloaded objects across direct/forwarded duplicate IDs, and returns only genuinely unresolved files. The downstream consumer no longer parses presentation strings to reconstruct file ownership.

Full production delta: +26/-26 (net 0). Tests: +118/-13.

Verification

  • Independently inspected the shared downloader's Content-Disposition filename-precedence contract and ordered concurrent-download result ownership.
  • Captured authentic failing full Slack message preparation for renamed ID-less downloads alongside failed attachments and overlapping names.
  • Verified renamed successes, real unavailable siblings, overlapping/duplicate IDs, direct and forwarded preloaded voice files, ID-less attachments, ordered download results, and unchanged media limits.
  • Ran complete Slack media and message-preparation owner suites: 238 tests passed.
  • Targeted type-aware lint, formatting, git diff --check, changed-surface classification, and a fresh integrated complete-branch independent P1 review passed.
  • No live Slack channel, account, credentials, or external service was touched.

Risk

Low: plugin-owned attachment identity and fallback presentation only; no sender-identity, authentication, channel-policy, persistent-state, or public configuration changes. Addresses ClawSweeper's renamed-attachment finding directly.

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: S maintainer Maintainer-authored PR labels Aug 26, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. 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 Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 2:45 AM ET / 06:45 UTC.

ClawSweeper review

What this changes

The PR preserves source Slack-file identity through media resolution so successful downloads and genuinely unavailable sibling attachments both reach the prepared agent message.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

No blocking code finding: the branch addresses the prior identity-loss finding at the Slack media owner. Keep this maintainer-labeled PR open for explicit maintainer handling and exact-head CI completion.

Priority: P1
Reviewed head: 18224d2ef1518cfe03ac07bc3072cf18c25b2207
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused, source-backed repair of the prior finding with useful owner-boundary regression coverage.
Proof confidence 🌊 off-meta tidepool Not applicable: The PR is maintainer-authored, so the external-contributor proof gate does not apply; the available media manifest contains no inspectable authenticated Slack artifact.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The PR is maintainer-authored, so the external-contributor proof gate does not apply; the available media manifest contains no inspectable authenticated Slack artifact.
Evidence reviewed 5 items Current-main defect: Current main suppresses all fallback file references whenever any media placeholder exists, so a successful sibling can hide an unavailable attachment.
Owner-boundary repair: The branch records exact resolved SlackFile objects during media resolution and returns only candidates not in that set as unavailable files.
Rendered filename contract: The shared media downloader gives Content-Disposition filenames precedence over the original file-path hint, so rendered placeholders cannot safely identify the source Slack file.
Findings None None.
Security None None.

Live Verification

Command: pnpm test extensions/slack/src/monitor/media.test.ts extensions/slack/src/monitor/message-handler/prepare.test.ts

Result: FAIL (failed) — step 1 run pnpm test extensions/slack/src/monitor/media.test.ts extensions/slack/src/monitor/message-handler/prepare.test.ts: previous terminal command was still running after 30 seconds: "pnpm test extensions/slack/src/monitor/media.test.ts extensions/slack/src/monitor/message-handler/prepare.test.ts"

$ node --import tsx scripts/test-projects.mts extensions/slack/src/monitor/media.test.ts extensions/slack/src/monitor/message-handler/prepare.test.ts
[test] starting test/vitest/vitest.extension-slack.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129708-rQotnE/target

Assertions:

  • FAIL expect_output: Test Files

How this fits together

The Slack plugin collects direct and forwarded attachment candidates, resolves downloadable files to agent media, and renders unresolved files as fallback references in the agent-visible message body.

flowchart LR
  A[Slack message event] --> B[Attachment candidates]
  B --> C[Slack media resolution]
  C --> D{Resolved file?}
  D -->|Yes| E[Agent media payload]
  D -->|No| F[Fallback file reference]
  E --> G[Prepared agent message]
  F --> G
Loading

Decision needed

Question Recommendation
Should this maintainer-labeled Slack delivery fix merge once exact-head required checks complete successfully? Merge after exact-head validation: Confirm required checks on the reviewed head are green, then accept the producer-owned identity repair.

Why: The repository’s protected maintainer label requires explicit maintainer handling despite the focused repair and absence of a code finding.

Before merge

  • Resolve merge risk (P1) - This message-delivery path has source-level regression coverage, but exact-head CI is still in progress and the review could not inspect authenticated Slack media; the downloaded proof manifest records Slack URLs failing with HTTP 400.
  • Complete next step (P2) - The maintainer label and in-progress exact-head checks require normal maintainer handling; no mechanical repair remains.
Agent review details

Security

None.

PR surface

Source 0, Tests +105. Total +105 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 26 26 0
Tests 2 118 13 +105
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 144 39 +105

Review metrics

Metric Value Why it matters
Production versus test delta production +26/-26 (net 0); tests +118/-13 (net +105) The fix replaces presentation-string inference with resolved attachment identity while adding boundary regressions without net production growth.

Merge-risk options

Maintainer options:

  1. Complete exact-head delivery validation (recommended)
    Wait for the required checks on the reviewed head and retain the mixed-success/failure regression coverage before merge.
  2. Accept the focused owner-boundary proof
    A maintainer may merge with the source-backed repair and focused tests despite no authenticated Slack-channel recording.

Technical review

Best possible solution:

Retain the producer-owned resolved-file set as the single source of truth, then merge after exact-head validation confirms mixed successful and unavailable Slack attachments remain separately visible.

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

Yes, at source level: current main renders fallback files only when no media resolves, and the branch’s mixed downloadable/unavailable fixture exercises the contrary case.

Is this the best way to solve the issue?

Yes. Recording exact resolved producer objects avoids reconstructing attachment identity from mutable presentation filenames and preserves the existing media limit and duplicate-ID behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0229fe7a2a90.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR is maintainer-authored, so the external-contributor proof gate does not apply; the available media manifest contains no inspectable authenticated Slack artifact.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, 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:

  • P1: The PR repairs a Slack attachment-delivery path where an unavailable sibling can be omitted from the agent-visible message.
  • merge-risk: 🚨 message-delivery: The changed logic selects which Slack files are delivered as media and which remain as fallback references.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR is maintainer-authored, so the external-contributor proof gate does not apply; the available media manifest contains no inspectable authenticated Slack artifact.

Evidence

What I checked:

Likely related people:

  • Peter Lee: Current-main blame attributes the attachment candidate and fallback-selection region to this contributor. (role: recent area contributor; confidence: high; commits: 89525828e0e8; files: extensions/slack/src/monitor/media.ts, extensions/slack/src/monitor/message-handler/prepare-content.ts)

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 (2 earlier review cycles)
  • reviewed 2026-08-26T00:34:59.305Z sha 5c1d39f :: needs changes before merge. :: [P2] Carry source identity instead of parsing placeholders
  • reviewed 2026-08-26T01:18:10.211Z sha 5c1d39f :: found issues before merge. :: [P2] Carry the originating file identity with downloaded media

@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. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 26, 2026
@steipete
steipete merged commit 8c20318 into main Aug 26, 2026
93 checks passed
@steipete
steipete deleted the codex/qa-slack-partial-attachment-fallback-20260825 branch August 26, 2026 07:11
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

* fix(slack): retain unavailable attachments alongside downloads

* fix(slack): retain original attachment identity through download

* test(slack): narrow optional attachment regression types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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