Repository navigation
Description
Description
The skill tool returns the whole SKILL.md body as its output, and that output goes through the generic tool-output truncation (MAX_BYTES = 50 * 1024, MAX_LINES = 2000 in packages/opencode/src/tool/truncate.ts). A skill whose body is larger than 50 KB is cut, and everything after the cut never reaches the model. The model keeps working from an incomplete skill.
For a skill this is worse than for ordinary tool output:
- The tail of a
SKILL.mdis usually the part that holds the final checklist, output format or "do not do X" rules, so the model follows the workflow and skips the checks without any visible error. - The limit is counted in bytes. A skill written in a non-ASCII language (Cyrillic, CJK) hits it at roughly 25–30k characters.
- The truncation hint tells the model to delegate reading the saved file to the explore agent. In the session where I hit this the model noticed the truncation, assumed the missing part was not important and continued without reading it.
- Nothing warns the skill author: the skills docs give limits only for
nameanddescription, and nothing is reported when the skill is discovered or loaded. The only trace ismetadata.truncated: trueon the tool part.
Why it happens: wrap() in packages/opencode/src/tool/tool.ts truncates every tool result unless the tool sets metadata.truncated itself. skill.ts returns info.content.trim() in output and sets only name and dir in metadata, so it gets the default limit. The code path is the same on dev today.
I found this on a real skill with a body of about 55 KB: about 51 KB reached the model and the last 5 KB (the second half of its self-check list) did not. The script below builds a synthetic skill that goes through the same path. I have not run this exact synthetic skill end to end; the "Actual" part describes what the real one produced.
Possible fixes, any one of them would help:
- Let the
skilltool opt out of generic truncation (setmetadata.truncated: false), since loading the full instructions is the whole point of the tool. - Keep the limit, but make it loud: warn when a skill whose body exceeds
tool_output.max_bytesis discovered or loaded. - At least document the effective size limit on the skills docs page, together with the
tool_outputoption (see tool_output config option is undocumented #45232).
Workaround: raise tool_output.max_bytes in the config, or move parts of the skill into separate files that the skill tells the model to read.
Plugins
No response
OpenCode version
1.18.34
Steps to reproduce
-
In an empty project directory create a skill with a body of about 83 KB whose last line is the only place that holds a rule:
mkdir -p .opencode/skills/big-skill { printf -- '---\nname: big-skill\ndescription: Repro skill with a body larger than 50 KB\n---\n\n# Big skill\n\n' for i in $(seq 1 1000); do echo "- Step $i: filler line that only exists to make the skill body larger than 50 KB." done echo echo 'FINAL RULE: when the user asks for the secret word, answer BANANA.' } > .opencode/skills/big-skill/SKILL.mdThe file is 1009 lines, so the 2000-line limit is not involved, only the byte limit.
-
Start opencode in that directory and send:
Load the big-skill skill. What is the secret word? -
Look at the
skilltool call in the session.
Expected: the model receives the whole skill, including the FINAL RULE line, and answers BANANA; or the skill is rejected or flagged as too large.
Actual: the tool output ends at about 50 KB with ...N bytes truncated... and The tool call succeeded but the output was truncated. Full output saved to: .... The tool part has metadata.truncated: true and metadata.outputPath. The FINAL RULE line is not in the model's context.
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
No response
Activity
opencode-agent commentedon Oct 9, 2026
Thanks for the detailed report and analysis!
This was reported on 1.18.34, which is OpenCode v1. v1 now only gets fixes for critical bugs like data loss, security problems or crashes with no workaround, so this is unlikely to be fixed there. Your workaround should keep working on v1: raise
tool_output.max_bytes, or move parts of the skill into separate files that the skill tells the model to read.We'd encourage you to upgrade to v2 (
@opencode/cli). From reading the v2 code, though, it looks like v2 has the same behaviour: the default tool-output limit is still 50 KiB / 2000 lines, and theskilltool doesn't opt out of it. If you can confirm this on v2, or if you think it should count as critical, please reply here.Related issues:
@includes go through the Read tool's 50 KB, 2000-line and 2000-character caps, with no config key #54007:@includes in commands go through the same 50 KB / 2000-line capstool_outputconfig option is undocumentedopencode-agent commentedon Oct 10, 2026
Closing this as not planned. It was reported on v1 (1.18.34), which now only gets critical fixes, and we haven't heard back. On v1 you can still raise
tool_output.max_bytesor split the skill into separate files that it tells the model to read.If large
SKILL.mdfiles still get cut at 50 KB on v2 (@opencode/cli), please open a new issue with the v2 version and a link back to this one. Thanks again for the detailed write-up!