Skip to content

fix(signal): preserve original filenames in outbound attachments - #115107

Merged
steipete merged 1 commit into
mainfrom
codex/signal-original-attachment-filename
Aug 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/signal-original-attachment-filename

Conversation

@steipete

@steipete steipete commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Salvages existing Signal PR #115107: attachments sent through the signal-cli REST container exposed OpenClaw's internal staged UUID suffix instead of their original filename. Three genuine filename delimiter failures also remained: semicolons truncate the provider's filename metadata, commas corrupt the decoded data-URI bytes, and hash characters turn the payload into a URL fragment.

Why This Change Was Made

Repair the single canonical Signal attachment serializer instead of adding transport wrappers or alternate send paths. Reuse the existing public media-runtime original-filename owner, then replace only the three characters independently proven unsafe by the pinned provider parser and real WHATWG data-URI decoding. Normal spaces, Unicode filenames, attachment MIME detection, byte budgets, and the existing provider contract remain intact. The production change is seven additions and three deletions, net four lines.

Preserves original contributor ZengWen-DT's existing PR work and co-author credit. The previous unrelated Signal installer blocker was fixed on the frozen baseline by #115270; this candidate includes no installer change.

User Impact

Signal recipients see the original user-facing attachment filename rather than an internal UUID-staging name. Filenames containing semicolons, commas, hash characters, or combinations of them still reach the Signal provider with intact original JPEG bytes instead of truncating, silently corrupting the attachment, or failing delivery.

Evidence

  • Existing PR only: fix(signal): preserve original filenames in outbound attachments #115107; original draft head e150c81; retained commit trailer Co-authored-by: ZengWen-DT [email protected].
  • Frozen baseline fdcb321; immutable candidate 9f5c762; exact candidate tree 7c23708adcdde90423370cc40ace5a5019628c2a.
  • Current main 7e78de7 leaves every Signal owner, caller, media-store, SDK barrel, package manifest, and lockfile byte-identical; clean synthetic merge tree 79edddd9ee2b9eed46122f051745a15526b287ff.
  • Pinned upstream signal-cli-rest-api Go parser at commit 54507eba20904238dd4db8056b4529bd3199dbd2 demonstrably splits filename metadata on semicolons. Independent exhaustive 128-ASCII WHATWG decoding and a second 34-character probe show commas corrupt decoded bytes and hash characters abort fragment-tainted data-URI decoding.
  • Frozen baseline real localhost /v2/send was RED for staged UUID/semicolon cases; successive authentic RED matrices independently exposed commas and then hash characters. Final real HTTP matrix covers staged/direct filenames, repeated/mixed delimiters, original UUID stripping, spaces, exact serialized provider payloads, and exact decoded JPEG bytes ff d8 ff e0.
  • Fresh isolated Blacksmith Testbox run https://github.com/openclaw/openclaw/actions/runs/30680814341 verified exact candidate tree, owner-relative physical string-width 8.2.2, pnpm tsgo:extensions, pnpm tsgo:extensions:test, 184/184 focused tests (49 media-store, 79 Signal owner, 42 installer, 14 real HTTP), the complete 43-file Signal owner suite with 772/772 passing, type-aware oxlint, oxfmt, and git diff --check. Final marker SIGNAL_QA400_ALL_GATES_GREEN; wrapper exit 0; owned lease stopped and direct status verified completed.
  • Full-branch genuine autoreview through P3 and genuine TruffleHog: zero P0/P1/P2/P3 findings, patch is correct, confidence 0.96. Three fresh independent blind reviewers separately returned P0=0/P1=0/P2=0/P3=0.

No auth, security policy, public SDK, configuration, protocol, persistence, SQLite schema, installer implementation, retry, or timeout changes.

@openclaw-barnacle openclaw-barnacle Bot added channel: signal Channel integration: signal size: S maintainer Maintainer-authored PR labels Jul 28, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P2 Normal backlog priority with limited blast radius. labels Jul 28, 2026
@clawsweeper

