larksuite/cli · error · ErrInvalidRemap
: cannot inspect target
Error message
%w: cannot inspect target %q: %w
What it means
Wraps a probe failure when New verifies the remap target exists in the embedded content filesystem. If the target reference cannot be inspected (read error), resolver construction fails with ErrInvalidRemap.
Solutions
- Check the embedded-FS layout and readability of the target path
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/skillref/resolver.go:71 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04).
Data as JSON: /api/errors/33815e8b7bac4baa.
Report an issue: GitHub.
Appendix: source
Thrown at internal/skillref/resolver.go:71
key := from.String()
if seen[key] {
return nil, fmt.Errorf("%w: source %q is mapped more than once", ErrInvalidRemap, key)
}
seen[key] = true
if from.Path == "" {
if to.Path != "" {
return nil, fmt.Errorf(
"%w: whole-skill source %q requires a bare target skill, got %q",
ErrInvalidRemap, key, to.String())
}
r.skills[from.Skill] = to
} else {
r.exact[key] = to
}
exists, err := probe(content, to)
if err != nil {
return nil, fmt.Errorf("%w: cannot inspect target %q: %w",
ErrInvalidRemap, to.String(), err)
}
if !exists {
return nil, fmt.Errorf("%w: target %q does not exist in the composed skill tree",
ErrInvalidRemap, to.String())
}
}
return r, nil
}
// Resolve projects canonical through the exact-reference map first, then the
// whole-skill map, and finally identity. It returns ok=false when the projected
// target is not currently readable.
func (r *Resolver) Resolve(canonical Ref) (target Ref, ok bool) {
if r == nil {
return Ref{}, false
}
if exact, found := r.exact[canonical.String()]; found {View on GitHub (pinned to 7fd6ef3c07)