Repository navigation
Description
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
- On OpenClaw 2026.7.1 (also reproducible from source on current
main) with a configured Discord channel, call themessagetool withaction: "upload-file", a validtotarget,filename,contentType, and a valid base64buffer. - Observe the error
upload-file requires filePath, path, or media. - Call
action: "send"with the samebuffer,filename, andcontentType. - 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) describesbufferonly asBase64/data-URL attachment., so callers reasonably infer it works withupload-file(src/agents/tools/message-tool-schema.ts). - Discord's
upload-filebranch reads onlyfilePath/path/mediaand throwsupload-file requires filePath, path, or media.even when abufferwas supplied (extensions/discord/src/actions/handle-action.ts). - Agents retry variations of
upload-fileinstead of switching tosend.
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 attachmentImpact and severity
- Affected: any agent or caller driving Discord file sends through the
messagetool 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+bufferwith 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.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Aug 14, 2026
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-filecalls a path-only error, and the linked open PR is the focused candidate fix.Reproducibility: yes. —current main source shows a buffer-only
upload-filerequest reaches Discord’s path-only rejection, whilesendstages the same buffer for delivery.Root-cause cluster
Relationship:
canonicalCanonical: #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:
fixed_by_candidate: fix(discord): upload-file with a base64 buffer fails without pointing at send #123748 - The open PR explicitly addresses this exact Discord error path.adjacent_distinct: [Bug]: message.send can fail for buffer-only attachments without an explicit media path or URL #90768 - That closed issue established the working send-plus-buffer delivery path referenced by this repair.adjacent_distinct: [Bug]: Discord message tool never advertises upload-file/sendAttachment — agents cannot discover file-send capability #60652 - That closed issue covered discovery of Discord file actions rather than this buffer-only error guidance.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-filerequest reaches Discord’s path-only rejection, whilesendstages the same buffer for delivery.Is this the best way to solve the issue?
Yes—the linked Discord-local redirect reuses the established
send + buffercapability 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:
bufferas a base64/data-URL attachment field while retaining a flat action object. (src/agents/tools/message-tool-schema.ts:150, 587c7524e58d)upload-filereads onlyfilePath,path, ormediaand throws the reported error when none is present. (extensions/discord/src/actions/handle-action.ts:271, 587c7524e58d)src/infra/outbound/message-action-params.ts:372, 587c7524e58d)send. (extensions/discord/src/actions/handle-action.test.ts:596, 587c7524e58d)extensions/discord/src/actions/handle-action.ts:278, c02129523383)Likely related people:
extensions/discord/src/actions/handle-action.ts,extensions/discord/src/channel-actions.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.jinngimk-lang commentedon Aug 17, 2026