clawsweeper Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 11:11 PM ET / August 1, 2026, 03:11 UTC.

ClawSweeper review

What this changes

The PR restores caller-facing filenames for Signal container attachments and replaces commas, semicolons, and hash characters that make its data-URI filename metadata unsafe.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

This remains necessary: current main still serializes the staged path basename, so Signal recipients can see the internal UUID suffix. The branch changes the single container attachment serializer, uses the existing media-store filename owner, and adds both mocked-send and real-loopback HTTP coverage; no concrete patch defect was found. The maintainer label requires an explicit human merge decision despite the strong proof.

Priority: P2
Reviewed head: 9f5c7624f0ee792d60b98573366cbd2b76827462
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused canonical repair with strong final-head behavior evidence, targeted regression coverage, and no identified correctness or security defect.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR provides after-fix real-loopback HTTP evidence for the final head: it posts through the actual container request path, asserts the serialized payload, and decodes the resulting data URI back to the original JPEG bytes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR provides after-fix real-loopback HTTP evidence for the final head: it posts through the actual container request path, asserts the serialized payload, and decodes the resulting data URI back to the original JPEG bytes.
Evidence reviewed 6 items Current behavior remains unfixed on main: Current main uses nodePath.basename(filePath) when constructing the Signal container data URI, so media-store UUID suffixes remain visible to the recipient.
Canonical filename owner: The existing public media-runtime export delegates to extractOriginalFilename, which strips only the media-store ---<uuid> suffix and otherwise preserves the basename.
Focused patch and proof: The branch imports the public media-runtime helper, replaces the three unsafe delimiters, and adds parameterized serializer and real-loopback HTTP checks that assert the exact payload and decoded JPEG bytes.
Findings None None.
Security None None.

How this fits together

Signal’s container transport turns local outbound attachment paths into base64_attachments data URIs before posting them to the signal-cli REST container. Media-store staging embeds a UUID in filenames, so the serializer must recover the caller-facing name without changing attachment bytes or MIME detection.

flowchart LR
  A[Outbound attachment path] --> B[Media-store staged filename]
  B --> C[Signal container serializer]
  C --> D[Original filename recovery]
  D --> E[Provider-safe data URI]
  E --> F[Signal REST container]
  F --> G[Recipient attachment]
Loading

Decision needed

Question Recommendation
Does the Signal owner approve normalizing ,, ;, and # to underscores in recipient-visible container attachment filenames in order to preserve payload integrity? Approve and merge: Accept the documented provider-safe normalization and merge after GitHub refreshes the behind branch state.

Why: The code and focused proof support the repair, but the protected maintainer label requires an explicit owner decision for the provider-facing presentation contract.

Before merge

  • Resolve merge risk (P1) - GitHub reports the branch as behind current main; although the touched paths have not drifted and a three-way probe found no conflict, merge should use a refreshed base/check state.
Agent review details

Security

None.

PR surface

Source +4, Tests +170. Total +174 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 7 3 +4
Tests 2 170 0 +170
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 177 3 +174

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: extensions/signal/src/client-container.real-server.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Preserve this one-owner serializer repair, refresh the branch against current main if required by GitHub, and land it after the Signal owner confirms the intended provider filename normalization.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Preserve this one-owner serializer repair, refresh the branch against current main if required by GitHub, and land it after the Signal owner confirms the intended provider filename normalization.

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

Yes. Current main deterministically emits the staged basename at extensions/signal/src/client-container.ts:557; the branch’s focused tests construct staged filenames and assert the exact emitted data URI, including a real-loopback HTTP send path.

Is this the best way to solve the issue?

Yes. Reusing the public media-store filename owner in the sole Signal container serializer fixes the producer boundary without adding a parallel send path or changing MIME, byte-budget, configuration, or SDK behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 02457657f012.

Labels

