siyuan-note/siyuan · warning
text files must be at most 8 MiB
Error message
text files must be at most 8 MiB
What it means
ErrSkillTooLarge indicates a skill file exceeds the 8 MiB (maxManagedSkillSourceSize) text-editing limit. It is checked both on size at read time (readManagedSkillSource) and on submitted content length (validateManagedSkillSource), keeping the editor from loading or persisting oversized text.
Solutions
- Reduce the file below 8 MiB — split it or remove bulk content
- Move large data out of the skill directory and reference it by path instead of inlining
- If it is truly a data artifact, treat it as a non-editable resource rather than text
Example fix
// before
content := hugeGeneratedDump // > 8 MiB
ManageSkillFiles(SkillFileRequest{Action: "write", Path: "my-skill/SKILL.md", Content: content})
// after
data := hugeGeneratedDump
if len(data) <= 8*1024*1024 {
ManageSkillFiles(SkillFileRequest{Action: "write", Path: "my-skill/SKILL.md", Content: data})
}
Defensive patterns
Strategy: validation
Validate before calling
const MAX = 8 * 1024 * 1024;
if (new TextEncoder().encode(content).length > MAX) {
throw new Error('content exceeds 8 MiB skill file limit');
} Try / catch
try {
await api.manageSkillFiles({action: 'write', path, content});
} catch (e) {
if (e.message.includes('at most 8 MiB')) {
// split or externalize the content
}
} Prevention
- Check file size before reading/writing large skill files
- Keep logs and data dumps out of skill directories
- Split very large content into multiple files
When it happens
Trigger: Reading a skill file whose on-disk size is > 8 MiB, or writing/creating a skill file whose content string length exceeds 8 MiB via ManageSkillFiles.
Common situations: Dumping large logs or generated data dumps into a skill file; pasting a huge dataset into the editor; an accidentally bundled large text artifact.
Understand the failure class
Background: "File too large" / "file size exceeds limit" errors: why libraries cap file sizes and how to fix them — this error's family across 46 libraries.
Related errors
- binary files cannot be edited as text
- marketplace package contains a file that is too large
- only UTF-8 text files can be edited
- template document tree output exceeds
- 346
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/5ed935623feb49c2.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/util/skill_manage.go:32
"path"
"path/filepath"
"strings"
"sync"
"unicode"
"unicode/utf8"
"github.com/88250/lute/ast"
"github.com/siyuan-note/filelock"
)
const maxManagedSkillSourceSize = 8 * 1024 * 1024
var skillManagementLock sync.Mutex
var (
ErrSkillBinary = errors.New("binary files cannot be edited as text")
ErrSkillEncoding = errors.New("only UTF-8 text files can be edited")
ErrSkillTooLarge = errors.New("text files must be at most 8 MiB")
)
type SkillFileRequest struct {
Action string
Path string
Target string
Content string
Revision string
}
type SkillFileEntry struct {
Path string
IsDir bool
Editable bool
}
type SkillFileData struct {
Entries []SkillFileEntryView on GitHub (pinned to 9f775e8a12)