-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Feature]: Add a generic outbound artifact delivery guard #77448
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
Add a channel-neutral outbound artifact delivery guard that turns validated generated file/media references into real attachments and strips unsafe raw path/directive text from the final chat.
Problem to solve
File-generating agent workflows can end with text such as
MEDIA:./exports/report.xlsx,File: /workspace/exports/report.xlsx,file://..., or structured assistant content/metadata that carries media URLs separately from final prose. If that path is not normalized and delivered through the channel attachment path, the user may see a raw local path or a claim that a file was attached when no attachment was actually sent.Prompt-only guidance and per-skill conventions are not enough because this is a final-mile transport invariant: the system needs to know whether the attachment actually delivered before deciding whether to strip, keep, or replace the final text.
Proposed solution
Introduce an upstream, generic guard/hook near outbound reply rendering and channel delivery:
MEDIA:/local-path delivery text only after concrete send success.This should stay channel-neutral. Telegram can be one supported channel, but the core behavior should not be a Telegram-specific patch.
Alternatives considered
Impact
Affected users/systems/channels:
Severity: medium to high for artifact-heavy workflows because users can believe a file was sent when it was not, or receive unusable local paths.
Frequency: intermittent but recurring in workflows where tools emit final text plus file paths/media directives.
Consequence: failed deliveries, raw local path leakage, extra manual re-uploading, and brittle per-skill workarounds.
Evidence/examples
In a private OpenClaw deployment, a downstream guard proved useful by catching these cases before final chat delivery:
MEDIA:./exports/...MEDIA:metadata.mediaUrlsArchivo: /workspace/exports/file.xlsxThe implementation is deployment-specific today, so I am opening this as an upstream design issue first rather than proposing a direct copy into core.
Additional information
This pairs well with transcript hygiene: raw delivery directives are transport instructions, not durable assistant prose. A follow-up PR could start with a small generic parser/guard and synthetic-channel tests once the maintainers agree on the hook location.