zed-industries/zed · error
shared skill exceeds the maximum size of
Error message
shared skill exceeds the maximum size of {MAX_SKILL_FILE_SIZE} bytes What it means
Raised by decode_skill_share_link after successfully extracting the base64url data parameter: the decoded SKILL.md payload exceeds MAX_SKILL_FILE_SIZE bytes. This guard prevents unbounded memory use when inflating attacker-controllable share links; the offending input is the oversized data payload embedded in the link.
Solutions
- Reduce the skill file size by trimming body content or metadata
- Share the skill via a file instead of a self-contained link
- Split large content into referenced assets rather than embedding everything in SKILL.md
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/agent_skills/agent_skills.rs:846 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20).
Data as JSON: /api/errors/929d451967bc24ba.
Report an issue: GitHub.
Appendix: source
Thrown at crates/agent_skills/agent_skills.rs:843
}
/// Recover the `SKILL.md` contents embedded in a `zed://skill?data=…` link
/// produced by [`encode_skill_share_link`].
pub fn decode_skill_share_link(link: &str) -> Result<String> {
use base64::Engine as _;
let url = Url::parse(link).context("skill share link is not a valid URL")?;
anyhow::ensure!(
url.scheme() == SKILL_SHARE_LINK_SCHEME && url.host_str() == Some(SKILL_SHARE_LINK_HOST),
"not a skill share link"
);
let data = url
.query_pairs()
.find_map(|(key, value)| (key == SKILL_SHARE_LINK_DATA_PARAM).then_some(value))
.context("skill share link is missing the `data` parameter")?;
let bytes = base64::engine::general_purpose::URL_SAFE_NO_PAD
.decode(data.as_bytes())
.context("skill share link `data` is not valid base64")?;
anyhow::ensure!(
bytes.len() <= MAX_SKILL_FILE_SIZE,
"shared skill exceeds the maximum size of {MAX_SKILL_FILE_SIZE} bytes"
);
let content = String::from_utf8(bytes).context("skill share link `data` is not valid UTF-8")?;
Ok(content)
}
#[cfg(test)]
mod tests {
use super::*;
use fs::FakeFs;
use gpui::TestAppContext;
#[test]
fn test_skill_source_precedence_is_total_and_ordered() {
// Pin the hierarchy: project-local > global > built-in. Every
// override and conflict-resolution site routes through this,
// so the rest of the codebase relies on it being correct.View on GitHub (pinned to 9d272b0363)