chenhg5/cc-connect · error
message, tts text, or attachment is required
Error message
message, tts text, or attachment is required
What it means
parseSendArgs rejects requests that carry no content at all: message, TTS text, and all attachment lists (images, files, audios, videos) empty. This final validation prevents sending a pointless/empty message to the platform. It fires even when valid flags like --work-dir were given, since they carry no user content.
Source
Thrown at cmd/cc-connect/send.go:212
return req, "", err
}
videoFiles, err := loadTypedFileAttachments(videoPaths, "video", maxAtt)
if err != nil {
return req, "", err
}
req.Images = images
// Keep audio / video clips on dedicated fields. Routing them through
// req.Files would force the engine to dispatch them via FileSender —
// that loses the native voice-bubble / video-bubble path on platforms
// that implement AudioSender / VideoSender (e.g. Feishu's ffmpeg
// transcode for mp3 → opus). See cc-connect internal task
// t-20260615-cqjbk1.
req.Files = files
req.Audios = audioFiles
req.Videos = videoFiles
if req.Message == "" && req.TTSText == "" && len(req.Images) == 0 && len(req.Files) == 0 && len(req.Audios) == 0 && len(req.Videos) == 0 {
return req, "", fmt.Errorf("message, tts text, or attachment is required")
}
return req, dataDir, nil
}
func loadImageAttachments(paths []string, maxSize int64) ([]core.ImageAttachment, error) {
images := make([]core.ImageAttachment, 0, len(paths))
for _, path := range paths {
data, fileName, mimeType, err := readAttachment(path, maxSize)
if err != nil {
return nil, err
}
if !strings.HasPrefix(mimeType, "image/") {
return nil, fmt.Errorf("%s is not an image (detected mime: %s)", path, mimeType)
}
images = append(images, core.ImageAttachment{MimeType: mimeType, Data: data, FileName: fileName})
}
return images, nilView on GitHub (pinned to 4000b2338a)
Solutions
- Provide content: add `--message "..."`, `--tts "..."`, or at least one --image/--file/--audio/--video.
- If piping via --stdin, verify the producer emits non-empty output (whitespace-only stdin is trimmed to empty).
- In scripts, guard: `[ -n "$MSG" ] || cc-connect send --image "$IMG" ...`.
- Check the config/source that was supposed to supply the message text.
Example fix
// before cc-connect send --work-dir /proj // after cc-connect send --work-dir /proj --message "run the tests"
Defensive patterns
Strategy: validation
Validate before calling
MSG=${MSG:-}
if [ -z "$MSG" ] && [ -z "$IMG" ] && [ -z "$FILE" ]; then
echo "nothing to send"; exit 1
fi
cmd=(cc-connect send)
[ -n "$MSG" ] && cmd+=(--message "$MSG")
[ -n "$IMG" ] && cmd+=(--image "$IMG") Prevention
- Always supply at least one of --message, --tts, or an attachment flag.
- Check for empty message variables in scripts.
- Remember --stdin with empty input counts as no content.
- Flags like --work-dir/--at-users do not satisfy the content requirement.
When it happens
Trigger: `cc-connect send --work-dir /p` with no --message, --tts, or attachment flags; `--stdin` used but stdin was empty; attachment variables empty so no --image/--file flags were added.
Common situations: Automated scripts where the message variable is empty and no attachments resolved; piping an empty string via --stdin; forgetting that flags like --data-dir or --at-users alone do not satisfy the content requirement.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- %s must be true or false
- timeout_mins must be an integer
- invalid value for --log-max-size: %s
- invalid --platform-type %q, want feishu or lark
- %s is not %s media (detected mime: %s)
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/b035057a9fba03b0.
Report an issue: GitHub.