larksuite/cli · error

exec provider value for id %q is not JSON-serializable: %w

Error message

exec provider value for id %q is not JSON-serializable: %w

What it means

The value for refID is a non-string JSON type and jsonOnly is false, so the resolver attempts to JSON-encode it (mirroring OpenClaw's resolve.ts fallback); encoding/json rejected the value - e.g. a channel, func, cyclic reference, or NaN float.

Source

Thrown at internal/binding/secret_resolve_exec.go:236

		}
		return "", fmt.Errorf("exec provider failed for id %q: %s", refID, msg)
	}

	if resp.Values == nil {
		return "", fmt.Errorf("exec provider response missing 'values'")
	}
	value, ok := resp.Values[refID]
	if !ok {
		return "", fmt.Errorf("exec provider response missing id %q", refID)
	}

	if str, ok := value.(string); ok {
		return str, nil
	}
	if !jsonOnly {
		data, err := json.Marshal(value)
		if err != nil {
			return "", fmt.Errorf("exec provider value for id %q is not JSON-serializable: %w", refID, err)
		}
		return string(data), nil
	}
	return "", fmt.Errorf("exec provider value for id %q is not a string", refID)
}

View on GitHub (pinned to 7fd6ef3c07)

Solutions

  1. Return the secret as a JSON string or a plainly serializable value (no NaN, cycles, or channels)
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at internal/binding/secret_resolve_exec.go:236 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/2447ec0792fe7e85. Report an issue: GitHub.