Label justifications:

  • P2: This is a bounded, user-visible Signal attachment filename and delivery-integrity repair with limited channel-specific blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR provides after-fix real-loopback HTTP evidence for the final head: it posts through the actual container request path, asserts the serialized payload, and decodes the resulting data URI back to the original JPEG bytes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR provides after-fix real-loopback HTTP evidence for the final head: it posts through the actual container request path, asserts the serialized payload, and decodes the resulting data URI back to the original JPEG bytes.

Evidence

What I checked:

  • Current behavior remains unfixed on main: Current main uses nodePath.basename(filePath) when constructing the Signal container data URI, so media-store UUID suffixes remain visible to the recipient. (extensions/signal/src/client-container.ts:557, 02457657f012)
  • Canonical filename owner: The existing public media-runtime export delegates to extractOriginalFilename, which strips only the media-store ---<uuid> suffix and otherwise preserves the basename. (src/media/store.ts:127, 02457657f012)
  • Focused patch and proof: The branch imports the public media-runtime helper, replaces the three unsafe delimiters, and adds parameterized serializer and real-loopback HTTP checks that assert the exact payload and decoded JPEG bytes. (extensions/signal/src/client-container.ts:557, 9f5c7624f0ee)
  • No touched-path drift or merge conflict: The three touched paths are byte-identical between the PR base and current main, and the read-only three-way merge probe reported no conflict markers. (extensions/signal/src/client-container.ts:557, 02457657f012)
  • Feature-history routing: The current serializer lines date to the Signal file introduced by the recent outbound-media refactor, making its author the strongest current-main routing candidate. (extensions/signal/src/client-container.ts:542, b8b4a11b3855)
  • Release provenance: The proposed commit is not an ancestor of the latest release and is not on current main, so this is an active unshipped fix rather than an already-implemented cleanup. (9f5c7624f0ee)

