Hmbown/CodeWhale · error
bundle at has kind ; expected
Error message
bundle at {source} has kind {:?}; expected {BUNDLE_KIND:?} What it means
A portable config bundle was parsed successfully, but its `kind` field does not match the `BUNDLE_KIND` constant this build of the CLI supports. The CLI only imports bundles of the exact expected kind so it never misinterprets a bundle written for another subsystem. Thrown by `validate_bundle` in crates/cli/src/config_bundles.rs during `parse_bundle_str`, before any bundle content is applied.
Solutions
- Open the bundle file and check its `kind` field; re-export the bundle from the matching codewhale CLI with `config bundle export`.
- Upgrade (or downgrade) the CLI to the build that understands this bundle kind.
- If the bundle is hand-maintained, correct the `kind` field to the expected value shown in the message.
Example fix
// before (bundle.json)
{ "kind": "project-settings-v2", ... }
// after
{ "kind": "codewhale-config-bundle", ... } // must equal the BUNDLE_KIND this build expects Defensive patterns
Strategy: validation
Validate before calling
let bundle: serde_json::Value = serde_json::from_str(&text)?;
if bundle.get("kind").and_then(|k| k.as_str()) != Some(EXPECTED_BUNDLE_KIND) {
return Err(format!("bundle kind {:?} not supported; expected {:?}", bundle.get("kind"), EXPECTED_BUNDLE_KIND));
} Type guard
fn has_expected_kind(v: &serde_json::Value, expected: &str) -> bool {
v.get("kind").and_then(|k| k.as_str()) == Some(expected)
} Prevention
- Always re-export bundles with the same CLI build that will import them.
- Validate a downloaded bundle's `kind` field before importing.
- Never hand-edit the `kind` field of a bundle.
When it happens
Trigger: Calling `codewhale config bundle import` (via `parse_bundle_str` -> `validate_bundle`) with a bundle file whose top-level `kind` field differs from BUNDLE_KIND — e.g. a bundle produced by a different tool or a future/other bundle type.
Common situations: Downloading a bundle from a third party that is actually a different bundle type; editing a bundle's `kind` by hand; a repo/tooling version drift where a bundle was exported by a component writing a different kind.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- A positive pull request number is required
- API key contains invalid control characters
- API key id must be lowercase hex characters — the part…
- API key input is unexpectedly large
- API key must be - UTF-8 bytes
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/4a72a2c740519d08.
Report an issue: GitHub.
Appendix: source
Thrown at crates/cli/src/config_bundles.rs:231
}
Ok(())
}
}
let mut deserializer = serde_json::Deserializer::from_str(text);
let mut path = Vec::new();
NoDuplicates { path: &mut path }
.deserialize(&mut deserializer)
.map_err(|error| anyhow::anyhow!("{error}"))?;
deserializer
.end()
.map_err(|error| anyhow::anyhow!("{error}"))?;
Ok(())
}
fn validate_bundle(bundle: &PortableBundle, source: &str) -> Result<()> {
if bundle.kind != BUNDLE_KIND {
bail!(
"bundle at {source} has kind {:?}; expected {BUNDLE_KIND:?}",
bundle.kind
);
}
if bundle.schema_version != BUNDLE_SCHEMA_VERSION {
bail!(
"bundle at {source} has schema_version {}; this build understands {BUNDLE_SCHEMA_VERSION}",
bundle.schema_version
);
}
Ok(())
}
// ---------------------------------------------------------------------------
// Secret rejection
// ---------------------------------------------------------------------------
/// One rejected entry: the dotted key path and the reason. Values are neverView on GitHub (pinned to 73e0f67d83)