zed-industries/zed · error · anyhow::Error
shared skill exceeds the maximum size of {MAX_SKILL_FILE_SIZ
Error message
shared skill exceeds the maximum size of {MAX_SKILL_FILE_SIZE} bytes What it means
Error "shared skill exceeds the maximum size of {MAX_SKILL_FILE_SIZE} bytes" thrown in zed-industries/zed.
Source
Thrown at crates/agent_skills/agent_skills.rs:846
}
/// 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 bc538def45)
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@bc538def45 (2026-08-16).
Data as JSON: /api/errors/929d451967bc24ba.
Report an issue: GitHub.