Likely related people:

  • steipete: Current-main blame attributes the container attachment serializer to the outbound-media refactor committed by this contributor. (role: recent area contributor; confidence: high; commits: b8b4a11b3855; files: extensions/signal/src/client-container.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 (1 earlier review cycle)
  • reviewed 2026-07-28T09:25:00.238Z sha e150c81 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/signal-original-attachment-filename branch from e150c81 to 9f5c762 Compare August 1, 2026 03:04
@steipete
steipete marked this pull request as ready for review August 1, 2026 03:05
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 1, 2026
@steipete
steipete merged commit 982add9 into main Aug 1, 2026
154 of 158 checks passed
@steipete
steipete deleted the codex/signal-original-attachment-filename branch August 1, 2026 03:34
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to chenyangjun-xy/openclaw that referenced this pull request Aug 1, 2026
* origin/main:
  fix(onboard): stop a full reset from resetting the default workspace when the config is unreadable (openclaw#114110)
  refactor(i18n): remove unused Apple contradiction report (openclaw#117182)
  fix(google): stop scraping Gemini CLI OAuth credentials (openclaw#117167)
  perf: count large histories before Gateway prewarm (openclaw#117118)
  fix(signal): restore provider-safe original attachment filenames (openclaw#115107)
  refactor(channels): unify setup ownership across bundled channels (openclaw#117188)
  fix: allow gateway service commands for named profiles (openclaw#116314)
  fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041)
  fix(ollama): honor model requests and pull completion contracts (openclaw#117171)
  fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168)
  fix(telegram): confirm polling before long poll (openclaw#116970)
  fix(tlon): wire autoDiscoverChannels through the settings-store round-trip (openclaw#114949)
  fix(gateway): yield before post-ready background work (openclaw#117083)
  test(google): cover live transcript overflow
  fix(google): bound live transcript accumulation
sunlit-deng pushed a commit to sunlit-deng/openclaw that referenced this pull request Aug 1, 2026
* commit '441d6ab254df14fb6939a8a261f474904ff9c500': (388 commits)
  fix(qqbot): ignore blank app id fallbacks (openclaw#109460)
  fix(feishu): consume implicit reply targets across media delivery (openclaw#117196)
  fix(exec): preserve approved command output when sessions resume (openclaw#117177)
  fix(qa): use public subagent fanout evidence (openclaw#116832)
  fix(googlechat): cancel unread auth response bodies before release (openclaw#115873)
  fix(queue): prevent cron saturation from starving hook dispatch (openclaw#116666)
  fix(gateway): sessions.steer retry no longer interrupts an active run when replaying a cached idempotency key (openclaw#116969)
  fix(irc): config validation rejects documented channels.irc.configWrites key (openclaw#112392)
  fix(mistral): keep terminal error branch lint-clean
  fix(onboard): stop a full reset from resetting the default workspace when the config is unreadable (openclaw#114110)
  refactor(i18n): remove unused Apple contradiction report (openclaw#117182)
  fix(google): stop scraping Gemini CLI OAuth credentials (openclaw#117167)
  perf: count large histories before Gateway prewarm (openclaw#117118)
  fix(signal): restore provider-safe original attachment filenames (openclaw#115107)
  refactor(channels): unify setup ownership across bundled channels (openclaw#117188)
  fix: allow gateway service commands for named profiles (openclaw#116314)
  fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041)
  fix(ollama): honor model requests and pull completion contracts (openclaw#117171)
  fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168)
  fix(telegram): confirm polling before long poll (openclaw#116970)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
* origin/main:
  fix(onboard): stop a full reset from resetting the default workspace when the config is unreadable (openclaw#114110)
  refactor(i18n): remove unused Apple contradiction report (openclaw#117182)
  fix(google): stop scraping Gemini CLI OAuth credentials (openclaw#117167)
  perf: count large histories before Gateway prewarm (openclaw#117118)
  fix(signal): restore provider-safe original attachment filenames (openclaw#115107)
  refactor(channels): unify setup ownership across bundled channels (openclaw#117188)
  fix: allow gateway service commands for named profiles (openclaw#116314)
  fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041)
  fix(ollama): honor model requests and pull completion contracts (openclaw#117171)
  fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168)
  fix(telegram): confirm polling before long poll (openclaw#116970)
  fix(tlon): wire autoDiscoverChannels through the settings-store round-trip (openclaw#114949)
  fix(gateway): yield before post-ready background work (openclaw#117083)
  test(google): cover live transcript overflow
  fix(google): bound live transcript accumulation
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
* commit 'ae4e662145b6aa162777cdb1c011b3f04ddd230d': (388 commits)
  fix(qqbot): ignore blank app id fallbacks (openclaw#109460)
  fix(feishu): consume implicit reply targets across media delivery (openclaw#117196)
  fix(exec): preserve approved command output when sessions resume (openclaw#117177)
  fix(qa): use public subagent fanout evidence (openclaw#116832)
  fix(googlechat): cancel unread auth response bodies before release (openclaw#115873)
  fix(queue): prevent cron saturation from starving hook dispatch (openclaw#116666)
  fix(gateway): sessions.steer retry no longer interrupts an active run when replaying a cached idempotency key (openclaw#116969)
  fix(irc): config validation rejects documented channels.irc.configWrites key (openclaw#112392)
  fix(mistral): keep terminal error branch lint-clean
  fix(onboard): stop a full reset from resetting the default workspace when the config is unreadable (openclaw#114110)
  refactor(i18n): remove unused Apple contradiction report (openclaw#117182)
  fix(google): stop scraping Gemini CLI OAuth credentials (openclaw#117167)
  perf: count large histories before Gateway prewarm (openclaw#117118)
  fix(signal): restore provider-safe original attachment filenames (openclaw#115107)
  refactor(channels): unify setup ownership across bundled channels (openclaw#117188)
  fix: allow gateway service commands for named profiles (openclaw#116314)
  fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041)
  fix(ollama): honor model requests and pull completion contracts (openclaw#117171)
  fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168)
  fix(telegram): confirm polling before long poll (openclaw#116970)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: signal Channel integration: signal maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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