Skip to content

[Bug]: message schema advertises buffer for Discord upload-file, which rejects it without pointing at send #123747

Closed

Description

@feniix

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

The message tool schema advertises buffer for every action, but Discord upload-file never reads it and rejects a buffer-only call with upload-file requires filePath, path, or media. — an error that never mentions that action: "send" is the supported path for base64 buffer attachments.

Steps to reproduce

  1. On OpenClaw 2026.7.1 (also reproducible from source on current main) with a configured Discord channel, call the message tool with action: "upload-file", a valid to target, filename, contentType, and a valid base64 buffer.
  2. Observe the error upload-file requires filePath, path, or media.
  3. Call action: "send" with the same buffer, filename, and contentType.
  4. Observe successful attachment delivery.

Expected behavior

Either the published schema/action guidance makes clear that buffer belongs to action: "send", or the upload-file failure tells the caller what to do instead. Since send + buffer already covers the in-memory-bytes use case (#90768), upload-file + buffer duplicating it adds nothing — the defect is the advertised contract and the dead-end error, not the runtime split.

Actual behavior

  • The flat tool schema (kept flat on purpose — provider adapters reject per-action anyOf) describes buffer only as Base64/data-URL attachment., so callers reasonably infer it works with upload-file (src/agents/tools/message-tool-schema.ts).
  • Discord's upload-file branch reads only filePath/path/media and throws upload-file requires filePath, path, or media. even when a buffer was supplied (extensions/discord/src/actions/handle-action.ts).
  • Agents retry variations of upload-file instead of switching to send.

OpenClaw version

2026.7.1 (reproduced), also present in source on main as of 2026-08-14

Operating system

macOS 26 (Tahoe), Apple Silicon

Install method

npm global

Model

n/a — tool-contract behavior, reproduces before any model/provider call

Provider / routing chain

n/a — fails in the message tool's Discord action dispatch, no provider involved

Logs

# message tool call: action=upload-file, to=channel:<id>, filename=report.pdf,
# contentType=application/pdf, buffer=<valid base64>
Error: upload-file requires filePath, path, or media.

# identical payload with action=send delivers the attachment

Impact and severity

  • Affected: any agent or caller driving Discord file sends through the message tool with in-memory/generated bytes.
  • Severity: annoying — the capability exists under send, but the schema invites the failing shape and the error gives no redirect.
  • Frequency: always, for upload-file + buffer with no file-source param.
  • Consequence: burned retries and misdiagnosis (the error reads like a Discord-side rejection); workaround is materializing bytes to an allowed path or knowing to use send.

Additional information

Related prior fixes that do not cover this: #60652 (Discord now advertises upload-file) and #90768 (buffer-only attachments for send). Sibling-channel note: iMessage's upload-file maps to sendAttachment and does accept a buffer, so a global "buffer is send-only" schema claim would be wrong — the guidance needs to steer toward send without breaking that channel. A PR follows that scopes the buffer schema description to send and makes the Discord buffer-only upload-file failure point at send.

Activity

  1. added
    clawsweeper:linked-pr-open
    clawsweeper:no-new-fix-pr
    clawsweeper:source-repro
    impact:ux-friction
    issue-rating: 🦞 diamond lobster
    maturity:stable
    P2
    on Aug 14, 2026
  2. clawsweeper commented on Aug 14, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 21, 2026, 9:14 AM ET / 13:14 UTC.

    Summary
    Keep open: current main still gives Discord buffer-only upload-file calls a path-only error, and the linked open PR is the focused candidate fix.

    Reproducibility: yes. —current main source shows a buffer-only upload-file request reaches Discord’s path-only rejection, while send stages the same buffer for delivery.

    Root-cause cluster
    Relationship: canonical
    Canonical: #123747
    Summary: This issue is the canonical report for Discord’s buffer-only upload-file dead end; an open PR is its candidate repair.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Next step
    The linked open PR already owns the narrow repair, so a parallel fix job would duplicate contributor work.

    Review details

    Best possible solution:

    Land the linked PR after rebasing it onto current main and preserving its Discord-local redirect plus regression coverage.

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

    Yes—current main source shows a buffer-only upload-file request reaches Discord’s path-only rejection, while send stages the same buffer for delivery.

    Is this the best way to solve the issue?

    Yes—the linked Discord-local redirect reuses the established send + buffer capability without incorrectly making the shared schema send-only for channels such as iMessage.

    AGENTS.md: found and applied where relevant.

    Codex review notes: model internal, reasoning high; reviewed against 587c7524e58d.

    Label changes

    Label justifications:

    • P2: The repeatable Discord tool-contract dead end affects attachment workflows but has an existing working send path.
    • impact:ux-friction: The current error omits the supported action and encourages avoidable retries.
    • maturity:stable: This is a broken existing Discord delivery contract, and Discord is an M4 Stable primary surface.
    Evidence reviewed

    What I checked:

    Likely related people:

    • Peter Steinberger: Current blame identifies his commit on the exact error path, and current history records his later Discord action refactor. (role: recent Discord action contributor; confidence: medium; commits: c02129523383, 782a7d7aed45; files: extensions/discord/src/actions/handle-action.ts, extensions/discord/src/channel-actions.ts)
    How this review workflow works
    • 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.
  3. jinngimk-lang commented on Aug 17, 2026

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2clawsweeper:linked-pr-openclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:ux-frictionissue-rating: 🦞 diamond lobstermaturity:stable

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions