larksuite/cli · error
L1: _meta.envelope_version = %q, want "1.0"
Error message
L1: _meta.envelope_version = %q, want "1.0"
What it means
lintEnvelope requires _meta.envelope_version to be exactly "1.0". This error is thrown when the envelope declares a different (or missing/empty) envelope version, signaling the envelope was authored against an unsupported contract revision.
Source
Thrown at internal/schema/lint.go:59
}
if env.InputSchema.Properties == nil {
errs = append(errs, errors.New("L1: inputSchema.properties must not be nil"))
}
}
if env.OutputSchema == nil {
errs = append(errs, errors.New("L1: outputSchema must not be nil"))
} else {
if env.OutputSchema.Type != "object" {
errs = append(errs, fmt.Errorf("L1: outputSchema.type = %q, want \"object\"", env.OutputSchema.Type))
}
}
if env.Meta == nil {
errs = append(errs, errors.New("L1: _meta must not be nil"))
// Cannot continue meta-dependent checks
return errs
}
if env.Meta.EnvelopeVersion != "1.0" {
errs = append(errs, fmt.Errorf("L1: _meta.envelope_version = %q, want \"1.0\"", env.Meta.EnvelopeVersion))
}
// L1: validate every Property type recursively
if env.InputSchema != nil && env.InputSchema.Properties != nil {
validatePropertyTypes(env.InputSchema.Properties, &errs)
}
if env.OutputSchema != nil && env.OutputSchema.Properties != nil {
validatePropertyTypes(env.OutputSchema.Properties, &errs)
}
// ---- L2: type-level consistency ----
if env.InputSchema != nil && env.InputSchema.Properties != nil {
// Walk the whole property tree so format/min-max checks reach leaf
// fields nested under the params/data wrapper.
walkForL2(env.InputSchema.Properties, &errs)
// Top-level required keys must exist in top-level properties.
for _, r := range env.InputSchema.Required {
if _, ok := env.InputSchema.Properties.Map[r]; !ok {View on GitHub (pinned to 7fd6ef3c07)
Solutions
- Set _meta.envelope_version to the literal string "1.0".
- If you intend a new envelope version, update the lint contract and all consumers together — do not change the value unilaterally.
- Check that the field is a string "1.0", not the JSON number 1.0.
Example fix
// before
"_meta": { "envelope_version": "1.1" }
// after
"_meta": { "envelope_version": "1.0" } Defensive patterns
Strategy: validation
Validate before calling
func envelopeVersionOK(env map[string]any) bool {
m, ok := env["_meta"].(map[string]any)
v, ok2 := m["envelope_version"]
return ok && ok2 && v == "1.0"
} Type guard
func isSupportedEnvelopeVersion(env *Envelope) bool { return env.Meta != nil && env.Meta.EnvelopeVersion == "1.0" } Try / catch
errs := lintEnvelope(env)
for _, e := range errs {
if strings.Contains(e.Error(), "envelope_version") {
// set _meta.envelope_version to the literal string "1.0"
}
} Prevention
- Use the literal string "1.0", never a number or other revision.
- Only bump envelope_version together with the lint contract and consumers.
- Keep envelope templates sourced from the current spec.
When it happens
Trigger: Linting an envelope where _meta.envelope_version is "1", "2.0", "1.1", or absent/empty rather than the literal string "1.0".
Common situations: Copying an envelope template from a newer/older draft spec; bumping the version speculatively while the lint still expects 1.0; hand-written envelopes missing the field or using a JSON number instead of a string.
Related errors
- L1: inputSchema.type = %q, want "object"
- L1: outputSchema.type = %q, want "object"
- L2: required key %q not found in properties
- L3: _meta.danger=%v inconsistent with risk=%q
- expected boolean
AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04).
Data as JSON: /api/errors/52426bdd40318635.
Report an issue: GitHub.